Sequence Instance (pyncbitk.objects.seqinst)#
Instantiation of biological sequences.
The BioSeq model of the NCBI C++ Toolkit requires two components: one
or more sequence identifiers, which are used to name a sequence instance.
A sequence instance represents concrete properties of a biological
sequence, such as its molecule type (DNA, RNA, protein) or its strandedness
if applicable.
Note
In the original C++ code, sequence instances follow two parallel class
hierarchies for representation: the molecule type branch, and the
representation branch. Because Cython does not support multiple
inheritance, the classes in this module follow only the representation
branch of the hierarchy. The molecule type, if known, can be accessed
with the molecule property.
See also
The Data mode chapter of the NCBI C++ Toolkit documentation.
Instances#
- class pyncbitk.objects.seqinst.SeqInst(Serial)#
Abstract base class for declaring the contents of a sequence.
- classmethod __new__(*args, **kwargs)#
- __init__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- class pyncbitk.objects.seqinst.VirtualInst(SeqInst)#
An instance corresponding to a sequence with no data.
This class allows to describe the properties of a sequence, such as its length or its molecule type, without actually knowing the sequence data.
- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- class pyncbitk.objects.seqinst.ContinuousInst(SeqInst)#
An instance corresponding to a single continuous sequence.
This class describes the most simple sequence kind, where we actually know the sequence data, which can be reached with the
dataproperty.- classmethod __new__(*args, **kwargs)#
- __init__(data, *, topology='linear', strandedness=None, molecule=None, length=None)#
Create a new continuous instance from the given sequence data.
- Parameters:
data (
SeqData) – The concrete sequence data.topology (
str) – The topology of the sequence; eitherlinear,circular,tandem,other, orNonefor unknown sequence topologies.strandedness (
str) – The strandedness of the sequence; eithersingle,double,mixed,other, orNonefor unknown strandedness.molecule (
str) – The type of molecule described by the data; eitherdna,rna,protein,nucleotide,otherorNonefor unknown molecule types.length (
int) – The length of the sequence, if known.
- __reduce__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- class pyncbitk.objects.seqinst.SegmentedInst(SeqInst)#
An instance corresponding to a segmented sequence.
- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- class pyncbitk.objects.seqinst.ConstructedInst(SeqInst)#
An instance corresponding to a constructed sequence.
- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- class pyncbitk.objects.seqinst.RefInst(SeqInst)#
An instance corresponding to a reference to another sequence.
This class allows to describe the sequence data in terms of a location in another sequence, described with a
SeqLoc. This can be used to alias certain regions of a sequence, such as creating references to the genes of contig without having to copy the sequence data.- classmethod __new__(*args, **kwargs)#
- __init__(seqloc, *, topology='linear', strandedness=None, molecule=None, length=None)#
Create a new instance referencing the given location.
- Parameters:
seqloc (
SeqLoc) – The location of the actual sequence data.topology (
str) – The topology of the sequence; eitherlinear,circular,tandem,other, orNonefor unknown sequence topologies.strandedness (
str) – The strandedness of the sequence; eithersingle,double,mixed,other, orNonefor unknown strandedness.molecule (
str) – The type of molecule described by the data; eitherdna,rna,protein,nucleotide,otherorNonefor unknown molecule types.length (
int) – The length of the sequence, if known.
- __reduce__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- class pyncbitk.objects.seqinst.ConsensusInst(SeqInst)#
An instance corresponding to a consensus sequence.
- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- class pyncbitk.objects.seqinst.MapInst(SeqInst)#
An instance corresponding to an ordered mapping.
- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.
- class pyncbitk.objects.seqinst.DeltaInst(SeqInst)#
An instance corresponding to changed applied to other sequences.
- classmethod __new__(*args, **kwargs)#
- __bool__()#
True if self else False
- __init__(*args, **kwargs)#
- __iter__()#
Implement iter(self).
- __len__()#
Return len(self).
- __reduce__()#
Helper for pickle.
- __repr__()#
Return repr(self).
- to_continuous()#
Transform this instance to a continuous sequence instance.
- Returns:
ContinuousInst– The equivalent instance as a single continuous sequence instance.
Delta Segments#
- class pyncbitk.objects.seqinst.Delta(Serial)#
A single delta segment in a
DeltaInstobject.- classmethod __new__(*args, **kwargs)#
- __reduce__()#
Helper for pickle.