Results#

class pyinfernal.cm.TopHits#
__init__(*args, **kwargs)#
copy()#

Create a copy of this TopHits instance.

Added in version 0.5.0.

merge(*others)#

Concatenate the hits from this instance and others.

If the Z and domZ values used to compute E-values were computed by the Pipeline from the number of targets, the returned object will update them by summing self.Z and other.Z. If they were set manually, the manual value will be kept, provided both values are equal.

Returns:

TopHits – A new collection of hits containing a copy of all the hits from self and other, sorted by E-value.

Raises:

ValueError – When trying to merge together several hits obtained from different Pipeline with incompatible parameters.

Caution

This should only be done for hits obtained for the same domain on similarly configured pipelines. Some internal checks will be done to ensure this is not the case, but the results may not be consistent at all.

write(fh, format='3', header=True)#

Write the hits in tabular format to a file-like object.

Parameters:
  • fh (io.IOBase) – A Python file handle, opened in binary mode.

  • format (str) – The tabular format in which to write the hits.

  • header (bool) – Whether to write a table header. Ignored when writing in the pfam format.

E#

The E-value threshold with which hits are reported.

Type:

float

T#

The score threshold with which hits are reported.

Type:

float or None

Z#

The effective target database size.

Type:

float

incE#

The E-value threshold with which hits are included.

Type:

float

incT#

The score threshold with which hits are included.

Type:

float or None

included#

An iterator over the hits marked as included.

Type:

iterator of Hit

query#

The query object these hits were obtained for.

The actual type of TopHits.query depends on the query that was given to the Pipeline that created the object.

Type:

object

reported#

An iterator over the hits marked as reported.

Type:

iterator of Hit

class pyinfernal.cm.Hit#
accession#

The accession of the database hit, if any.

Changed in version 0.12.0: Property is now a str instead of bytes.

Type:

str or None

bias#

The null2/null3 contribution to the uncorrected score.

Type:

float

description#

The description of the database hit, if any.

Changed in version 0.12.0: Property is now a str instead of bytes.

Type:

str or None

duplicate#

Whether this hit is marked as duplicate.

Type:

bool

evalue#

The E-value of the bitscore.

Type:

float

included#

Whether this hit is marked as included.

Type:

bool

name#

The name of the database hit.

Type:

str

pvalue#

The p-value of the bitscore.

Type:

float

reported#

Whether this hit is marked as reported.

Type:

bool

score#

Bit score of the hit after correction.

Type:

float

strand#

The strand where the hit is located (either “+” or “-“).

Type:

str

class pyinfernal.cm.Alignment#
cm_accession#

The accession of the query, or its name if it has none.

Type:

str

cm_description#

The description of the query, or its name if it has none.

Type:

str

cm_from#

The start coordinate of the alignment in the query CM.

Type:

int

cm_name#

The name of the query CM.

Type:

str

cm_sequence#

The sequence of the query CM in the alignment.

Type:

str

cm_to#

The end coordinate of the alignment in the query CM.

Type:

int

identity_sequence#

The identity sequence between the query and the target.

Type:

str

posterior_probabilities#

Posterior probability annotation of the alignment.

Type:

str

target_from#

The start coordinate of the alignment in the target sequence.

Type:

int

target_name#

The name of the target sequence.

Changed in version 0.12.0: Property is now a str instead of bytes.

Type:

str

target_sequence#

The sequence of the target sequence in the alignment.

Type:

str

target_to#

The end coordinate of the alignment in the target sequence.

Type:

int