pyprot.base package

Subpackages

Submodules

pyprot.base.aminoacid module

class AminoAcid(aminoAcid)[source]

Bases: builtins.object

Represents one of the amino acids that can be found in genetic sequences. Can be one of the following : - any of the twenty amino acids - any of four combinations of possible amino acids - selenocysteine, pyrrolysine, a gap or termination codon The full list of possible amino acids is defined by AA_NAMES.

__init__(aminoAcid)[source]

Creates an AminoAcid object representing one of the possible amino acids. @param aminoAcid can be the name of an amino acid, or an AminoAcid object (in which case a copy is created).

static getAllNames(nameMode='short')[source]

Yields the names of all represented amino acids, excepting gaps and termination codons.

getName(nameMode='short')[source]
static getNames(nameMode='short')[source]

Yields the names of the 20 basic amino acids.

static getNamesInRange(startIndex, stopIndex, nameMode='short')[source]

Yields the names of amino acids in AA_NAMES, from startIndex to stopIndex (excluded).

isGap()[source]

True if this amino acid is a gap, false otherwise.

isTermination()[source]

True if this amino acid is a termination codon, false otherwise.

pyprot.base.sequence module

class Sequence(aminoAcids=None, description='')[source]

Bases: builtins.list

Represents a sequence of amino acids. Inherits from list, and ensures all items are of type AminoAcid.

__init__(aminoAcids=None, description='')[source]

Creates a Sequence object that represents the amino acid sequence contained in aminoAcids. aminoAcids can be one of the following : - None, meaning the Sequence is empty (default) - an AminoAcid object - a string of X AminoAcid short (uppercase) names or 1 AminoAcid name - a list containing AminoAcid objects and/or strings of individual AminoAcid names

extend(aminoAcids)[source]

Extends the base by adding ‘aminoAcids’ at its end. @param aminoAcids must be compatible with the Sequence constructor

getDescription()[source]

Returns the base’s description.

insert(index, aminoAcids)[source]

Inserts aminoAcids into the base at index ‘index’. List objects will not be embedded as is, instead their items will be inserted in the same order, individually. @param aminoAcids must be compatible with the Sequence constructor @param index is the index at which aminoAcids is inserted

setDescription(description)[source]

Sets the base’s description

setNameMode(newMode)[source]

Changes the name display mode to ‘newMode’.

setSeparator(newSep)[source]

Changes the string that separates each displayed AminoAcid.

Module contents

Table Of Contents

Previous topic

pyprot.align package

Next topic

pyprot.data package

This Page