From 1d8a5ee7af48b18e423b9ba146828a95410fcb9f Mon Sep 17 00:00:00 2001 From: mmagnus Date: Fri, 21 Jan 2022 17:07:42 +0100 Subject: [PATCH 1/3] triplexibility: add check for seq (from file) or from seq --- .../0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb | 67 ++++++++ .../0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb | 67 ++++++++ .../triplexibility/data/still-wrong/312.pdb | 68 ++++++++ .../triplexibility/data/still-wrong/t2-4.pdb | 67 ++++++++ rna_tools/tools/triplexibility/test.sh | 19 +++ .../tools/triplexibility/triplexibility.py | 156 ++++++++++-------- 6 files changed, 378 insertions(+), 66 deletions(-) create mode 100644 rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb create mode 100644 rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb create mode 100644 rna_tools/tools/triplexibility/data/still-wrong/312.pdb create mode 100644 rna_tools/tools/triplexibility/data/still-wrong/t2-4.pdb create mode 100755 rna_tools/tools/triplexibility/test.sh diff --git a/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb b/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb new file mode 100644 index 000000000..c361d6753 --- /dev/null +++ b/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb @@ -0,0 +1,67 @@ +ATOM 1 P C A 29 311.625 275.801 304.495 1.00 99.99 P +ATOM 2 C5' C A 29 310.367 276.034 306.773 1.00 99.99 C +ATOM 3 O5' C A 29 310.391 275.529 305.448 1.00 99.99 O +ATOM 4 C4' C A 29 309.047 275.714 307.457 1.00 99.99 C +ATOM 5 O4' C A 29 308.000 276.564 306.884 1.00 99.99 O +ATOM 6 C3' C A 29 308.471 274.299 307.326 1.00 99.99 C +ATOM 7 O3' C A 29 308.992 273.381 308.275 1.00 99.99 O +ATOM 8 C2' C A 29 306.989 274.536 307.603 1.00 99.99 C +ATOM 9 O2' C A 29 306.640 274.632 308.963 1.00 99.99 O +ATOM 10 C1' C A 29 306.761 275.871 306.887 1.00 99.99 C +ATOM 11 N1 C A 29 306.383 275.575 305.457 1.00 99.99 N +ATOM 12 C2 C A 29 305.041 275.161 305.238 1.00 99.99 C +ATOM 13 O2 C A 29 304.271 275.147 306.180 1.00 99.99 O +ATOM 14 N3 C A 29 304.725 274.804 303.944 1.00 99.99 N +ATOM 15 C4 C A 29 305.644 274.859 303.003 1.00 99.99 C +ATOM 16 N4 C A 29 305.262 274.493 301.753 1.00 99.99 N +ATOM 17 C5 C A 29 307.007 275.277 303.214 1.00 99.99 C +ATOM 18 C6 C A 29 307.328 275.632 304.488 1.00 99.99 C +ATOM 19 OP1 C A 29 312.853 275.467 305.211 1.00 99.99 O +ATOM 20 OP2 C A 29 311.415 275.160 303.164 1.00 99.99 O1- +ATOM 21 P A A 53 303.170 275.636 296.490 1.00 99.99 P +ATOM 22 C5' A A 53 300.968 274.243 296.103 1.00 99.99 C +ATOM 23 O5' A A 53 301.788 275.035 296.991 1.00 99.99 O +ATOM 24 C4' A A 53 299.967 273.442 296.896 1.00 99.99 C +ATOM 25 O4' A A 53 300.662 272.506 297.768 1.00 99.99 O +ATOM 26 C3' A A 53 299.123 274.245 297.863 1.00 99.99 C +ATOM 27 O3' A A 53 298.064 274.905 297.185 1.00 99.99 O +ATOM 28 C2' A A 53 298.630 273.173 298.812 1.00 99.99 C +ATOM 29 O2' A A 53 297.621 272.370 298.225 1.00 99.99 O +ATOM 30 C1' A A 53 299.895 272.308 298.951 1.00 99.99 C +ATOM 31 N1 A A 53 299.969 272.801 304.052 1.00 99.99 N +ATOM 32 C2 A A 53 299.042 272.308 303.201 1.00 99.99 C +ATOM 33 N3 A A 53 299.090 272.207 301.868 1.00 99.99 N +ATOM 34 C4 A A 53 300.253 272.681 301.399 1.00 99.99 C +ATOM 35 C5 A A 53 301.308 273.221 302.142 1.00 99.99 C +ATOM 36 C6 A A 53 301.117 273.265 303.541 1.00 99.99 C +ATOM 37 N6 A A 53 302.058 273.762 304.374 1.00 99.99 N +ATOM 38 N7 A A 53 302.359 273.615 301.340 1.00 99.99 N +ATOM 39 C8 A A 53 301.939 273.315 300.120 1.00 99.99 C +ATOM 40 N9 A A 53 300.686 272.755 300.093 1.00 99.99 N +ATOM 41 OP1 A A 53 302.940 276.309 295.186 1.00 99.99 O +ATOM 42 OP2 A A 53 303.901 276.365 297.524 1.00 99.99 O1- +TER +ATOM 43 P A B 27 307.263 269.083 300.006 1.00 99.99 P +ATOM 44 C5' A B 27 306.177 269.326 297.631 1.00 99.99 C +ATOM 45 O5' A B 27 307.268 269.623 298.513 1.00 99.99 O +ATOM 46 C4' A B 27 306.231 270.232 296.432 1.00 99.99 C +ATOM 47 O4' A B 27 305.999 271.595 296.882 1.00 99.99 O +ATOM 48 C3' A B 27 307.573 270.247 295.706 1.00 99.99 C +ATOM 49 O3' A B 27 307.369 270.476 294.318 1.00 99.99 O +ATOM 50 C2' A B 27 308.271 271.443 296.349 1.00 99.99 C +ATOM 51 O2' A B 27 309.297 272.009 295.557 1.00 99.99 O +ATOM 52 C1' A B 27 307.099 272.408 296.538 1.00 99.99 C +ATOM 53 N1 A B 27 309.112 276.971 297.786 1.00 99.99 N +ATOM 54 C2 A B 27 308.986 276.330 296.604 1.00 99.99 C +ATOM 55 N3 A B 27 308.421 275.146 296.343 1.00 99.99 N +ATOM 56 C4 A B 27 307.941 274.592 297.465 1.00 99.99 C +ATOM 57 C5 A B 27 307.991 275.123 298.760 1.00 99.99 C +ATOM 58 C6 A B 27 308.618 276.382 298.884 1.00 99.99 C +ATOM 59 N6 A B 27 308.733 277.007 300.078 1.00 99.99 N +ATOM 60 N7 A B 27 307.401 274.289 299.686 1.00 99.99 N +ATOM 61 C8 A B 27 306.998 273.260 298.955 1.00 99.99 C +ATOM 62 N9 A B 27 307.293 273.387 297.620 1.00 99.99 N +ATOM 63 OP1 A B 27 306.996 267.623 299.970 1.00 99.99 O +ATOM 64 OP2 A B 27 308.489 269.586 300.672 1.00 99.99 O1- +TER +END diff --git a/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb b/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb new file mode 100644 index 000000000..75b3d6ecf --- /dev/null +++ b/rna_tools/tools/triplexibility/data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb @@ -0,0 +1,67 @@ +ATOM 21 P A A 1 303.170 275.636 296.490 1.00 99.99 P +ATOM 22 C5' A A 1 300.968 274.243 296.103 1.00 99.99 C +ATOM 23 O5' A A 1 301.788 275.035 296.991 1.00 99.99 O +ATOM 24 C4' A A 1 299.967 273.442 296.896 1.00 99.99 C +ATOM 25 O4' A A 1 300.662 272.506 297.768 1.00 99.99 O +ATOM 26 C3' A A 1 299.123 274.245 297.863 1.00 99.99 C +ATOM 27 O3' A A 1 298.064 274.905 297.185 1.00 99.99 O +ATOM 28 C2' A A 1 298.630 273.173 298.812 1.00 99.99 C +ATOM 29 O2' A A 1 297.621 272.370 298.225 1.00 99.99 O +ATOM 30 C1' A A 1 299.895 272.308 298.951 1.00 99.99 C +ATOM 31 N1 A A 1 299.969 272.801 304.052 1.00 99.99 N +ATOM 32 C2 A A 1 299.042 272.308 303.201 1.00 99.99 C +ATOM 33 N3 A A 1 299.090 272.207 301.868 1.00 99.99 N +ATOM 34 C4 A A 1 300.253 272.681 301.399 1.00 99.99 C +ATOM 35 C5 A A 1 301.308 273.221 302.142 1.00 99.99 C +ATOM 36 C6 A A 1 301.117 273.265 303.541 1.00 99.99 C +ATOM 37 N6 A A 1 302.058 273.762 304.374 1.00 99.99 N +ATOM 38 N7 A A 1 302.359 273.615 301.340 1.00 99.99 N +ATOM 39 C8 A A 1 301.939 273.315 300.120 1.00 99.99 C +ATOM 40 N9 A A 1 300.686 272.755 300.093 1.00 99.99 N +ATOM 41 OP1 A A 1 302.940 276.309 295.186 1.00 99.99 O +ATOM 42 OP2 A A 1 303.901 276.365 297.524 1.00 99.99 O1- + +ATOM 1 P C A 2 311.625 275.801 304.495 1.00 99.99 P +ATOM 2 C5' C A 2 310.367 276.034 306.773 1.00 99.99 C +ATOM 3 O5' C A 2 310.391 275.529 305.448 1.00 99.99 O +ATOM 4 C4' C A 2 309.047 275.714 307.457 1.00 99.99 C +ATOM 5 O4' C A 2 308.000 276.564 306.884 1.00 99.99 O +ATOM 6 C3' C A 2 308.471 274.299 307.326 1.00 99.99 C +ATOM 7 O3' C A 2 308.992 273.381 308.275 1.00 99.99 O +ATOM 8 C2' C A 2 306.989 274.536 307.603 1.00 99.99 C +ATOM 9 O2' C A 2 306.640 274.632 308.963 1.00 99.99 O +ATOM 10 C1' C A 2 306.761 275.871 306.887 1.00 99.99 C +ATOM 11 N1 C A 2 306.383 275.575 305.457 1.00 99.99 N +ATOM 12 C2 C A 2 305.041 275.161 305.238 1.00 99.99 C +ATOM 13 O2 C A 2 304.271 275.147 306.180 1.00 99.99 O +ATOM 14 N3 C A 2 304.725 274.804 303.944 1.00 99.99 N +ATOM 15 C4 C A 2 305.644 274.859 303.003 1.00 99.99 C +ATOM 16 N4 C A 2 305.262 274.493 301.753 1.00 99.99 N +ATOM 17 C5 C A 2 307.007 275.277 303.214 1.00 99.99 C +ATOM 18 C6 C A 2 307.328 275.632 304.488 1.00 99.99 C +ATOM 19 OP1 C A 2 312.853 275.467 305.211 1.00 99.99 O +ATOM 20 OP2 C A 2 311.415 275.160 303.164 1.00 99.99 O1- + +ATOM 43 P A A 3 307.263 269.083 300.006 1.00 99.99 P +ATOM 44 C5' A A 3 306.177 269.326 297.631 1.00 99.99 C +ATOM 45 O5' A A 3 307.268 269.623 298.513 1.00 99.99 O +ATOM 46 C4' A A 3 306.231 270.232 296.432 1.00 99.99 C +ATOM 47 O4' A A 3 305.999 271.595 296.882 1.00 99.99 O +ATOM 48 C3' A A 3 307.573 270.247 295.706 1.00 99.99 C +ATOM 49 O3' A A 3 307.369 270.476 294.318 1.00 99.99 O +ATOM 50 C2' A A 3 308.271 271.443 296.349 1.00 99.99 C +ATOM 51 O2' A A 3 309.297 272.009 295.557 1.00 99.99 O +ATOM 52 C1' A A 3 307.099 272.408 296.538 1.00 99.99 C +ATOM 53 N1 A A 3 309.112 276.971 297.786 1.00 99.99 N +ATOM 54 C2 A A 3 308.986 276.330 296.604 1.00 99.99 C +ATOM 55 N3 A A 3 308.421 275.146 296.343 1.00 99.99 N +ATOM 56 C4 A A 3 307.941 274.592 297.465 1.00 99.99 C +ATOM 57 C5 A A 3 307.991 275.123 298.760 1.00 99.99 C +ATOM 58 C6 A A 3 308.618 276.382 298.884 1.00 99.99 C +ATOM 59 N6 A A 3 308.733 277.007 300.078 1.00 99.99 N +ATOM 60 N7 A A 3 307.401 274.289 299.686 1.00 99.99 N +ATOM 61 C8 A A 3 306.998 273.260 298.955 1.00 99.99 C +ATOM 62 N9 A A 3 307.293 273.387 297.620 1.00 99.99 N +ATOM 63 OP1 A A 3 306.996 267.623 299.970 1.00 99.99 O +ATOM 64 OP2 A A 3 308.489 269.586 300.672 1.00 99.99 O1- + diff --git a/rna_tools/tools/triplexibility/data/still-wrong/312.pdb b/rna_tools/tools/triplexibility/data/still-wrong/312.pdb new file mode 100644 index 000000000..f8c327198 --- /dev/null +++ b/rna_tools/tools/triplexibility/data/still-wrong/312.pdb @@ -0,0 +1,68 @@ +ATOM 43 P A A 3 307.263 269.083 300.006 1.00 99.99 P +ATOM 44 C5' A A 3 306.177 269.326 297.631 1.00 99.99 C +ATOM 45 O5' A A 3 307.268 269.623 298.513 1.00 99.99 O +ATOM 46 C4' A A 3 306.231 270.232 296.432 1.00 99.99 C +ATOM 47 O4' A A 3 305.999 271.595 296.882 1.00 99.99 O +ATOM 48 C3' A A 3 307.573 270.247 295.706 1.00 99.99 C +ATOM 49 O3' A A 3 307.369 270.476 294.318 1.00 99.99 O +ATOM 50 C2' A A 3 308.271 271.443 296.349 1.00 99.99 C +ATOM 51 O2' A A 3 309.297 272.009 295.557 1.00 99.99 O +ATOM 52 C1' A A 3 307.099 272.408 296.538 1.00 99.99 C +ATOM 53 N1 A A 3 309.112 276.971 297.786 1.00 99.99 N +ATOM 54 C2 A A 3 308.986 276.330 296.604 1.00 99.99 C +ATOM 55 N3 A A 3 308.421 275.146 296.343 1.00 99.99 N +ATOM 56 C4 A A 3 307.941 274.592 297.465 1.00 99.99 C +ATOM 57 C5 A A 3 307.991 275.123 298.760 1.00 99.99 C +ATOM 58 C6 A A 3 308.618 276.382 298.884 1.00 99.99 C +ATOM 59 N6 A A 3 308.733 277.007 300.078 1.00 99.99 N +ATOM 60 N7 A A 3 307.401 274.289 299.686 1.00 99.99 N +ATOM 61 C8 A A 3 306.998 273.260 298.955 1.00 99.99 C +ATOM 62 N9 A A 3 307.293 273.387 297.620 1.00 99.99 N +ATOM 63 OP1 A A 3 306.996 267.623 299.970 1.00 99.99 O +ATOM 64 OP2 A A 3 308.489 269.586 300.672 1.00 99.99 O1- + +ATOM 21 P A A 1 303.170 275.636 296.490 1.00 99.99 P +ATOM 22 C5' A A 1 300.968 274.243 296.103 1.00 99.99 C +ATOM 23 O5' A A 1 301.788 275.035 296.991 1.00 99.99 O +ATOM 24 C4' A A 1 299.967 273.442 296.896 1.00 99.99 C +ATOM 25 O4' A A 1 300.662 272.506 297.768 1.00 99.99 O +ATOM 26 C3' A A 1 299.123 274.245 297.863 1.00 99.99 C +ATOM 27 O3' A A 1 298.064 274.905 297.185 1.00 99.99 O +ATOM 28 C2' A A 1 298.630 273.173 298.812 1.00 99.99 C +ATOM 29 O2' A A 1 297.621 272.370 298.225 1.00 99.99 O +ATOM 30 C1' A A 1 299.895 272.308 298.951 1.00 99.99 C +ATOM 31 N1 A A 1 299.969 272.801 304.052 1.00 99.99 N +ATOM 32 C2 A A 1 299.042 272.308 303.201 1.00 99.99 C +ATOM 33 N3 A A 1 299.090 272.207 301.868 1.00 99.99 N +ATOM 34 C4 A A 1 300.253 272.681 301.399 1.00 99.99 C +ATOM 35 C5 A A 1 301.308 273.221 302.142 1.00 99.99 C +ATOM 36 C6 A A 1 301.117 273.265 303.541 1.00 99.99 C +ATOM 37 N6 A A 1 302.058 273.762 304.374 1.00 99.99 N +ATOM 38 N7 A A 1 302.359 273.615 301.340 1.00 99.99 N +ATOM 39 C8 A A 1 301.939 273.315 300.120 1.00 99.99 C +ATOM 40 N9 A A 1 300.686 272.755 300.093 1.00 99.99 N +ATOM 41 OP1 A A 1 302.940 276.309 295.186 1.00 99.99 O +ATOM 42 OP2 A A 1 303.901 276.365 297.524 1.00 99.99 O1- + +ATOM 1 P C A 2 311.625 275.801 304.495 1.00 99.99 P +ATOM 2 C5' C A 2 310.367 276.034 306.773 1.00 99.99 C +ATOM 3 O5' C A 2 310.391 275.529 305.448 1.00 99.99 O +ATOM 4 C4' C A 2 309.047 275.714 307.457 1.00 99.99 C +ATOM 5 O4' C A 2 308.000 276.564 306.884 1.00 99.99 O +ATOM 6 C3' C A 2 308.471 274.299 307.326 1.00 99.99 C +ATOM 7 O3' C A 2 308.992 273.381 308.275 1.00 99.99 O +ATOM 8 C2' C A 2 306.989 274.536 307.603 1.00 99.99 C +ATOM 9 O2' C A 2 306.640 274.632 308.963 1.00 99.99 O +ATOM 10 C1' C A 2 306.761 275.871 306.887 1.00 99.99 C +ATOM 11 N1 C A 2 306.383 275.575 305.457 1.00 99.99 N +ATOM 12 C2 C A 2 305.041 275.161 305.238 1.00 99.99 C +ATOM 13 O2 C A 2 304.271 275.147 306.180 1.00 99.99 O +ATOM 14 N3 C A 2 304.725 274.804 303.944 1.00 99.99 N +ATOM 15 C4 C A 2 305.644 274.859 303.003 1.00 99.99 C +ATOM 16 N4 C A 2 305.262 274.493 301.753 1.00 99.99 N +ATOM 17 C5 C A 2 307.007 275.277 303.214 1.00 99.99 C +ATOM 18 C6 C A 2 307.328 275.632 304.488 1.00 99.99 C +ATOM 19 OP1 C A 2 312.853 275.467 305.211 1.00 99.99 O +ATOM 20 OP2 C A 2 311.415 275.160 303.164 1.00 99.99 O1- + + diff --git a/rna_tools/tools/triplexibility/data/still-wrong/t2-4.pdb b/rna_tools/tools/triplexibility/data/still-wrong/t2-4.pdb new file mode 100644 index 000000000..4da4bd9ad --- /dev/null +++ b/rna_tools/tools/triplexibility/data/still-wrong/t2-4.pdb @@ -0,0 +1,67 @@ +ATOM 1 P A A 53 309.118 281.472 306.787 1.00216.12 P +ATOM 2 C5' A A 53 307.172 279.945 307.674 1.00253.23 C +ATOM 3 O5' A A 53 308.153 280.194 306.681 1.00235.46 O +ATOM 4 C4' A A 53 307.274 278.551 308.309 1.00271.26 C +ATOM 5 O4' A A 53 306.387 277.573 307.803 1.00274.76 O +ATOM 6 C3' A A 53 308.661 277.964 308.186 1.00279.17 C +ATOM 7 O3' A A 53 309.573 278.620 309.042 1.00282.50 O +ATOM 8 C2' A A 53 308.417 276.467 308.423 1.00277.57 C +ATOM 9 O2' A A 53 308.241 275.992 309.751 1.00273.04 O +ATOM 10 C1' A A 53 307.081 276.335 307.731 1.00278.25 C +ATOM 11 N1 A A 53 304.351 275.123 303.744 1.00294.92 N +ATOM 12 C2 A A 53 304.031 275.302 305.016 1.00295.61 C +ATOM 13 N3 A A 53 304.859 275.477 306.051 1.00292.57 N +ATOM 14 C4 A A 53 306.149 275.546 305.572 1.00288.50 C +ATOM 15 C5 A A 53 306.626 275.373 304.310 1.00289.97 C +ATOM 16 C6 A A 53 305.606 275.195 303.400 1.00294.13 C +ATOM 17 N6 A A 53 305.775 275.118 302.135 1.00297.45 N +ATOM 18 N7 A A 53 308.013 275.479 304.256 1.00286.88 N +ATOM 19 C8 A A 53 308.314 275.892 305.462 1.00284.70 C +ATOM 20 N9 A A 53 307.227 275.943 306.315 1.00283.56 N +ATOM 21 OP1 A A 53 309.549 281.701 308.183 1.00216.18 O +ATOM 22 OP2 A A 53 310.069 281.525 305.669 1.00211.30 O1- +TER +ATOM 23 P A B 27 295.653 270.783 300.135 1.00119.29 P +ATOM 24 C5' A B 27 297.608 269.806 298.646 1.00124.09 C +ATOM 25 O5' A B 27 296.498 270.692 298.778 1.00116.84 O +ATOM 26 C4' A B 27 298.604 270.387 297.645 1.00125.53 C +ATOM 27 O4' A B 27 298.623 271.795 297.821 1.00112.51 O +ATOM 28 C3' A B 27 300.051 269.848 297.754 1.00131.59 C +ATOM 29 O3' A B 27 300.320 268.757 296.859 1.00136.80 O +ATOM 30 C2' A B 27 300.821 271.136 297.406 1.00123.34 C +ATOM 31 O2' A B 27 300.873 271.377 296.000 1.00126.16 O +ATOM 32 C1' A B 27 299.944 272.209 298.072 1.00120.15 C +ATOM 33 N1 A B 27 303.441 273.472 301.457 1.00 0.00 N +ATOM 34 C2 A B 27 303.405 273.547 300.145 1.00 0.00 C +ATOM 35 N3 A B 27 302.457 273.101 299.343 1.00 0.00 N +ATOM 36 C4 A B 27 301.384 272.671 300.054 1.00 0.00 C +ATOM 37 C5 A B 27 301.255 272.568 301.406 1.00 0.00 C +ATOM 38 C6 A B 27 302.390 272.991 302.104 1.00 0.00 C +ATOM 39 N6 A B 27 302.510 272.979 303.407 1.00 0.00 N +ATOM 40 N7 A B 27 300.005 272.071 301.769 1.00 0.00 N +ATOM 41 C8 A B 27 299.403 271.983 300.614 1.00 0.00 C +ATOM 42 N9 A B 27 300.207 272.250 299.527 1.00 0.00 N +ATOM 43 OP1 A B 27 294.537 269.823 299.943 1.00124.15 O +ATOM 44 OP2 A B 27 296.588 270.536 301.244 1.00104.17 O1- +ATOM 45 P C B 29 308.228 267.714 297.766 1.00240.85 P +ATOM 46 C5' C B 29 307.188 269.097 295.731 1.00274.02 C +ATOM 47 O5' C B 29 308.158 268.976 296.768 1.00259.17 O +ATOM 48 C4' C B 29 306.900 270.552 295.294 1.00292.45 C +ATOM 49 O4' C B 29 306.126 271.274 296.242 1.00291.83 O +ATOM 50 C3' C B 29 308.134 271.422 295.059 1.00305.45 C +ATOM 51 O3' C B 29 308.895 271.147 293.881 1.00326.43 O +ATOM 52 C2' C B 29 307.480 272.813 295.062 1.00301.06 C +ATOM 53 O2' C B 29 306.706 273.077 293.882 1.00303.89 O +ATOM 54 C1' C B 29 306.543 272.647 296.267 1.00290.90 C +ATOM 55 N1 C B 29 307.115 272.919 297.634 1.00 0.00 N +ATOM 56 C2 C B 29 308.457 273.299 297.903 1.00 0.00 C +ATOM 57 O2 C B 29 309.357 273.217 297.070 1.00 0.00 O +ATOM 58 N3 C B 29 308.847 273.566 299.172 1.00 0.00 N +ATOM 59 C4 C B 29 307.979 273.510 300.144 1.00 0.00 C +ATOM 60 N4 C B 29 308.428 273.836 301.319 1.00 0.00 N +ATOM 61 C5 C B 29 306.676 272.986 299.971 1.00 0.00 C +ATOM 62 C6 C B 29 306.267 272.737 298.701 1.00 0.00 C +ATOM 63 OP1 C B 29 307.478 266.587 297.160 1.00241.04 O +ATOM 64 OP2 C B 29 309.635 267.450 298.137 1.00246.10 O1- +TER +END diff --git a/rna_tools/tools/triplexibility/test.sh b/rna_tools/tools/triplexibility/test.sh new file mode 100755 index 000000000..f3a79c8c1 --- /dev/null +++ b/rna_tools/tools/triplexibility/test.sh @@ -0,0 +1,19 @@ +set -x +#python splix.py # --d2 UA --growth 1 # wt U57:A27.A53 +#python seqs.py AAG-0 # U57:A27.A53 +#python seqs.py AUG-1 # suppresion +#python seqs.py ACG-0.5 # half-suppression +#python seqs.py AGG-0 # +#open splix.csv + +# triplexibility.py +#./triplexibility.py -t data/still-wrong/t2-4.pdb data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb +#./triplexibility.py --triple-mode --tseq UUU --way backbone+sugar -t data/still-wrong/t2-4.pdb data/still-wrong/* --save --debug + +./triplexibility.py --triple-mode --tseq aca --way backbone+sugar -t data/still-wrong/t2-4.pdb data/still-wrong/0.90-Triple_tHW_tHH_ACA_rpr_renm_fx.pdb --save --debug +# still-wrong/* + +#--verbose +#0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb --save --triple-mode +#./triplexibility.py --triple-mode --way c1+Nx -t data/still-wrong/t2-4.pdb data/still-wrong/* +#0.90-Triple_tHW_tHH_ACA_rpr_renm.pdb diff --git a/rna_tools/tools/triplexibility/triplexibility.py b/rna_tools/tools/triplexibility/triplexibility.py index 486fc9b8e..3d2aa248f 100755 --- a/rna_tools/tools/triplexibility/triplexibility.py +++ b/rna_tools/tools/triplexibility/triplexibility.py @@ -20,6 +20,11 @@ warnings.filterwarnings('ignore', '.*is discontinuous*',) warnings.filterwarnings('ignore', '.*Ignoring unrecognized record*',) +import sys +from icecream import ic +ic.configureOutput(outputFunction=lambda *a: print(*a, file=sys.stderr)) +ic.configureOutput(prefix='> ') + from rna_tools.rna_tools_lib import set_chain_for_struc, RNAStructure import argparse import sys @@ -60,7 +65,7 @@ def get_report(self): t += ' '.join(['resi: ', str(r) ,' atom: ', str(a) , '\n' ]) return t - def get_rmsd_to(self, other_rnamodel, way="", triple_mode=False, save=True): + def get_rmsd_to(self, other_rnamodel, way="", triple_mode=False, save=True, tseq=''): """Calc rmsd P-atom based rmsd to other rna model sugar now 10 atoms ;-) """ @@ -126,6 +131,16 @@ def get_rmsd_to(self, other_rnamodel, way="", triple_mode=False, save=True): self.atoms_for_rmsd = self.atoms other_atoms_for_rmsd = other_rnamodel.atoms + # calc rmsd # + if not tseq: + tseq = '' + rt = None + for a in self.atoms_for_rmsd: + r = a.get_parent() + if r != rt: + rt = r + tseq += r.get_resname().strip() + if triple_mode: def chunks(lst, n): """Yield successive n-sized chunks from lst. @@ -140,8 +155,10 @@ def chunks(lst, n): lst = list(chunks(other_atoms_for_rmsd, int(len(other_atoms_for_rmsd)/3))) # for 1 atom, this will be 1 x 3 [3 residues] # so so len is 3 atoms so / by 3 to get how many atoms per residue - sup_min = None + sup_min = None + seq_min = 'not yet obtained, rmsd rejected!' + p_min = None for p in per: patoms = [] for i in p: # p=(1, 2, 3) @@ -166,72 +183,76 @@ def chunks(lst, n): seq += r.get_resname().strip() if rms < rmsd_min: - rmsd_min = rms - sup_min = copy.copy(sup) - suffix = seq - p_min = p - seq_min = seq + ic(tseq.lower(), seq.lower()) + if tseq.lower() == seq.lower(): # only if seq is the same + rmsd_min = rms + sup_min = copy.copy(sup) + suffix = seq + p_min = p + seq_min = seq + if args.debug: 'set new rmsd_min', rmsd_min if args.debug: print(p, '', [i + 1 for i in p], end=' ') - print(seq, 'seq_min: a' + seq_min, rms) - - index = [0 ,0 ,0] - index[0] = p_min.index(0) - index[1] = p_min.index(1) - index[2] = p_min.index(2) - - # ugly re-set 123 to crazy id ! + 100, so this will - # fill up 1 2 3 for the second for - rs = other_rnamodel.struc[0].get_residues() - for i, r in enumerate(rs): - r.id = (' ', index[i] + 253, ' ') # ugly, some random offset - - for i, r in enumerate(other_rnamodel.struc[0].get_residues()): - r.id = (' ', index[i] + 1, ' ') - if args.debug: print(r) - - io = Bio.PDB.PDBIO() - sup_min.apply(other_rnamodel.struc.get_atoms()) - # if args.debug: print(p_min, [i + 1 for i in p_min]) - io.set_structure(other_rnamodel.struc) - - args.save_here = True - if args.save_here: - folder = os.path.basename(self.fpath.replace('.pdb', '_' + args.folder_prefix + '_aligned')) - # print(f) - try: - os.mkdir(folder) - except: - pass - fout = folder + os.sep + "{:1.2f}".format(rmsd_min) + '-' + os.path.basename(other_rnamodel.fpath)#.replace('.pdb', '-' + str(rms) + '.pdb')) - #_s' + suffix + '.pdb')) - else: - fout = other_rnamodel.fpath.replace('.pdb', '_aligned.pdb')#_s' + suffix + '.pdb') - - # if args.debug: print(fout) - io.save(fout) - - # ugly set chain to A - set_chain_for_struc(fout, 'A', save_file_inplace=True) - # and now run this to sort into 1 2 3 - - r = RNAStructure(fout) - remarks = r.get_remarks_text() - r1 = r.get_res_text('A', 1) - r2 = r.get_res_text('A', 2) - r3 = r.get_res_text('A', 3) - with open(fout, 'w') as f: - f.write(remarks) - f.write(r1) - f.write(r2) - f.write(r3) - r.reload() - r.get_rnapuzzle_ready() - if rmsd_min < 1: # !!!!!!!!!!!! ugly - r.write() - return str(rmsd_min)# + ',s' + seq_min + ',' + os.path.basename(fout) + print(seq, 'seq_min: ' + seq_min, rms) + + if p_min: # found target sequence + # what is this? ;-) + index = [0 ,0 ,0] + index[0] = p_min.index(0) + index[1] = p_min.index(1) + index[2] = p_min.index(2) + + # ugly re-set 123 to crazy id ! + 100, so this will + # fill up 1 2 3 for the second for + rs = other_rnamodel.struc[0].get_residues() + for i, r in enumerate(rs): + r.id = (' ', index[i] + 253, ' ') # ugly, some random offset + + for i, r in enumerate(other_rnamodel.struc[0].get_residues()): + r.id = (' ', index[i] + 1, ' ') + if args.debug: print('r', r) + + io = Bio.PDB.PDBIO() + sup_min.apply(other_rnamodel.struc.get_atoms()) + # if args.debug: print(p_min, [i + 1 for i in p_min]) + io.set_structure(other_rnamodel.struc) + args.save_here = True + if args.save_here: + folder = os.path.basename(self.fpath.replace('.pdb', '_' + args.folder_prefix + '_aligned')) + # print(f) + try: + os.mkdir(folder) + except: + pass + fout = folder + os.sep + "{:1.2f}".format(rmsd_min) + '-' + os.path.basename(other_rnamodel.fpath)#.replace('.pdb', '-' + str(rms) + '.pdb')) + #_s' + suffix + '.pdb')) + else: + fout = other_rnamodel.fpath.replace('.pdb', '_aligned.pdb')#_s' + suffix + '.pdb') + + if args.debug: print(fout) + io.save(fout) + + # ugly set chain to A + set_chain_for_struc(fout, 'A', save_file_inplace=True) + # and now run this to sort into 1 2 3 + + r = RNAStructure(fout) + remarks = r.get_remarks_text() + r1 = r.get_res_text('A', 1) + r2 = r.get_res_text('A', 2) + r3 = r.get_res_text('A', 3) + with open(fout, 'w') as f: + f.write(remarks) + f.write(r1) + f.write(r2) + f.write(r3) + r.reload() + r.get_rnapuzzle_ready() + if rmsd_min < 1: # !!!!!!!!!!!! ugly + r.write() + return str(rmsd_min)# + ',s' + seq_min + ',' + os.path.basename(fout) else: sup.set_atoms(self.atoms_for_rmsd, other_atoms_for_rmsd) rms = round(sup.rms, 2) @@ -303,16 +324,19 @@ def get_parser(): parser.add_argument('files', help='files', nargs='+') parser.add_argument("--debug", action="store_true") parser.add_argument("--sort", action="store_true", help='sort results based on rmsd (ascending)') + parser.add_argument("--tseq", help='target sequence, e.g. acu, find only triples of this sequence [use the order for the seq taken from the input PDB file, literally order of residues in a pdb file]') return parser # main if __name__ == '__main__': parser = get_parser() args = parser.parse_args() + if not args.debug: + ic.disable() target = RNAmodel(args.target) - models = args.files # opts.input_dir + models = args.files # opts.input_dir tmp = [] if args.ignore_files: for f in args.files: @@ -329,7 +353,7 @@ def get_parser(): mrna = RNAmodel(m) #print r1.fn, r2.fn, r1.get_rmsd_to(r2)#, 'tmp.pdb') # print(m) - rmsd = target.get_rmsd_to(mrna, args.way, args.triple_mode, args.save) #, 'tmp.pdb') + rmsd = target.get_rmsd_to(mrna, args.way, args.triple_mode, args.save, args.tseq) #, 'tmp.pdb') #except: if 0: print(m) From f8b3f4bb0f0dad89270989df875f21393edf6286 Mon Sep 17 00:00:00 2001 From: mmagnus Date: Fri, 21 Jan 2022 17:45:29 +0000 Subject: [PATCH 2/3] web: fix checkbox for rpr --- rna_tools/tools/webserver-engine/app/templates/rpr.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rna_tools/tools/webserver-engine/app/templates/rpr.html b/rna_tools/tools/webserver-engine/app/templates/rpr.html index 01c05db19..369b0582c 100644 --- a/rna_tools/tools/webserver-engine/app/templates/rpr.html +++ b/rna_tools/tools/webserver-engine/app/templates/rpr.html @@ -85,8 +85,8 @@

Standardize your PDB files

-