Plan7¶
High-level interface to the Plan7 data model.
Plan7 is the model architecture used by HMMER since HMMER2.
See also
Details about the Plan 7 architecture in the HMMER documentation.
Hits¶
-
class
pyhmmer.plan7.
Hit
¶ A high-scoring database hit found by the comparison pipeline.
-
class
pyhmmer.plan7.
TopHits
¶ A ranked list of top-scoring hits.
TopHits
are thresholded using the parameters from the pipeline, and are sorted by key when you obtain them from aPipeline
instance:>>> abc = thioesterase.alphabet >>> hits = Pipeline(abc).search(thioesterase, proteins) >>> hits.is_sorted() True
Use
len
to query the number of top hits, and the usual indexing notation to extract a particular hit:>>> len(hits) 1 >>> hits[0].name b'938293.PRJEB85.HG003687_113'
-
clear
()¶ Free internals to allow reusing for a new pipeline run.
-
HMM¶
HMM File¶
Pipeline¶
-
class
pyhmmer.plan7.
Pipeline
¶ An HMMER3 accelerated sequence/profile comparison pipeline.
-
search
()¶ Run the pipeline using a query HMM against a sequence database.
- Parameters
hmm (
HMM
) – The HMM object to use to query the sequence database.sequences (
Iterable
ofDigitalSequence
) – The sequences to query with the HMMs. Pass aSequenceFile
instance in digital mode to iteratively read from disk.hits (
TopHits
, optional) – A hit collection to store results in, if any. IfNone
, a new collection will be allocated. Use a non-None
value if you are running several HMMs sequentially and want to aggregate the results, or if you are able to recycle aTopHits
instance withTopHits.clear
.
- Returns
TopHits
– the hits found in the sequence database. If an instance was passed via thehits
argument, it is safe to ignore the return value and to access it by reference.- Raises
ValueError – When the alphabet of the current pipeline does not match the alphabet of the given HMM.
-
Profile¶
-
class
pyhmmer.plan7.
Profile
¶ A Plan7 search profile.
-
clear
()¶ Clear internal buffers to reuse the profile without reallocation.
-
configure
()¶ Configure a search profile using the given models.
- Parameters
hmm (
pyhmmer.plan7.HMM
) – The model HMM with core probabilities.bg (
pyhmmer.plan7.Background
) – The null background model.L (
int
) – The expected target sequence length.multihit (
bool
) – Whether or not to use multihit modes.local (
bool
) – Whether or not to use non-local modes.
-
is_local
()¶ Returns whether or not the profile is in a local alignment mode.
-
is_multihit
()¶ Returns whether or not the profile is in a multihit alignment mode.
-
optimized
()¶ Convert the profile to a platform-specific optimized profile.
-
-
class
pyhmmer.plan7.
OptimizedProfile
¶ An optimized profile that uses platform-specific instructions.
-
is_local
()¶ Returns whether or not the profile is in a local alignment mode.
-
write
()¶ Write an optimized profile to two separate files.
HMMER implements an acceleration pipeline using several scoring algorithms. Parameters for MSV (the Multi ungapped Segment Viterbi) are saved independently to the
fh_filter
handle, while the rest of the profile is saved tofh_profile
.
-