OSDN Git Service

Add: tutorial PIONE-PNML for multiple input and output v2.0.2p0058
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 5 Nov 2014 08:30:27 +0000 (17:30 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 5 Nov 2014 08:30:27 +0000 (17:30 +0900)
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSed.md
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSed.pnml
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input1.txt
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input2.txt
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line1.swap
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line2.swap
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref1.sed
new file:   SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref2.sed

SampleCode/PIONE-PNML/Basic3/TextSwapSed.md [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSed.pnml [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input1.txt [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input2.txt [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line1.swap [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line2.swap [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref1.sed [new file with mode: 0644]
SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref2.sed [new file with mode: 0644]

diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSed.md b/SampleCode/PIONE-PNML/Basic3/TextSwapSed.md
new file mode 100644 (file)
index 0000000..b00f43a
--- /dev/null
@@ -0,0 +1,45 @@
+# TextSwapSed.pione
+
+## TextSwap
+
+```
+cp {$I[1]} intmp;
+while read line ; \
+do \
+       i1=$(echo $line | awk '{printf("%d", $1)}'); \
+       i2=$(echo $line | awk '{printf("%d", $2)}'); \
+       lnum=$(wc -l intmp | awk '{printf("%d", $1)}'); \
+       c1=$(expr $lnum - $i2); \
+       c2=$(expr $i2 - $i1); \
+       top=$( head -$i1 intmp ); \
+       middle=$( head -$i2 intmp | tail -$c2 ); \
+       bottom=$( tail -$c1 intmp ); \
+       t1=$(expr $i1 - 1); \
+       m1=$(expr $c2 - 1); \
+       top1=$( echo "$top" | head -$t1 ); \
+       str1=$( echo "$top" | tail -1 ); \
+       middle1=$( echo "$middle" | head -$m1 ); \
+       str2=$( echo "$middle" | tail -1 ); \
+       echo "$top1" > outtmp; \
+       echo "$str2" >> outtmp; \
+       echo "$middle1" >> outtmp; \
+       echo "$str1" >> outtmp; \
+       echo "$bottom" >> outtmp; \
+       cat outtmp | sed '/^$/d' > intmp; \
+done < {$I[2]};
+mv intmp {$O[1]};
+```
+
+## TextSed
+
+```
+cp {$I[1]} intmp;
+while read line ; \
+do \
+       str1=$(echo $line | awk '{printf("%s", $1)}'); \
+       str2=$(echo $line | awk '{printf("%s", $2)}'); \
+       sed -e "s/$str1/$str2/g" intmp > outtmp; \
+       cat outtmp | sed '/^$/d' > intmp; \
+done < {$I[2]};
+mv intmp {$O[1]};
+```
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSed.pnml b/SampleCode/PIONE-PNML/Basic3/TextSwapSed.pnml
new file mode 100644 (file)
index 0000000..873716c
--- /dev/null
@@ -0,0 +1,440 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--PLEASE DO NOT EDIT THIS FILE
+Created with Workflow PetriNet Designer Version 3.2.0 (woped.org)-->
+<pnml>
+  <net type="http://www.informatik.hu-berlin.de/top/pntd/ptNetb" id="noID">
+    <place id="p1">
+      <name>
+        <text>>'*.sdtxt'</text>
+        <graphics>
+          <offset x="470" y="190"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="470" y="150"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p2">
+      <name>
+        <text>&lt;'*.txt'.all</text>
+        <graphics>
+          <offset x="10" y="90"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="20" y="110"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p3">
+      <name>
+        <text>&lt;'*.swap'.all</text>
+        <graphics>
+          <offset x="10" y="10"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="20" y="30"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p4">
+      <name>
+        <text>&lt;'*.sed'.all</text>
+        <graphics>
+          <offset x="10" y="160"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="20" y="180"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p5">
+      <name>
+        <text>'*.swap'</text>
+        <graphics>
+          <offset x="130" y="70"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="130" y="30"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p6">
+      <name>
+        <text>'*.sed'</text>
+        <graphics>
+          <offset x="130" y="220"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="130" y="180"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p7">
+      <name>
+        <text>>'*.swtxt'</text>
+        <graphics>
+          <offset x="470" y="100"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="470" y="60"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p8">
+      <name>
+        <text>'*.txt'</text>
+        <graphics>
+          <offset x="130" y="150"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="130" y="110"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p9">
+      <name>
+        <text>'{$I[1][1]}-{$I[2][1]}.swtxt'</text>
+        <graphics>
+          <offset x="270" y="100"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="320" y="60"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <place id="p10">
+      <name>
+        <text>'{$I[1][1]}-{$I[2][1]}.sdtxt'</text>
+        <graphics>
+          <offset x="270" y="190"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="330" y="150"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+    </place>
+    <transition id="t4">
+      <name>
+        <text>TextSwap</text>
+        <graphics>
+          <offset x="210" y="100"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="210" y="60"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t5">
+      <name>
+        <text/>
+        <graphics>
+          <offset x="410" y="100"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="410" y="60"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t6">
+      <name>
+        <text>TextSed</text>
+        <graphics>
+          <offset x="210" y="190"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="210" y="150"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t7">
+      <name>
+        <text/>
+        <graphics>
+          <offset x="410" y="190"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="410" y="150"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t1">
+      <name>
+        <text/>
+        <graphics>
+          <offset x="70" y="70"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="70" y="30"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t2">
+      <name>
+        <text/>
+        <graphics>
+          <offset x="70" y="150"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="70" y="110"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <transition id="t3">
+      <name>
+        <text/>
+        <graphics>
+          <offset x="70" y="220"/>
+        </graphics>
+      </name>
+      <graphics>
+        <position x="70" y="180"/>
+        <dimension x="40" y="40"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <time>0</time>
+        <timeUnit>1</timeUnit>
+        <orientation>1</orientation>
+      </toolspecific>
+    </transition>
+    <arc id="a11" source="t5" target="p7">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a10" source="p9" target="t5">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a13" source="p8" target="t6">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a12" source="p6" target="t6">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a15" source="p10" target="t7">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a14" source="t6" target="p10">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a17" source="t2" target="p8">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a16" source="t7" target="p1">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics>
+        <position x="468" y="171"/>
+      </graphics>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a19" source="t3" target="p6">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a1" source="p3" target="t1">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a2" source="t1" target="p5">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a3" source="p2" target="t2">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a5" source="p4" target="t3">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a7" source="p8" target="t4">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a8" source="p5" target="t4">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <arc id="a9" source="t4" target="p9">
+      <inscription>
+        <text>1</text>
+      </inscription>
+      <graphics/>
+      <toolspecific tool="WoPeD" version="1.0">
+        <probability>1.0</probability>
+        <displayProbabilityOn>false</displayProbabilityOn>
+        <displayProbabilityPosition x="500.0" y="0.0"/>
+      </toolspecific>
+    </arc>
+    <toolspecific tool="WoPeD" version="1.0">
+      <bounds>
+        <position x="11" y="33"/>
+        <dimension x="755" y="474"/>
+      </bounds>
+      <scale>100</scale>
+      <treeWidthRight>570</treeWidthRight>
+      <overviewPanelVisible>true</overviewPanelVisible>
+      <treeHeightOverview>100</treeHeightOverview>
+      <treePanelVisible>true</treePanelVisible>
+      <verticalLayout>false</verticalLayout>
+      <resources/>
+      <simulations/>
+      <partnerLinks/>
+      <variables/>
+    </toolspecific>
+  </net>
+</pnml>
\ No newline at end of file
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input1.txt b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input1.txt
new file mode 100644 (file)
index 0000000..b528569
--- /dev/null
@@ -0,0 +1,8 @@
+aaa
+aab
+aba
+abb
+baa
+bab
+bba
+bbb
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input2.txt b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/Input2.txt
new file mode 100644 (file)
index 0000000..36cec36
--- /dev/null
@@ -0,0 +1,6 @@
+abc
+acb
+bac
+bca
+cab
+cba
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line1.swap b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line1.swap
new file mode 100644 (file)
index 0000000..fcc3eff
--- /dev/null
@@ -0,0 +1,3 @@
+1 3
+4 5
+1 6
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line2.swap b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/line2.swap
new file mode 100644 (file)
index 0000000..5c99e0c
--- /dev/null
@@ -0,0 +1,5 @@
+1 2
+1 3
+1 4
+1 5
+1 6
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref1.sed b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref1.sed
new file mode 100644 (file)
index 0000000..0197fb4
--- /dev/null
@@ -0,0 +1,3 @@
+a c
+bc bd
+dc DC
diff --git a/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref2.sed b/SampleCode/PIONE-PNML/Basic3/TextSwapSedInput/ref2.sed
new file mode 100644 (file)
index 0000000..9dadd29
--- /dev/null
@@ -0,0 +1,3 @@
+abc ddd
+aaa eee
+bc XX