OSDN Git Service

Add: PIONE tutorial to repeat for Single Particle Makefile. v2.0.2p0102
authorkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 16 Feb 2015 01:59:47 +0000 (10:59 +0900)
committerkinoshita-eos <kinoshita@yasunaga-lab.bio.kyutech.ac.jp>
Mon, 16 Feb 2015 01:59:47 +0000 (10:59 +0900)
modified:   SampleCode/PIONE/Advanced4/Anotation.pione
modified:   SampleCode/PIONE/Advanced4/Create_3d.pione
modified:   SampleCode/PIONE/Advanced4/Create_SampleROI.pione
modified:   SampleCode/PIONE/Advanced4/Create_fit_each.pione
modified:   SampleCode/PIONE/Advanced4/Create_stack.pione
modified:   SampleCode/PIONE/Advanced4/Main.pione
modified:   SampleCode/PIONE/Advanced4/Parameter.pione
new file:   SampleCode/PIONE/Advanced4/Repeat_3d.pione

SampleCode/PIONE/Advanced4/Anotation.pione
SampleCode/PIONE/Advanced4/Create_3d.pione
SampleCode/PIONE/Advanced4/Create_SampleROI.pione
SampleCode/PIONE/Advanced4/Create_fit_each.pione
SampleCode/PIONE/Advanced4/Create_stack.pione
SampleCode/PIONE/Advanced4/Main.pione
SampleCode/PIONE/Advanced4/Parameter.pione
SampleCode/PIONE/Advanced4/Repeat_3d.pione [new file with mode: 0644]

index 9b27989..775f250 100644 (file)
@@ -1,5 +1,5 @@
 .@ PackageName :: "SingleParticle_3DReconstruction"
 .@ Editor              :: "Kinoshita"
-.@ Tag                 :: "v0.2.0"
+.@ Tag                 :: "v0.3.0"
 # Ref: Makefile in Eos v2.1.16p0093
 # $EOS_HOME/Integration/SingleParticle/Makefile-fromKanae
\ No newline at end of file
index 2a21df9..a194e11 100644 (file)
@@ -1,18 +1,19 @@
 Rule Create_3d
-       input '*.3dinfo'.all
-       input '*.fit'.all
-       output '{$filename}.3d'
-       output '{$filename}.ds6'
+       input '*.3dinfo-{$count}'.all
+       input '*.fit-{$count}'.all
+       output '{$filename}-{$count}.3d'
+       output '{$filename}-{$count}.ds6'
        param $filename
+       param $count
 Action
        # Sum_3dinfo_3dlst
        for info in {$I[1]}
        do
-               cat $info >> {$filename}.3dlst
+               cat $info >> {$filename}-{$count}.3dlst
        done
 
        # Reconstruct_3dlst_3d
-       mrc2Dto3D -I {$filename}.3dlst -o {$O[1]} -InterpolationMode 2 -Double -DoubleCounter {$filename}.3dcounter -CounterThreshold 0.5 -m 1 -WeightMode 6
+       mrc2Dto3D -I {$filename}-{$count}.3dlst -o {$O[1]} -InterpolationMode 2 -Double -DoubleCounter {$filename}-{$count}.3dcounter -CounterThreshold 0.5 -m 1 -WeightMode 6
 
        # Convert_3d_ds6
        mrc2map -i {$O[1]} -o {$O[2]} -m 3 
index a9e5cb0..39e919d 100644 (file)
@@ -35,3 +35,15 @@ Action
                done
        done
 End
+
+Rule Cutout_ROI
+       input '*.mrc'
+       output '*.roi'.all
+       output '*.tiff'.all
+Action
+       Display2 -i {$I[1]}
+       for data in $(ls *.roi)
+       do
+               mrc2tiff -i ${data} -o ${data}.tiff
+       done
+End
\ No newline at end of file
index 79f702e..07a6e65 100644 (file)
@@ -1,52 +1,52 @@
 Rule Create_fit_each
        input '*.pad'
-       input '*.stack'
+       input '*-*.stack'
 if ($Flag_3DWhole or $Flag_3D4S)
        input '{$I[1][1]}.roi'
 end
 if $Flag_3D
-       output '{$I[1][1]}.fit'
-       output '{$I[1][1]}.3dinfo'
+       output '{$I[1][1]}.fit-{$I[2][2]}'
+       output '{$I[1][1]}.3dinfo-{$I[2][2]}'
 end
 if $Flag_3DWhole
-       output '{$I[1][1]}.shift'
-       output '{$I[1][1]}.3dwholeinfo'
+       output '{$I[1][1]}.shift-{$I[2][2]}'
+       output '{$I[1][1]}.3dwholeinfo-{$I[2][2]}'
 end
 if $Flag_3D4S
-       output '{$I[1][1]}.4shift'
-       output '{$I[1][1]}.3d4sinfo'
+       output '{$I[1][1]}.4shift-{$I[2][2]}'
+       output '{$I[1][1]}.3d4sinfo-{$I[2][2]}'
 end
 Action
        # Create_fit
-       mrcImageAutoRotationCorrelation -i {$I[1]} -r {$I[2]} -fit  {$I[1][1]}.fit -O {$I[1][1]}.corinfo \
+       mrcImageAutoRotationCorrelation -i {$I[1]} -r {$I[2]} -fit  {$I[1][1]}.fit-{$I[2][2]} -O {$I[1][1]}.corinfo-{$I[2][2]} \
                                                                        -n {$N_ROT} -m 18 -nRot1 {$N_ROT1} -nRot2 {$N_ROT2} -nRot3 {$N_ROT3} > /dev/null
        
        # fit_3dinfo
        if {$Flag_3D} ; then
-               awk '/Cor/ { print $18,$16,$2,$3,$4,"0.0"}' {$I[1][1]}.corinfo | sort -r | sed -e s/pad/fit/ > {$I[1][1]}.3dinfolst
-               head -n 1 {$I[1][1]}.3dinfolst | awk ' {print $2,$3,$4,$5,$6,$1'} > {$I[1][1]}.3dinfo
+               awk '/Cor/ { print $18,$16,$2,$3,$4,"0.0"}' {$I[1][1]}.corinfo-{$I[2][2]} | sort -r | sed -e s/pad/fit-{$I[2][2]}/ > {$I[1][1]}.3dinfolst-{$I[2][2]}
+               head -n 1 {$I[1][1]}.3dinfolst-{$I[2][2]} | awk ' {print $2,$3,$4,$5,$6,$1'} > {$I[1][1]}.3dinfo-{$I[2][2]}
        fi
 
        # fit_3dwholeinfo
        if {$Flag_3DWhole} ; then
-               awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[1][1]}.corinfo | sort -r | sed -e s/pad/shift/ > {$I[1][1]}.3dwholeinfolst
-               head -n 1 {$I[1][1]}.3dwholeinfolst | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$I[1][1]}.3dwholeinfo
-               X=`awk '{print -{$SHRINK}*$6; }' {$I[1][1]}.3dwholeinfo`;
-               Y=`awk '{print -{$SHRINK}*$7; }' {$I[1][1]}.3dwholeinfo`;
-               echo $X,$Y; mrcImageShift -i {$I[1][1]}.roi -o {$I[1][1]}.shift -x $X -y $Y -z 0        
+               awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[1][1]}.corinfo-{$I[2][2]} | sort -r | sed -e s/pad/shift-{$I[2][2]}/ > {$I[1][1]}.3dwholeinfolst-{$I[2][2]}
+               head -n 1 {$I[1][1]}.3dwholeinfolst-{$I[2][2]} | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$I[1][1]}.3dwholeinfo-{$I[2][2]}
+               X=`awk '{print -{$SHRINK}*$6; }' {$I[1][1]}.3dwholeinfo-{$I[2][2]}`;
+               Y=`awk '{print -{$SHRINK}*$7; }' {$I[1][1]}.3dwholeinfo-{$I[2][2]}`;
+               echo $X,$Y; mrcImageShift -i {$I[1][1]}.roi -o {$I[1][1]}.shift-{$I[2][2]} -x $X -y $Y -z 0     
        fi
 
        # fit_3d4sinfo
        if {$Flag_3D4S} ; then
-               awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[1][1]}.corinfo | sort -r | sed -e s/pad/4shift/ > {$I[1][1]}.3d4sinfolst
-               head -n 1 {$I[1][1]}.3d4sinfolst | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$I[1][1]}.3d4sinfo
-               X=`awk '{print -{$SHRINK4S}*$6; }' {$I[1][1]}.3d4sinfo`;
-               Y=`awk '{print -{$SHRINK4S}*$7; }' {$I[1][1]}.3d4sinfo`;
+               awk '/Cor/ { print $18,$16,$2,$3,$4,$9,$11,$12}' {$I[1][1]}.corinfo-{$I[2][2]} | sort -r | sed -e s/pad/4shift-{$I[2][2]}/ > {$I[1][1]}.3d4sinfolst-{$I[2][2]}
+               head -n 1 {$I[1][1]}.3d4sinfolst-{$I[2][2]} | awk ' {print $2,$3,$4,$5,$6,$7,$8,$1'} > {$I[1][1]}.3d4sinfo-{$I[2][2]}
+               X=`awk '{print -{$SHRINK4S}*$6; }' {$I[1][1]}.3d4sinfo-{$I[2][2]}`;
+               Y=`awk '{print -{$SHRINK4S}*$7; }' {$I[1][1]}.3d4sinfo-{$I[2][2]}`;
                echo $X,$Y; 
-               mrcImageShrink -i {$I[1][1]}.roi -o  {$I[1][1]}.4shrink -S {$SHRINK4S}
+               mrcImageShrink -i {$I[1][1]}.roi -o  {$I[1][1]}.4shrink-{$I[2][2]} -S {$SHRINK4S}
                width=`expr {$X_SIZE} / {$SHRINK4S}`
                height=`expr {$Y_SIZE} / {$SHRINK4S}`
-               mrcImagePad -i {$I[1][1]}.4shrink -o {$I[1][1]}.4spad -W ${width} -H ${height}
-               mrcImageShift -i {$I[1][1]}.4spad -o {$I[1][1]}.4shift -x $X -y $Y -z 0
+               mrcImagePad -i {$I[1][1]}.4shrink-{$I[2][2]} -o {$I[1][1]}.4spad-{$I[2][2]} -W ${width} -H ${height}
+               mrcImageShift -i {$I[1][1]}.4spad-{$I[2][2]} -o {$I[1][1]}.4shift-{$I[2][2]} -x $X -y $Y -z 0
        fi
 End
index 8655355..68d3581 100644 (file)
@@ -1,6 +1,6 @@
 Rule Create_stack
        input '*.mrc'
-       output '{$I[1][1]}.stack'
+       output '{$I[1][1]}-1.stack'
 Action
        data=$(mrcInfo -i {$I[1]} | head -1)
        x_size=$(echo "${data}" | awk '{printf ("%i", $4)}')
index a4e7b44..b072cb6 100644 (file)
@@ -1,9 +1,9 @@
 Rule Main
-       if ($Mode_ROI + $Mode_Ref) != 0
+       if (($Mode_ROI != 0) or $Flag_Ref)
                input '*.mrc'
        end
 
-       if $Mode_Ref == 0
+       if $Flag_Ref.not()
                input '*.stack'
        end
 
@@ -12,18 +12,18 @@ Rule Main
        end
 
        if $Flag_3D
-               output '{$I[1][1]}.3d'
-               output '{$I[1][1]}.ds6'
+               output '{$I[1][1]}-{$Repeat_Count}.3d'.all
+               output '{$I[1][1]}-{$Repeat_Count}.ds6'.all
        end
 
        if $Flag_3DWhole
-               output '{$I[1][1]}.3dwhole'
-               output '{$I[1][1]}.whole.ds6'
+               output '{$I[1][1]}-{$Repeat_Count}.3dwhole'
+               output '{$I[1][1]}-{$Repeat_Count}.whole.ds6'
        end
 
        if $Flag_3D4S
-               output '{$I[1][1]}.3d4s'
-               output '{$I[1][1]}.4s.ds6'
+               output '{$I[1][1]}-{$Repeat_Count}.3d4s'
+               output '{$I[1][1]}-{$Repeat_Count}.4s.ds6'
        end
 
        if $Mode_ROI != 0
@@ -41,9 +41,11 @@ Flow
        when 2
                rule Create_Sample3d
                rule Create_SampleROI_all
+       when 3
+               rule Cutout_ROI
        end
 
-       if $Mode_Ref != 0
+       if $Flag_Ref
                rule Create_stack
        end
 
@@ -54,7 +56,8 @@ Flow
                rule Create_fit_each
                
                if $Flag_3D
-                       rule Create_3d {filename: $I[1][1].str()}
+                       rule Create_3d {filename: $I[1][1].str(), count: 1.upto($Repeat_Count)}
+                       rule Repeat_3d {count: 1.upto($Repeat_Count - 1)}
                end
 
                if $Flag_3DWhole
index e1554c5..04c1e88 100644 (file)
@@ -39,13 +39,17 @@ param $ROI_ROT3_DELTA := 30
 $roi_rot3_loop := ($ROI_ROT3_END - $ROI_ROT3_START) / $ROI_ROT3_DELTA
 param $ROI_SN := 1
 
+## For repeat count
+param $Repeat_Count := 2
+
 # advanced param
+## Mode 0: do not, 1: each, 2: all, 3: use Display2
+advanced param $Mode_ROI := 1
 ## Mode 0: do not, 1: each, 2: all
-advanced param $Mode_ROI := 0
-advanced param $Mode_Ref := 0
 advanced param $Mode_3D := 1
 ## Flag true: do, false: do not
+advanced param $Flag_Ref := true
 advanced param $Flag_3D := true
 advanced param $Flag_3DWhole := false
 advanced param $Flag_3D4S := false
-advanced param $Flag_Projection := false
+advanced param $Flag_Projection := true
diff --git a/SampleCode/PIONE/Advanced4/Repeat_3d.pione b/SampleCode/PIONE/Advanced4/Repeat_3d.pione
new file mode 100644 (file)
index 0000000..3b85f3a
--- /dev/null
@@ -0,0 +1,10 @@
+Rule Repeat_3d
+       input '*-{$count}.3d'
+       output '{$I[1][1]}-{$count + 1}.stack'
+       param $count
+Action
+       mrc3Dto2D       -i {$I[1]} -o {$O[1]} -m 1 -InterpolationMode 2 -EulerMode {$REF_ROT_MODE} \
+                               -Rot1 {$REF_ROT1_START} {$REF_ROT1_END} {$REF_ROT1_DELTA} \
+                               -Rot2 {$REF_ROT2_START} {$REF_ROT2_END} {$REF_ROT2_DELTA} \
+                               -Rot3 {$REF_ROT3_START} {$REF_ROT3_END} {$REF_ROT3_DELTA}
+End