RNApolis 0.4.1__tar.gz → 0.4.3__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.3}/PKG-INFO +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.3}/setup.py +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.3/src/RNApolis.egg-info}/PKG-INFO +1 -1
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/tertiary.py +24 -39
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_bugfixes.py +23 -1
- {rnapolis-0.4.1 → rnapolis-0.4.3}/LICENSE +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/README.md +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/pyproject.toml +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/setup.cfg +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/RNApolis.egg-info/SOURCES.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/RNApolis.egg-info/dependency_links.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/RNApolis.egg-info/entry_points.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/RNApolis.egg-info/requires.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/RNApolis.egg-info/top_level.txt +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/annotator.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/clashfinder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/common.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/metareader.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/molecule_filter.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/motif_extractor.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/parser.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/rfam_folder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/transformer.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/src/rnapolis/util.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_annotator.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_common.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_metareader.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_parser.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_quadruplexes.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_rfam_folder.py +0 -0
- {rnapolis-0.4.1 → rnapolis-0.4.3}/tests/test_tertiary.py +0 -0
@@ -497,42 +497,27 @@ class Mapping2D3D:
|
|
497
497
|
|
498
498
|
@cached_property
|
499
499
|
def strands_sequences(self) -> List[Tuple[str, str]]:
|
500
|
-
nucleotides =
|
501
|
-
residue for residue in self.structure3d.residues if residue.is_nucleotide
|
502
|
-
]
|
500
|
+
nucleotides = list(filter(lambda r: r.is_nucleotide, self.structure3d.residues))
|
503
501
|
|
504
|
-
if
|
502
|
+
if not nucleotides:
|
505
503
|
return []
|
506
504
|
|
507
|
-
result = []
|
508
|
-
strand = [nucleotides[0]]
|
505
|
+
result = [(nucleotides[0].chain, [nucleotides[0].one_letter_name])]
|
509
506
|
|
510
507
|
for i in range(1, len(nucleotides)):
|
511
|
-
previous =
|
512
|
-
|
508
|
+
previous = nucleotides[i - 1]
|
509
|
+
residue = nucleotides[i]
|
513
510
|
|
514
|
-
if
|
515
|
-
|
516
|
-
):
|
517
|
-
strand.append(current)
|
511
|
+
if residue.chain != previous.chain:
|
512
|
+
result.append((residue.chain, [residue.one_letter_name]))
|
518
513
|
else:
|
519
|
-
|
520
|
-
(
|
521
|
-
previous.
|
522
|
-
|
523
|
-
|
524
|
-
)
|
525
|
-
strand = [current]
|
526
|
-
|
527
|
-
if len(strand) > 0:
|
528
|
-
result.append(
|
529
|
-
(
|
530
|
-
strand[0].chain,
|
531
|
-
"".join([residue.one_letter_name for residue in strand]),
|
532
|
-
)
|
533
|
-
)
|
514
|
+
if self.find_gaps:
|
515
|
+
if not previous.is_connected(residue):
|
516
|
+
for k in range(residue.number - previous.number - 1):
|
517
|
+
result[-1][1].append("?")
|
518
|
+
result[-1][1].append(residue.one_letter_name)
|
534
519
|
|
535
|
-
return result
|
520
|
+
return [(chain, "".join(sequence)) for chain, sequence in result]
|
536
521
|
|
537
522
|
@cached_property
|
538
523
|
def bpseq(self) -> BpSeq:
|
@@ -549,23 +534,23 @@ class Mapping2D3D:
|
|
549
534
|
residue_map: Dict[Residue3D, int] = {}
|
550
535
|
i = 1
|
551
536
|
|
552
|
-
for j, residue in enumerate(
|
537
|
+
for j, residue in enumerate(
|
538
|
+
filter(lambda r: r.is_nucleotide, self.structure3d.residues)
|
539
|
+
):
|
553
540
|
if self.find_gaps and j > 0:
|
554
541
|
previous = self.structure3d.residues[j - 1]
|
542
|
+
|
555
543
|
if (
|
556
|
-
previous.
|
557
|
-
and residue.
|
558
|
-
and previous.label
|
559
|
-
and residue.label
|
560
|
-
and previous.label.chain == residue.label.chain
|
544
|
+
not previous.is_connected(residue)
|
545
|
+
and previous.chain == residue.chain
|
561
546
|
):
|
562
|
-
for k in range(residue.
|
547
|
+
for k in range(residue.number - previous.number - 1):
|
563
548
|
result[i] = [i, "?", 0]
|
564
549
|
i += 1
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
550
|
+
|
551
|
+
result[i] = [i, residue.one_letter_name, 0]
|
552
|
+
residue_map[residue] = i
|
553
|
+
i += 1
|
569
554
|
|
570
555
|
for base_pair in base_pairs:
|
571
556
|
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
|