The modelcif.alignment Python module¶
Classes to handle alignments between template structure(s) and target sequence(s).
To create an alignment, first declare a class for the given kind of
alignment by deriving from subclasses of AlignmentMode
(e.g. Global) and AlignmentType (e.g. Pairwise).
For example, a typical pairwise global alignment could be declared using:
class Alignment(modelcif.alignment.Global, modelcif.alignment.Pairwise):
pass
- class modelcif.alignment.Identity(value)[source]¶
Percent sequence identity between the template sequence and the target sequence being modeled. Use the correct subclass that corresponds to the denominator used when calculating the identity, for example
ShorterSequenceIdentity, or if the denominator is not covered here, subclass this class and provide a docstring to describe the denominator, e.g.:class CustomIdentity(Identity): "my custom sequence identity denominator"- Parameters:
value (float) – The percent sequence identity value.
- property other_details¶
More information about a custom sequence identity denominator. By default it is the first line of the docstring.
- class modelcif.alignment.ShorterSequenceIdentity(value)[source]¶
Sequence identity calculated using the length of the shorter sequence as the denominator. See
Identityfor more information.
- class modelcif.alignment.AlignedPositionsIdentity(value)[source]¶
Sequence identity calculated using the number of aligned positions (including gaps) as the denominator. See
Identityfor more information.
- class modelcif.alignment.AlignedResiduePairsIdentity(value)[source]¶
Sequence identity calculated using the number of aligned residue pairs (not including gaps) as the denominator. See
Identityfor more information.
- class modelcif.alignment.MeanSequenceIdentity(value)[source]¶
Sequence identity calculated using the arithmetic mean of the sequence lengths as the denominator. See
Identityfor more information.
- class modelcif.alignment.Pair(template, target, identity=None, score=None)[source]¶
A single pairwise alignment between a single target and template chain. See
AlignmentMode. An alignment consists of one or more of these pairs.- Parameters:
template (
modelcif.TemplateSegment) – The template segment that is aligned, i.e. the seq_id range for the template and the sequence (including gaps) of one-letter codes.target (output from
ihm.AsymUnit.segment()) – The target segment that is aligned.identity (
Identity) – The sequence identity between target and template, if known.score (
Score) – A measure of the quality of the alignment, if known.
- class modelcif.alignment.AlignmentMode(name, pairs, software=None)[source]¶
Base class for all alignments. Actual alignments should derive from both a subclass of this class (e.g.
Global) and a subclass ofAlignmentType.- Parameters:
name (str) – A short description of this alignment.
pairs (list of
Pairobjects) – List of individual target-template alignments.software (
modelcif.Softwareormodelcif.SoftwareGroup) – The software that was used to build the alignment.
- class modelcif.alignment.Global(name, pairs, software=None)[source]¶
Base class for global alignments. See
AlignmentModefor more details.
- class modelcif.alignment.Local(name, pairs, software=None)[source]¶
Base class for local alignments. See
AlignmentModefor more details.
- class modelcif.alignment.AlignmentType[source]¶
Base class for all alignment types. Actual alignments should derive from both a subclass of this class (e.g.
Pairwise) and a subclass ofAlignmentMode.
- class modelcif.alignment.Pairwise[source]¶
An alignment between a single target and template. See
AlignmentTypefor more details.
- class modelcif.alignment.Multiple[source]¶
A multiple sequence alignment between target and template. See
AlignmentTypefor more details.
- class modelcif.alignment.Score(value)[source]¶
Base class for a quality score for a given target-template alignment. Usually a derived class such as
BLASTEValueis used, and passed toPairobjects.- Parameters:
value (float) – The actual score value.