Skip to content

Commit

Permalink
rna_calc_rmsd.py: --way fix backbone etc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmagnus committed Nov 8, 2021
1 parent 76825d7 commit 3ab50a6
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 13 deletions.
11 changes: 6 additions & 5 deletions rna_tools/tools/rna_calc_rmsd/lib/rmsd/calculate_rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,10 @@ def get_coordinates_pdb(filename, selection, ignore_selection, ignore_hydrogens,
if way == "c1p":
way_atoms = ["C1'"]
elif way == 'backbone':
way_atoms = "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1'".split()
elif way == 'no_backbone':
way_atoms = "P OP1 OP2 O5' C5' C4' C3' O3'".split()
elif way == 'po':
way_atoms = "P OP1 OP2".split()
elif way == 'no-backbone':
way_atoms = "C5' C4' O4' C3' O3' C2' O2' C1' N9 C8 N7 C5 C6 O6 N1 C2 N2 N3 C4".split()
way_atoms += "N9 C8 N7 C5 C6 N6 N1 C2 N3 C4".split()
way_atoms += "N1 C2 O2 N3 C4 O4 C5 C6".split()
Expand All @@ -139,9 +141,8 @@ def get_coordinates_pdb(filename, selection, ignore_selection, ignore_hydrogens,
way_atoms += "N1 C2 O2 N3 C4 N4 C5 C6".split()
elif way == 'backbone+sugar':
way_atoms = "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1'".split()
way_atoms += "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1'".split()
way_atoms += "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1'".split()
way_atoms += "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1'".split()
elif way == 'sugar':
way_atoms = "C4' O4' C3' C2' O2' C1'".split()
elif way == 'all':
way_atoms = "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1' N9 C8 N7 C5 C6 O6 N1 C2 N2 N3 C4".split()
way_atoms += "P OP1 OP2 O5' C5' C4' O4' C3' O3' C2' O2' C1' N9 C8 N7 C5 C6 N6 N1 C2 N3 C4".split()
Expand Down
6 changes: 5 additions & 1 deletion rna_tools/tools/rna_calc_rmsd/rna_calc_rmsd.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,11 @@ def get_parser():
default=False,
action="store_true")

parser.add_argument('--way', help="e.g., backbone+sugar, c1p, backbone, no_backbone, bases", default='all')
parser.add_argument('--way', help="""c1p = C1'
backbone = P OP1 OP2 O5' C5' C4' C3' O3'
po = P OP1 OP2
no-backbone = all - po
bases, backbone+sugar, sugar""", default='all')

parser.add_argument("--target-column-name", action="store_true",
help="")
Expand Down
21 changes: 14 additions & 7 deletions rna_tools/tools/rna_calc_rmsd/test.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
set -x

./rna_calc_rmsd_biopython.py -t test_data/2nd_triplex_FB_1AUA3_rpr.pdb test_data/triples/*.pdb --ignore-files CGA --way backbone+sugar \
> test_output/2nd_triplex_FB_CBA_ignore_files_CGA.csv
./rna_calc_rmsd_biopython.py -t test_data/2nd_triplex_FB_1AUA3_rpr.pdb test_data/triples/*.pdb --ignore-files CGA --way backbone+sugar > test_output/2nd_triplex_FB_CBA_ignore_files_CGA.csv
aaa

./rna_calc_rmsd_biopython.py -t test_data/2nd_triplex_FB_1AUA3_rpr.pdb test_data/triples/*.pdb --way=backbone+sugar \
> test_output/2nd_triplex_FB_CBA_ignore_files_CGA.csv
Expand All @@ -14,12 +14,19 @@ set -x

# ./rna_calc_rmsd_biopython.py -t test_data/triples/2nd_triplex_FB_1AUA3_rpr.pdb test_data/triples/Triple_cWW_tSH_GCA_exemplar_rpr_ren.pdb --way backbone+sugar --save --column-name 'AAAA' --triple-mode > test_output/2nd_triplex_FB_1AUA3_rpr_Triple_cWW_tSH_GCA_exemplar_rpr_ren_way_backbone+sugar_save_column-name_AAAA_triple-mode.txt

./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way c1p -o test_data/ways/rmsd_c1p.csv
# ./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way c1p -o test_data/ways/rmsd_c1p.csv

# ./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way bases -o test_data/ways/rmsd_bases.csv

# ./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way all -o test_data/ways/rmsd_all.csv

# ./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr -sr -o test_data/ways/rmsd_all.csv

./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way bases -o test_data/ways/rmsd_bases.csv
# ./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way backbone+sugar -o test_data/ways/backbone+sugar.csv

./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way all -o test_data/ways/rmsd_all.csv
./rna_calc_rmsd.py -t test_data/pistol/5k7c_clean_onechain_renumber_as_puzzle_srr.pdb --target-selection A:1-47+52-62 --model-selection A:1-47+52-62 --model-ignore-selection A/57/O2\'+A/58/O2\' test_data/pistol/clusters/*.pdb test_data/pistol/clusters/pistol_thrs0.50A_clust01-000001_AA.pdb

./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr -sr -o test_data/ways/rmsd_all.csv

./rna_calc_rmsd.py --model-selection='A:52+53+59+60+61+80+B:21+22+23' --target-selection='A:52+53+59+60+61+80+B:21+22+23' -t test_data/ways/yC_5LJ3_U2U6_core_mdrFx_onlyTriplex_rpr.pdb test_data/ways/*fixChains.pdb -pr --way backbone+sugar -o test_data/ways/backbone+sugar.csv
# error ;-) fixed with the next line
##./rna_calc_rmsd_multi_targets.py --models test_data/multi-targets/rp21/*.pdb --targets test_data/multi-targets/rp21/solutions/*.pdb
#./rna_calc_rmsd_multi_targets.py --models test_data/multi-targets/rp21/*.pdb --targets test_data/multi-targets/rp21/solutions/*.pdb --target-selection A:1-27+29-41 --model-selection A:1-27+29-41

0 comments on commit 3ab50a6

Please sign in to comment.