From 3ab50a665b707c31ff41e72ab55e6c86555d68ed Mon Sep 17 00:00:00 2001 From: Marcin Magnus Date: Mon, 8 Nov 2021 20:42:59 +0100 Subject: [PATCH] rna_calc_rmsd.py: --way fix backbone etc. --- .../rna_calc_rmsd/lib/rmsd/calculate_rmsd.py | 11 +++++----- .../tools/rna_calc_rmsd/rna_calc_rmsd.py | 6 +++++- rna_tools/tools/rna_calc_rmsd/test.sh | 21 ++++++++++++------- 3 files changed, 25 insertions(+), 13 deletions(-) diff --git a/rna_tools/tools/rna_calc_rmsd/lib/rmsd/calculate_rmsd.py b/rna_tools/tools/rna_calc_rmsd/lib/rmsd/calculate_rmsd.py index 196ad2cbe..c1c141f5e 100755 --- a/rna_tools/tools/rna_calc_rmsd/lib/rmsd/calculate_rmsd.py +++ b/rna_tools/tools/rna_calc_rmsd/lib/rmsd/calculate_rmsd.py @@ -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() @@ -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() diff --git a/rna_tools/tools/rna_calc_rmsd/rna_calc_rmsd.py b/rna_tools/tools/rna_calc_rmsd/rna_calc_rmsd.py index 0ed6f9102..2c174f991 100755 --- a/rna_tools/tools/rna_calc_rmsd/rna_calc_rmsd.py +++ b/rna_tools/tools/rna_calc_rmsd/rna_calc_rmsd.py @@ -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="") diff --git a/rna_tools/tools/rna_calc_rmsd/test.sh b/rna_tools/tools/rna_calc_rmsd/test.sh index 924f3b761..ff79aeb12 100755 --- a/rna_tools/tools/rna_calc_rmsd/test.sh +++ b/rna_tools/tools/rna_calc_rmsd/test.sh @@ -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 @@ -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