RNApolis 0.4.1__tar.gz → 0.4.2__tar.gz
Sign up to get free protection for your applications and to get access to all the features.
- {rnapolis-0.4.1/src/RNApolis.egg-info → rnapolis-0.4.2}/PKG-INFO +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.2}/setup.py +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.2/src/RNApolis.egg-info}/PKG-INFO +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/tertiary.py +25 -43
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_bugfixes.py +23 -1
- {rnapolis-0.4.1 → rnapolis-0.4.2}/LICENSE +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/README.md +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/pyproject.toml +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/setup.cfg +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/RNApolis.egg-info/SOURCES.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/RNApolis.egg-info/dependency_links.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/RNApolis.egg-info/entry_points.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/RNApolis.egg-info/requires.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/RNApolis.egg-info/top_level.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/annotator.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/clashfinder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/common.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/metareader.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/molecule_filter.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/motif_extractor.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/parser.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/rfam_folder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/transformer.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/src/rnapolis/util.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_annotator.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_common.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_metareader.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_parser.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_quadruplexes.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_rfam_folder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.2}/tests/test_tertiary.py +0 -0
@@ -497,42 +497,24 @@ class Mapping2D3D:
|
|
497
497
|
|
498
498
|
@cached_property
|
499
499
|
def strands_sequences(self) -> List[Tuple[str, str]]:
|
500
|
-
|
501
|
-
residue for residue in self.structure3d.residues if residue.is_nucleotide
|
502
|
-
]
|
500
|
+
result = defaultdict(list)
|
503
501
|
|
504
|
-
|
505
|
-
|
502
|
+
for i, residue in enumerate(
|
503
|
+
filter(lambda r: r.is_nucleotide, self.structure3d.residues)
|
504
|
+
):
|
505
|
+
if i > 0 and self.find_gaps:
|
506
|
+
previous = self.structure3d.residues[i - 1]
|
506
507
|
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
if previous.chain == current.chain and (
|
515
|
-
self.find_gaps == False or previous.is_connected(current)
|
516
|
-
):
|
517
|
-
strand.append(current)
|
518
|
-
else:
|
519
|
-
result.append(
|
520
|
-
(
|
521
|
-
previous.chain,
|
522
|
-
"".join([residue.one_letter_name for residue in strand]),
|
523
|
-
)
|
524
|
-
)
|
525
|
-
strand = [current]
|
508
|
+
if (
|
509
|
+
not previous.is_connected(residue)
|
510
|
+
and previous.chain == residue.chain
|
511
|
+
):
|
512
|
+
for k in range(residue.number - previous.number - 1):
|
513
|
+
result[residue.chain].append("?")
|
526
514
|
|
527
|
-
|
528
|
-
result.append(
|
529
|
-
(
|
530
|
-
strand[0].chain,
|
531
|
-
"".join([residue.one_letter_name for residue in strand]),
|
532
|
-
)
|
533
|
-
)
|
515
|
+
result[residue.chain].append(residue.one_letter_name)
|
534
516
|
|
535
|
-
return result
|
517
|
+
return [(chain, "".join(sequence)) for chain, sequence in result.items()]
|
536
518
|
|
537
519
|
@cached_property
|
538
520
|
def bpseq(self) -> BpSeq:
|
@@ -549,23 +531,23 @@ class Mapping2D3D:
|
|
549
531
|
residue_map: Dict[Residue3D, int] = {}
|
550
532
|
i = 1
|
551
533
|
|
552
|
-
for j, residue in enumerate(
|
534
|
+
for j, residue in enumerate(
|
535
|
+
filter(lambda r: r.is_nucleotide, self.structure3d.residues)
|
536
|
+
):
|
553
537
|
if self.find_gaps and j > 0:
|
554
538
|
previous = self.structure3d.residues[j - 1]
|
539
|
+
|
555
540
|
if (
|
556
|
-
previous.
|
557
|
-
and residue.
|
558
|
-
and previous.label
|
559
|
-
and residue.label
|
560
|
-
and previous.label.chain == residue.label.chain
|
541
|
+
not previous.is_connected(residue)
|
542
|
+
and previous.chain == residue.chain
|
561
543
|
):
|
562
|
-
for k in range(residue.
|
544
|
+
for k in range(residue.number - previous.number - 1):
|
563
545
|
result[i] = [i, "?", 0]
|
564
546
|
i += 1
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
547
|
+
|
548
|
+
result[i] = [i, residue.one_letter_name, 0]
|
549
|
+
residue_map[residue] = i
|
550
|
+
i += 1
|
569
551
|
|
570
552
|
for base_pair in base_pairs:
|
571
553
|
j = residue_map.get(base_pair.nt1_3d, None)
|
@@ -12,7 +12,7 @@ def test_1E7K():
|
|
12
12
|
mapping = Mapping2D3D(
|
13
13
|
structure3d, base_interaction.basePairs, base_interaction.stackings, True
|
14
14
|
)
|
15
|
-
assert len(mapping.strands_sequences) ==
|
15
|
+
assert len(mapping.strands_sequences) == 1
|
16
16
|
|
17
17
|
|
18
18
|
# in 1DFU the adjacent U and G seem to be base-pair like if you do not take into account angles
|
@@ -75,3 +75,25 @@ def test_6g90():
|
|
75
75
|
sequence
|
76
76
|
== "AUACUUACCUUAAGAUAUCAGAGGAGAUCAAGAAGUCCUACUGAUCAAACAUGCGCUUCCAAGAAGGACGUUAAGCAUUUAUCAUUGAACGUUCAUUGAACAUUGAUGCAAACUCCUUGGUCACACACACGCGGAAGGCGUGUUUGCUGACGUCCCUUGUUUCAAUCAUUGGUUAACUGAUUUUUGGGGCCCUUUGUUCUUCUGAGAAGUGACACCAAUUGGUGUUAGGGGAGCUGGGGCCUUUCAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNUUUUGGAAGGUCUUGGUCGGGUGGAUCUUAUAAUUUUUGAUUUA"
|
77
77
|
)
|
78
|
+
|
79
|
+
base_interactions = extract_base_interactions(structure3d)
|
80
|
+
|
81
|
+
# without gaps
|
82
|
+
mapping = Mapping2D3D(
|
83
|
+
structure3d, base_interactions.basePairs, base_interactions.stackings, False
|
84
|
+
)
|
85
|
+
assert (
|
86
|
+
mapping.bpseq.sequence
|
87
|
+
== mapping.dot_bracket.split("\n")[1]
|
88
|
+
== "AUACUUACCUUAAGAUAUCAGAGGAGAUCAAGAAGUCCUACUGAUCAAACAUGCGCUUCCAAGAAGGACGUUAAGCAUUUAUCAUUGAACGUUCAUUGAACAUUGAUGCAAACUCCUUGGUCACACACACGCGGAAGGCGUGUUUGCUGACGUCCCUUGUUUCAAUCAUUGGUUAACUGAUUUUUGGGGCCCUUUGUUCUUCUGAGAAGUGACACCAAUUGGUGUUAGGGGAGCUGGGGCCUUUCAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNUUUUGGAAGGUCUUGGUCGGGUGGAUCUUAUAAUUUUUGAUUUA"
|
89
|
+
)
|
90
|
+
|
91
|
+
# with gaps
|
92
|
+
mapping = Mapping2D3D(
|
93
|
+
structure3d, base_interactions.basePairs, base_interactions.stackings, True
|
94
|
+
)
|
95
|
+
assert (
|
96
|
+
mapping.bpseq.sequence
|
97
|
+
== mapping.dot_bracket.split("\n")[1]
|
98
|
+
== "AUACUUACCUUAAGAUAUCAGAGGAGAUCAAGAAGUCCUACUGAUCAAACAUGCGCUUCCA?????AGAAGGACGUUAAGCAUUUAUCAUUGAAC???????GUUCAUUGAA??CAUUGAUGCAAACUCCUUGGUCACACACAC???????GCGGAAGGCGUGUUUGCUGACG???????UCCCUUGUUUCAAUCAUUGGUU?????????????????????????????????AACUGAUUUUUGGGGCCCUUUGUU?CUUCUG?????AGAAGU??GACACCAA???????UUGGUGUUAGGGGAGCUGGGGCCUUUCAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNUUUUGGAAGGUCUUGGUCGGGUGGAUCUUAUAAUUUUUGAUUUA"
|
99
|
+
)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|