Bio.motifs.jaspar package

Module contents

JASPAR2014 module.

class Bio.motifs.jaspar.Motif(matrix_id, name, alphabet='ACGT', instances=None, counts=None, collection=None, tf_class=None, tf_family=None, species=None, tax_group=None, acc=None, data_type=None, medline=None, pazar_id=None, comment=None)

Bases: Bio.motifs.Motif

A subclass of Bio.motifs.Motif used to represent a JASPAR profile.

Additional metadata information are stored if available. The metadata availability depends on the source of the JASPAR motif (a ‘pfm’ format file, a ‘jaspar’ format file or a JASPAR database).

__init__(self, matrix_id, name, alphabet='ACGT', instances=None, counts=None, collection=None, tf_class=None, tf_family=None, species=None, tax_group=None, acc=None, data_type=None, medline=None, pazar_id=None, comment=None)

Construct a JASPAR Motif instance.

property base_id

Return the JASPAR base matrix ID.

property version

Return the JASPAR matrix version.

__str__(self)

Return a string represention of the JASPAR profile.

We choose to provide only the filled metadata information.

__hash__(self)

Return the hash key corresponding to the JASPAR profile.

Note

We assume the unicity of matrix IDs

__eq__(self, other)

Return True if matrix IDs are the same.

class Bio.motifs.jaspar.Record

Bases: list

Represent a list of jaspar motifs.

Attributes:
  • version: The JASPAR version used

__init__(self)

Initialize the class.

__str__(self)

Return a string of all motifs in the Record.

to_dict(self)

Return the list of matrices as a dictionary of matrices.

Bio.motifs.jaspar.read(handle, format)

Read motif(s) from a file in one of several different JASPAR formats.

Return the record of PFM(s). Call the appropriate routine based on the format passed.

Bio.motifs.jaspar.write(motifs, format)

Return the representation of motifs in “pfm” or “jaspar” format.

Bio.motifs.jaspar.calculate_pseudocounts(motif)

Calculate pseudocounts.

Computes the root square of the total number of sequences multiplied by the background nucleotide.

Bio.motifs.jaspar.split_jaspar_id(id)

Split a JASPAR matrix ID into its component.

Components are base ID and version number, e.g. ‘MA0047.2’ is returned as (‘MA0047’, 2).