schrodinger.protein.align module¶
-
class
schrodinger.protein.align.
AbstractAligner
(gap_open_penalty=1, gap_extend_penalty=0.0, sub_matrix=None, direct_scores=False, constraints=None, merge_all=False, ss_constraints=False)¶ Bases:
object
Base class of objects that can perform an alignment
-
run
(aln)¶ Aligns the sequences in an alignment using the parameters supplied on init
Subclasses need to override this default implementation.
Parameters: aln ( schrodinger.protein.alignment.BaseAlignment
) – The alignment to align
-
sub_matrix
¶ Get or set the sub_matrix.
When setting, it will be converted to a numpy array.
-
-
exception
schrodinger.protein.align.
AlignmentException
¶ Bases:
exceptions.Exception
-
class
schrodinger.protein.align.
BasicAligner
(gap_open_penalty=1, gap_extend_penalty=0.0, sub_matrix=None, direct_scores=False, constraints=None, merge_all=False, ss_constraints=False)¶ Bases:
schrodinger.protein.align.AbstractAligner
Aligns sequences by simply adding gaps to the ends of sequences to make them the same length
-
run
(aln)¶
-
-
class
schrodinger.protein.align.
ClustalAligner
(gap_open_penalty=1, gap_extend_penalty=0.0, sub_matrix=None, direct_scores=False, constraints=None, merge_all=False, ss_constraints=False)¶ Bases:
schrodinger.protein.align.AbstractAligner
Aligns sequences using the Clustal alignment algorithm.
-
class
schrodinger.protein.align.
ConstrainedPairwiseAlignment
(**kwargs)¶ Bases:
schrodinger.protein.align.AbstractAligner
Implements constrained dynamic programming algorithm for pairwise sequence alignment.
- ability to merge new sequence with existing alignment,
- ability to penalize gaps in secondary structure elements,
- ability to use custom substitution matrix generated from a family of proteins or provided by the user.
-
getMappedGaps
(from_gaps, to_gaps)¶ Utility function which calculates the offsets of gaps applied to previously-aligned sequences.
Parameters: - from_gaps (List of ints) – Gap indices to apply to the new sequence.
- to_gaps (List of ints) – Gap indices of the targeted sequence
-
getMatrixValue
(code1, code2)¶ Returns the appropriate similarity score as defined by a similarity matrix.
Parameters: - code1 (char) – short code of first sequence residue
- code2 (char) – short code of second sequence residue
Returns: value for a residue-residue pair based on a scoring matrix
Return type: float
-
run
(seq1, seq2, aln_to_merge=None)¶ Runs the whole alignment.
Parameters: - seq1 (
Sequence
) – first sequence to be aligned - seq2 (
Sequence
) – second sequence to be aligned - aln_to_merge (
Alignment
or NoneType) – alignment that the sequences belong to, otherwise None, indicating that a merge is not requested
- seq1 (
-
class
schrodinger.protein.align.
RescodeAligner
(gap_open_penalty=1, gap_extend_penalty=0.0, sub_matrix=None, direct_scores=False, constraints=None, merge_all=False, ss_constraints=False)¶ Bases:
schrodinger.protein.align.AbstractAligner
Aligns sequences by rescode
-
run
(aln)¶
-
-
class
schrodinger.protein.align.
SuperpositionAligner
(gap_open_penalty=None, gap_extend_penalty=None)¶ Bases:
schrodinger.protein.align.ConstrainedPairwiseAlignment
Align structured sequences based on their superposition.
-
run
(ref_seq, seqs, aln_to_merge)¶ Align sequences based on structure superposition to the reference.
Parameters: - ref_seq (schrodinger.protein.sequence.Sequence) – The reference sequence (must have a structure)
- seqs (iterable(schrodinger.protein.sequence.Sequence)) – The sequences to align (must have structures)
- aln_to_merge (schrodinger.protein.alignment.Alignment) – alignment that the sequences belong to
-