biotite 1.0.1__cp312-cp312-macosx_11_0_arm64.whl → 1.2.0__cp312-cp312-macosx_11_0_arm64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of biotite might be problematic. Click here for more details.
- biotite/application/application.py +3 -3
- biotite/application/autodock/app.py +1 -1
- biotite/application/blast/webapp.py +1 -1
- biotite/application/clustalo/app.py +1 -1
- biotite/application/dssp/app.py +13 -3
- biotite/application/localapp.py +36 -2
- biotite/application/msaapp.py +10 -10
- biotite/application/muscle/app3.py +5 -18
- biotite/application/muscle/app5.py +5 -5
- biotite/application/sra/app.py +0 -5
- biotite/application/util.py +22 -2
- biotite/application/viennarna/rnaalifold.py +8 -8
- biotite/application/viennarna/rnaplot.py +9 -3
- biotite/application/viennarna/util.py +1 -1
- biotite/application/webapp.py +1 -1
- biotite/database/afdb/__init__.py +12 -0
- biotite/database/afdb/download.py +191 -0
- biotite/database/entrez/dbnames.py +10 -0
- biotite/database/entrez/download.py +9 -10
- biotite/database/entrez/key.py +1 -1
- biotite/database/entrez/query.py +5 -4
- biotite/database/pubchem/download.py +6 -6
- biotite/database/pubchem/error.py +10 -0
- biotite/database/pubchem/query.py +12 -23
- biotite/database/rcsb/download.py +3 -2
- biotite/database/rcsb/query.py +8 -9
- biotite/database/uniprot/check.py +22 -17
- biotite/database/uniprot/download.py +3 -6
- biotite/database/uniprot/query.py +4 -5
- biotite/file.py +14 -2
- biotite/interface/__init__.py +19 -0
- biotite/interface/openmm/__init__.py +16 -0
- biotite/interface/openmm/state.py +93 -0
- biotite/interface/openmm/system.py +227 -0
- biotite/interface/pymol/__init__.py +198 -0
- biotite/interface/pymol/cgo.py +346 -0
- biotite/interface/pymol/convert.py +185 -0
- biotite/interface/pymol/display.py +267 -0
- biotite/interface/pymol/object.py +1226 -0
- biotite/interface/pymol/shapes.py +178 -0
- biotite/interface/pymol/startup.py +169 -0
- biotite/interface/rdkit/__init__.py +15 -0
- biotite/interface/rdkit/mol.py +490 -0
- biotite/interface/version.py +71 -0
- biotite/interface/warning.py +19 -0
- biotite/sequence/align/__init__.py +0 -4
- biotite/sequence/align/alignment.py +49 -14
- biotite/sequence/align/banded.cpython-312-darwin.so +0 -0
- biotite/sequence/align/banded.pyx +26 -26
- biotite/sequence/align/cigar.py +2 -2
- biotite/sequence/align/kmeralphabet.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmeralphabet.pyx +19 -2
- biotite/sequence/align/kmersimilarity.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmertable.cpython-312-darwin.so +0 -0
- biotite/sequence/align/kmertable.pyx +58 -48
- biotite/sequence/align/localgapped.cpython-312-darwin.so +0 -0
- biotite/sequence/align/localgapped.pyx +47 -47
- biotite/sequence/align/localungapped.cpython-312-darwin.so +0 -0
- biotite/sequence/align/localungapped.pyx +10 -10
- biotite/sequence/align/matrix.py +284 -57
- biotite/sequence/align/matrix_data/3Di.mat +24 -0
- biotite/sequence/align/matrix_data/PB.license +21 -0
- biotite/sequence/align/matrix_data/PB.mat +18 -0
- biotite/sequence/align/multiple.cpython-312-darwin.so +0 -0
- biotite/sequence/align/pairwise.cpython-312-darwin.so +0 -0
- biotite/sequence/align/pairwise.pyx +35 -35
- biotite/sequence/align/permutation.cpython-312-darwin.so +0 -0
- biotite/sequence/align/selector.cpython-312-darwin.so +0 -0
- biotite/sequence/align/selector.pyx +2 -2
- biotite/sequence/align/statistics.py +1 -1
- biotite/sequence/align/tracetable.cpython-312-darwin.so +0 -0
- biotite/sequence/alphabet.py +5 -2
- biotite/sequence/annotation.py +19 -13
- biotite/sequence/codec.cpython-312-darwin.so +0 -0
- biotite/sequence/codon.py +1 -2
- biotite/sequence/graphics/alignment.py +25 -39
- biotite/sequence/graphics/color_schemes/3di_flower.json +48 -0
- biotite/sequence/graphics/color_schemes/pb_flower.json +2 -1
- biotite/sequence/graphics/colorschemes.py +44 -11
- biotite/sequence/graphics/dendrogram.py +4 -2
- biotite/sequence/graphics/features.py +2 -2
- biotite/sequence/graphics/logo.py +10 -12
- biotite/sequence/io/fasta/convert.py +1 -2
- biotite/sequence/io/fasta/file.py +1 -1
- biotite/sequence/io/fastq/file.py +3 -3
- biotite/sequence/io/genbank/file.py +3 -3
- biotite/sequence/io/genbank/sequence.py +2 -0
- biotite/sequence/io/gff/convert.py +1 -1
- biotite/sequence/io/gff/file.py +1 -2
- biotite/sequence/phylo/nj.cpython-312-darwin.so +0 -0
- biotite/sequence/phylo/tree.cpython-312-darwin.so +0 -0
- biotite/sequence/phylo/upgma.cpython-312-darwin.so +0 -0
- biotite/sequence/profile.py +105 -29
- biotite/sequence/search.py +0 -1
- biotite/sequence/seqtypes.py +136 -8
- biotite/sequence/sequence.py +1 -2
- biotite/setup_ccd.py +197 -0
- biotite/structure/__init__.py +6 -3
- biotite/structure/alphabet/__init__.py +25 -0
- biotite/structure/alphabet/encoder.py +332 -0
- biotite/structure/alphabet/encoder_weights_3di.kerasify +0 -0
- biotite/structure/alphabet/i3d.py +109 -0
- biotite/structure/alphabet/layers.py +86 -0
- biotite/structure/alphabet/pb.license +21 -0
- biotite/structure/alphabet/pb.py +170 -0
- biotite/structure/alphabet/unkerasify.py +128 -0
- biotite/structure/atoms.py +163 -66
- biotite/structure/basepairs.py +26 -26
- biotite/structure/bonds.cpython-312-darwin.so +0 -0
- biotite/structure/bonds.pyx +79 -25
- biotite/structure/box.py +19 -21
- biotite/structure/celllist.cpython-312-darwin.so +0 -0
- biotite/structure/celllist.pyx +83 -67
- biotite/structure/chains.py +5 -37
- biotite/structure/charges.cpython-312-darwin.so +0 -0
- biotite/structure/compare.py +420 -13
- biotite/structure/density.py +1 -1
- biotite/structure/dotbracket.py +27 -28
- biotite/structure/filter.py +8 -8
- biotite/structure/geometry.py +74 -127
- biotite/structure/hbond.py +17 -19
- biotite/structure/info/__init__.py +1 -0
- biotite/structure/info/atoms.py +24 -15
- biotite/structure/info/bonds.py +12 -6
- biotite/structure/info/ccd.py +125 -34
- biotite/structure/info/{ccd/components.bcif → components.bcif} +0 -0
- biotite/structure/info/groups.py +62 -19
- biotite/structure/info/masses.py +9 -6
- biotite/structure/info/misc.py +15 -22
- biotite/structure/info/radii.py +92 -22
- biotite/structure/info/standardize.py +4 -4
- biotite/structure/integrity.py +4 -6
- biotite/structure/io/general.py +2 -2
- biotite/structure/io/gro/file.py +8 -9
- biotite/structure/io/mol/convert.py +1 -1
- biotite/structure/io/mol/ctab.py +33 -28
- biotite/structure/io/mol/mol.py +1 -1
- biotite/structure/io/mol/sdf.py +80 -53
- biotite/structure/io/pdb/convert.py +4 -3
- biotite/structure/io/pdb/file.py +85 -25
- biotite/structure/io/pdb/hybrid36.cpython-312-darwin.so +0 -0
- biotite/structure/io/pdbqt/file.py +36 -36
- biotite/structure/io/pdbx/__init__.py +1 -0
- biotite/structure/io/pdbx/bcif.py +54 -15
- biotite/structure/io/pdbx/cif.py +92 -66
- biotite/structure/io/pdbx/component.py +15 -4
- biotite/structure/io/pdbx/compress.py +321 -0
- biotite/structure/io/pdbx/convert.py +410 -75
- biotite/structure/io/pdbx/encoding.cpython-312-darwin.so +0 -0
- biotite/structure/io/pdbx/encoding.pyx +98 -17
- biotite/structure/io/trajfile.py +9 -6
- biotite/structure/io/util.py +38 -0
- biotite/structure/mechanics.py +0 -1
- biotite/structure/molecules.py +141 -156
- biotite/structure/pseudoknots.py +7 -13
- biotite/structure/repair.py +2 -4
- biotite/structure/residues.py +13 -24
- biotite/structure/rings.py +335 -0
- biotite/structure/sasa.cpython-312-darwin.so +0 -0
- biotite/structure/sasa.pyx +2 -1
- biotite/structure/segments.py +69 -11
- biotite/structure/sequence.py +0 -1
- biotite/structure/sse.py +0 -2
- biotite/structure/superimpose.py +74 -62
- biotite/structure/tm.py +581 -0
- biotite/structure/transform.py +12 -25
- biotite/structure/util.py +76 -4
- biotite/version.py +9 -4
- biotite/visualize.py +111 -1
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/METADATA +6 -2
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/RECORD +173 -143
- biotite/structure/info/ccd/README.rst +0 -8
- biotite/structure/info/ccd/amino_acids.txt +0 -1663
- biotite/structure/info/ccd/carbohydrates.txt +0 -1135
- biotite/structure/info/ccd/nucleotides.txt +0 -798
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/WHEEL +0 -0
- {biotite-1.0.1.dist-info → biotite-1.2.0.dist-info}/licenses/LICENSE.rst +0 -0
biotite/structure/superimpose.py
CHANGED
|
@@ -17,10 +17,13 @@ __all__ = [
|
|
|
17
17
|
|
|
18
18
|
|
|
19
19
|
import numpy as np
|
|
20
|
-
from biotite.sequence.align import
|
|
20
|
+
from biotite.sequence.align.alignment import get_codes, remove_gaps
|
|
21
|
+
from biotite.sequence.align.matrix import SubstitutionMatrix
|
|
22
|
+
from biotite.sequence.align.pairwise import align_optimal
|
|
21
23
|
from biotite.sequence.alphabet import common_alphabet
|
|
22
24
|
from biotite.sequence.seqtypes import ProteinSequence
|
|
23
25
|
from biotite.structure.atoms import coord
|
|
26
|
+
from biotite.structure.chains import chain_iter
|
|
24
27
|
from biotite.structure.filter import filter_amino_acids, filter_nucleotides
|
|
25
28
|
from biotite.structure.geometry import centroid, distance
|
|
26
29
|
from biotite.structure.sequence import to_sequence
|
|
@@ -97,7 +100,6 @@ class AffineTransformation:
|
|
|
97
100
|
[ -7. 6. 8.]
|
|
98
101
|
[-10. 9. 11.]
|
|
99
102
|
[-13. 12. 14.]]
|
|
100
|
-
|
|
101
103
|
"""
|
|
102
104
|
mobile_coord = coord(atoms)
|
|
103
105
|
original_shape = mobile_coord.shape
|
|
@@ -176,7 +178,6 @@ class AffineTransformation:
|
|
|
176
178
|
[ -7. 6. 8. 1.]
|
|
177
179
|
[-10. 9. 11. 1.]
|
|
178
180
|
[-13. 12. 14. 1.]]
|
|
179
|
-
|
|
180
181
|
"""
|
|
181
182
|
n_models = self.rotation.shape[0]
|
|
182
183
|
rotation_mat = _3d_identity(n_models, 4)
|
|
@@ -222,7 +223,7 @@ def superimpose(fixed, mobile, atom_mask=None):
|
|
|
222
223
|
fixed : AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
223
224
|
The fixed structure(s).
|
|
224
225
|
Alternatively coordinates can be given.
|
|
225
|
-
mobile: AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
226
|
+
mobile : AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
226
227
|
The structure(s) which is/are superimposed on the `fixed`
|
|
227
228
|
structure.
|
|
228
229
|
Each atom at index *i* in `mobile` must correspond the
|
|
@@ -231,7 +232,7 @@ def superimpose(fixed, mobile, atom_mask=None):
|
|
|
231
232
|
:class:`AtomArrayStack` objects, they must have the same
|
|
232
233
|
number of models.
|
|
233
234
|
Alternatively coordinates can be given.
|
|
234
|
-
atom_mask: ndarray, dtype=bool, optional
|
|
235
|
+
atom_mask : ndarray, dtype=bool, optional
|
|
235
236
|
If given, only the atoms covered by this boolean mask will be
|
|
236
237
|
considered for superimposition.
|
|
237
238
|
This means that the algorithm will minimize the RMSD based
|
|
@@ -253,8 +254,8 @@ def superimpose(fixed, mobile, atom_mask=None):
|
|
|
253
254
|
|
|
254
255
|
See Also
|
|
255
256
|
--------
|
|
256
|
-
superimpose_without_outliers : Superimposition with outlier removal
|
|
257
|
-
superimpose_homologs : Superimposition of homologous structures
|
|
257
|
+
superimpose_without_outliers : Superimposition with outlier removal.
|
|
258
|
+
superimpose_homologs : Superimposition of homologous structures.
|
|
258
259
|
|
|
259
260
|
Notes
|
|
260
261
|
-----
|
|
@@ -340,13 +341,12 @@ def superimpose_without_outliers(
|
|
|
340
341
|
the remaining atoms (called *anchors*) again until no outlier
|
|
341
342
|
remains.
|
|
342
343
|
|
|
343
|
-
|
|
344
344
|
Parameters
|
|
345
345
|
----------
|
|
346
346
|
fixed : AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
347
347
|
The fixed structure(s).
|
|
348
348
|
Alternatively coordinates can be given.
|
|
349
|
-
mobile: AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
349
|
+
mobile : AtomArray, shape(n,) or AtomArrayStack, shape(m,n) or ndarray, shape(n,), dtype=float or ndarray, shape(m,n), dtype=float
|
|
350
350
|
The structure(s) which is/are superimposed on the `fixed`
|
|
351
351
|
structure.
|
|
352
352
|
Each atom at index *i* in `mobile` must correspond the
|
|
@@ -389,8 +389,8 @@ def superimpose_without_outliers(
|
|
|
389
389
|
|
|
390
390
|
See Also
|
|
391
391
|
--------
|
|
392
|
-
superimpose : Superimposition without outlier removal
|
|
393
|
-
superimpose_homologs : Superimposition of homologous structures
|
|
392
|
+
superimpose : Superimposition without outlier removal.
|
|
393
|
+
superimpose_homologs : Superimposition of homologous structures.
|
|
394
394
|
|
|
395
395
|
Notes
|
|
396
396
|
-----
|
|
@@ -464,10 +464,16 @@ def superimpose_without_outliers(
|
|
|
464
464
|
|
|
465
465
|
|
|
466
466
|
def superimpose_homologs(
|
|
467
|
-
fixed,
|
|
467
|
+
fixed,
|
|
468
|
+
mobile,
|
|
469
|
+
substitution_matrix=None,
|
|
470
|
+
gap_penalty=-10,
|
|
471
|
+
min_anchors=3,
|
|
472
|
+
terminal_penalty=False,
|
|
473
|
+
**kwargs,
|
|
468
474
|
):
|
|
469
475
|
r"""
|
|
470
|
-
Superimpose
|
|
476
|
+
Superimpose a protein or nucleotide structure onto another one,
|
|
471
477
|
considering sequence differences and conformational outliers.
|
|
472
478
|
|
|
473
479
|
The method finds corresponding residues by sequence alignment and
|
|
@@ -480,11 +486,11 @@ def superimpose_homologs(
|
|
|
480
486
|
----------
|
|
481
487
|
fixed : AtomArray, shape(n,) or AtomArrayStack, shape(m,n)
|
|
482
488
|
The fixed structure(s).
|
|
483
|
-
Must comprise a single chain.
|
|
484
489
|
mobile : AtomArray, shape(n,) or AtomArrayStack, shape(m,n)
|
|
485
|
-
The structure(s) which is/are superimposed on the `fixed`
|
|
486
|
-
|
|
487
|
-
|
|
490
|
+
The structure(s) which is/are superimposed on the `fixed` structure.
|
|
491
|
+
Must contain the same number of chains as `fixed` with corresponding chains
|
|
492
|
+
being in the same order.
|
|
493
|
+
The specific chain IDs can be different.
|
|
488
494
|
substitution_matrix : str or SubstitutionMatrix, optional
|
|
489
495
|
The (name of the) substitution matrix used for sequence
|
|
490
496
|
alignment.
|
|
@@ -504,6 +510,9 @@ def superimpose_homologs(
|
|
|
504
510
|
`mobile` in this fallback case, an exception is raised.
|
|
505
511
|
Furthermore, the outlier removal is stopped, if less than
|
|
506
512
|
`min_anchors` anchors would be left.
|
|
513
|
+
terminal_penalty : bool, optional
|
|
514
|
+
If set to true, gap penalties are applied to terminal gaps in the sequence
|
|
515
|
+
alignment.
|
|
507
516
|
**kwargs
|
|
508
517
|
Additional parameters for
|
|
509
518
|
:func:`superimpose_without_outliers()`.
|
|
@@ -525,8 +534,9 @@ def superimpose_homologs(
|
|
|
525
534
|
|
|
526
535
|
See Also
|
|
527
536
|
--------
|
|
528
|
-
superimpose : Superimposition without outlier removal
|
|
529
|
-
superimpose_without_outliers : Internally used for outlier removal
|
|
537
|
+
superimpose : Superimposition without outlier removal.
|
|
538
|
+
superimpose_without_outliers : Internally used for outlier removal.
|
|
539
|
+
superimpose_structural_homologs : Better suited for low sequence similarity.
|
|
530
540
|
|
|
531
541
|
Notes
|
|
532
542
|
-----
|
|
@@ -540,7 +550,7 @@ def superimpose_homologs(
|
|
|
540
550
|
or len(mobile_anchor_indices) < min_anchors
|
|
541
551
|
):
|
|
542
552
|
raise ValueError(
|
|
543
|
-
"Structures have too few
|
|
553
|
+
"Structures have too few backbone atoms for required number of anchors"
|
|
544
554
|
)
|
|
545
555
|
|
|
546
556
|
anchor_indices = _find_matching_anchors(
|
|
@@ -548,18 +558,19 @@ def superimpose_homologs(
|
|
|
548
558
|
mobile[..., mobile_anchor_indices],
|
|
549
559
|
substitution_matrix,
|
|
550
560
|
gap_penalty,
|
|
561
|
+
terminal_penalty,
|
|
551
562
|
)
|
|
552
563
|
if len(anchor_indices) < min_anchors:
|
|
553
564
|
# Fallback: Match all backbone anchors
|
|
554
565
|
if len(fixed_anchor_indices) != len(mobile_anchor_indices):
|
|
555
566
|
raise ValueError(
|
|
556
567
|
"Tried fallback due to low anchor number, "
|
|
557
|
-
"but number of
|
|
568
|
+
"but number of backbone atoms does not match"
|
|
558
569
|
)
|
|
559
570
|
fixed_anchor_indices = fixed_anchor_indices
|
|
560
571
|
mobile_anchor_indices = mobile_anchor_indices
|
|
561
572
|
else:
|
|
562
|
-
# The anchor indices point to the
|
|
573
|
+
# The anchor indices point to the backbone atoms
|
|
563
574
|
# -> get the corresponding indices for the whole structure
|
|
564
575
|
fixed_anchor_indices = fixed_anchor_indices[anchor_indices[:, 0]]
|
|
565
576
|
mobile_anchor_indices = mobile_anchor_indices[anchor_indices[:, 1]]
|
|
@@ -639,51 +650,52 @@ def _find_matching_anchors(
|
|
|
639
650
|
mobile_anchors_atoms,
|
|
640
651
|
substitution_matrix,
|
|
641
652
|
gap_penalty,
|
|
653
|
+
terminal_penalty,
|
|
642
654
|
):
|
|
643
655
|
"""
|
|
644
656
|
Find corresponding residues using pairwise sequence alignment.
|
|
645
657
|
"""
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
658
|
+
anchor_list = []
|
|
659
|
+
fixed_seq_offset = 0
|
|
660
|
+
mobile_seq_offset = 0
|
|
661
|
+
for fixed_chain, mobile_chain in zip(
|
|
662
|
+
chain_iter(fixed_anchor_atoms), chain_iter(mobile_anchors_atoms), strict=True
|
|
663
|
+
):
|
|
664
|
+
# The input is a single chain -> expect a single sequence
|
|
665
|
+
fixed_seq = to_sequence(fixed_chain, allow_hetero=True)[0][0]
|
|
666
|
+
mobile_seq = to_sequence(mobile_chain, allow_hetero=True)[0][0]
|
|
667
|
+
|
|
668
|
+
common_alph = common_alphabet([fixed_seq.alphabet, mobile_seq.alphabet])
|
|
669
|
+
if common_alph is None:
|
|
670
|
+
raise ValueError("Cannot superimpose peptides with nucleic acids")
|
|
671
|
+
if substitution_matrix is None:
|
|
672
|
+
if isinstance(fixed_seq, ProteinSequence):
|
|
673
|
+
substitution_matrix = SubstitutionMatrix.std_protein_matrix()
|
|
674
|
+
else:
|
|
675
|
+
substitution_matrix = SubstitutionMatrix.std_nucleotide_matrix()
|
|
676
|
+
elif isinstance(substitution_matrix, str):
|
|
677
|
+
substitution_matrix = SubstitutionMatrix(
|
|
678
|
+
common_alph, common_alph, substitution_matrix
|
|
679
|
+
)
|
|
662
680
|
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
alignment_codes = get_codes(alignment)
|
|
672
|
-
anchor_mask = (
|
|
673
|
-
# Anchors must be similar amino acids
|
|
674
|
-
(score_matrix[alignment_codes[0], alignment_codes[1]] > 0)
|
|
681
|
+
alignment = align_optimal(
|
|
682
|
+
fixed_seq,
|
|
683
|
+
mobile_seq,
|
|
684
|
+
substitution_matrix,
|
|
685
|
+
gap_penalty,
|
|
686
|
+
terminal_penalty=terminal_penalty,
|
|
687
|
+
max_number=1,
|
|
688
|
+
)[0]
|
|
675
689
|
# Cannot anchor gaps
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
690
|
+
alignment = remove_gaps(alignment)
|
|
691
|
+
ali_codes = get_codes(alignment)
|
|
692
|
+
score_matrix = substitution_matrix.score_matrix()
|
|
693
|
+
# Anchors must be similar amino acids
|
|
694
|
+
anchors = alignment.trace[score_matrix[ali_codes[0], ali_codes[1]] > 0]
|
|
681
695
|
|
|
696
|
+
anchors += fixed_seq_offset, mobile_seq_offset
|
|
697
|
+
fixed_seq_offset += len(fixed_seq)
|
|
698
|
+
mobile_seq_offset += len(mobile_seq)
|
|
699
|
+
anchor_list.append(anchors)
|
|
682
700
|
|
|
683
|
-
|
|
684
|
-
sequences, _ = to_sequence(atoms, allow_hetero=True)
|
|
685
|
-
if len(sequences) == 0:
|
|
686
|
-
raise ValueError("Structure does not contain any amino acids or nucleotides")
|
|
687
|
-
if len(sequences) > 1:
|
|
688
|
-
raise ValueError("Structure contains multiple chains, but only one is allowed")
|
|
689
|
-
return sequences[0]
|
|
701
|
+
return np.concatenate(anchor_list, axis=0)
|