Skip to content

Commit 6da782d

Browse files
ldjagersroet
andauthored
Pytomptcllist conversion (#7)
* Bash script to convert pytomTM star files into pytomGUI readable xml file * Update README.md * Update warp_aretomo_pytom_scripts/convert_pytomTMstar_to_pytomGUIxml.sh Co-authored-by: Sander Roet <sanderroet@hotmail.com> --------- Co-authored-by: Sander Roet <sanderroet@hotmail.com>
1 parent 6b4c27a commit 6da782d

2 files changed

Lines changed: 22 additions & 0 deletions

File tree

warp_aretomo_pytom_scripts/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ Scripts depend on:
88
* pytom-template-matching-gpu (https://github.com/SBC-Utrecht/pytom-template-matching-gpu)
99

1010
Some notes:
11+
* Each script has in its header which modules need to be loaded on Angstrom.
1112
* Automated processing is very dependent on the alignment with AreTomo, for this it is essential to remove
1213
bad tilts first in Warp so that they do not end up in the stacks. With the `-DarkTol 0.01` option AreTomo is
1314
prevented from automatically attempting to remove dark tilts which makes uploading alignments back to Warp much
@@ -24,3 +25,5 @@ Some notes:
2425
some graphs in the output directory that you can inspect to get an idea of how liberal the picking is. If the
2526
picking needs to be more liberal increase `--number-of-false-positives` (works for both base and tophat extraction).
2627
See the pytom docs for specifics.
28+
* pytom_extract_candidates.py generates star file which cannot be opened in the pytomGUI. In case you want to e.g. do
29+
particle deselection a script is available to convert it to a pytomGUI readable .xml file.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
# run these command first to load required modules on angstrom
3+
# module load miniconda/pytom/latest
4+
# condaactivate
5+
6+
#Loop converts star file generated by pytom_tm into a .xml file readible by the pytomGUI
7+
8+
for i in *.mrc;
9+
do
10+
cp "$i/tm_results/${i%.mrc}_particles.star" "$i/tm_results/${i%.mrc}_particles_ptm.star"
11+
sed -i "s/_ptm/_rln/" "$i/tm_results/${i%.mrc}_particles_ptm.star"
12+
sed -i "s/_rlnLCCmax/_rlnOriginXAngst/" "$i/tm_results/${i%.mrc}_particles_ptm.star"
13+
sed -i "s/_rlnCutOff/_rlnOriginYAngst/" "$i/tm_results/${i%.mrc}_particles_ptm.star"
14+
sed -i "s/_rlnSearchStd/_rlnOriginZAngst/" "$i/tm_results/${i%.mrc}_particles_ptm.star"
15+
sed -i "s/_rlnDetectorPixelSize/_rlnPixelSize/" "$i/tm_results/${i%.mrc}_particles_ptm.star"
16+
convert.py -f "$i/tm_results/${i%.mrc}_particles_ptm.star" -o "xml"
17+
mv "${i%.mrc}_particles_ptm.xml" "$i/tm_results/."
18+
19+
done

0 commit comments

Comments
 (0)