Iterative Searches#
- pyhmmer.hmmer.jackhmmer(queries, sequences, *, max_iterations=5, select_hits=None, checkpoints=False, cpus=0, callback=None, builder=None, **options)#
Search protein sequences against a sequence database.
- Parameters:
queries (iterable of
DigitalSequence) – The query sequences to search for in the sequence database. Passing a single sequence object is supported.sequences (iterable of
DigitalSequence) – A database of sequences to query. If you plan on using the same sequences several times, consider storing them into aDigitalSequenceBlockdirectly.jackhmmeralso supports passing aSequenceFileas the target sequences which will be open again at each iteration.max_iterations (
int) – The maximum number of iterations for the search. Hits will be returned early if the searched converged.select_hits (callable, optional) – A function or callable object for manually selecting hits during each iteration. It should take a single
TopHitsargument and change the inclusion of individual hits with theincludeanddropmethods ofHitobjects.checkpoints (
bool) – A logical flag to return the results at each iteration ‘checkpoint’. IfTrue, then an iterable of up tomax_iterationsIterationResultwill be returned, rather than just the final iteration. This is similar to--chkhmmamd--chkaliflags from HMMER3’sjackhmmerinterface.cpus (
int) – The number of threads to run in parallel. Pass1to run everything in the main thread,0to 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. PassingNonewill create a default instance.backend (
str) – The parallel backend to use for workers to be executed. Supportsthreadingto use thread-based parallelism, ormultiprocessingto use process-based parallelism.
- Yields:
IterationResult– An iteration result instance for each query, in the same order the queries were passed in the input. Ifcheckpointoption isTrue, all iterations will be returned instead of the last one.- Raises:
AlphabetMismatch – When any of the query sequence the profile or the optional builder do not share the same alphabet.
Note
Any additional keyword arguments passed to the
jackhmmerfunction will be passed transparently to thePipelineto be created in each worker thread.Caution
Default values used for
jackhmmerdo not correspond to the default parameters used for creating a pipeline in the other cases. If no parameter value is given as a keyword argument,jackhmmerwill create the pipeline withincE=0.001andincdomE=0.001, where a defaultPipelinewould useincE=0.01andincdomE=0.01.Added in version 0.8.0.