HMMER¶
Reimplementation of HMMER binaries with the PyHMMER API.
-
pyhmmer.hmmer.
hmmsearch
(queries, sequences, cpus=0, callback=None, **options)¶ Search HMM profiles against a sequence database.
- Parameters
queries (iterable of
HMM
) – The query HMMs to search in the database.sequences (collection of
DigitalSequence
) – A database of sequences to query.cpus (
int
) – The number of threads to run in parallel. Pass1
to run everything in the main thread,0
to automatically select a suitable number (usingpsutil.cpu_count
), or any positive number otherwise.callback (callable) – A callback that is called everytime a query is processed with two arguments: the query, and the total number of queries. This can be used to display progress in UI.
- Yields
TopHits
– A top hits instance for each query, in the same order the queries were passed in the input.
-
pyhmmer.hmmer.
phmmer
(queries, sequences, cpus=0, callback=None, builder=None, **options)¶ Search protein sequences against a sequence database.
- Parameters
queries (iterable of
DigitalSequence
) – The query sequences to search in the database.sequences (collection of
DigitalSequence
) – A database of sequences to query.cpus (
int
) – The number of threads to run in parallel. Pass1
to run everything in the main thread,0
to automatically select a suitable number (usingpsutil.cpu_count
), or any positive number otherwise.callback (callable) – A callback that is called everytime a query is processed with two arguments: the query, and the total number of queries. This can be used to display progress in UI.
builder (
Builder
, optional) – A builder to configure how the queries are converted to HMMs. PassingNone
will create a default instance.
- Yields
TopHits
– A top hits instance for each query, in the same order the queries were passed in the input.
-
pyhmmer.hmmer.
hmmpress
(hmms, output)¶ Press several HMMs into a database.
Calling this function will create 4 files at the given location:
{output}.h3p
(containing the optimized profiles),{output}.h3m
(containing the binary HMMs),{output}.h3f
(containing the MSV parameters), and{output}.h3i
(the SSI index mapping the previous files).- Parameters
hmms (iterable of
HMM
) – The HMMs to be pressed together in the file.output (
str
oros.PathLike
) – The path to an output location where to write the different files.