Handling of biological data

modpipe.sequence – Handling of amino acid sequences

Handling of amino acid sequences and common file formats

class modpipe.sequence.FASTAFile

Representation of a FASTA-format file

read(fh)

Read sequences from the given stream in FASTA format. A list of the sequences is returned, as Sequence objects.

write(fh, seq, width=70)

Write a single Sequence object to the given stream in FASTA format.

class modpipe.sequence.PIRFile

Representation of a PIR-format file

read(fh)

Read sequences from the given stream in PIR format. A list of the sequences is returned, as Sequence objects.

write(fh, seq, width=70)

Write a single Sequence object to the given stream in PIR format.

class modpipe.sequence.SPTRFile

Representation of a file containing UniProtKB/SwissProt or TrEMBL database entries

read(fh)

Read sequences from the given stream in SPTR format. A list of the sequences is returned, as Sequence objects.

class modpipe.sequence.Sequence

Representation of a single amino acid sequence

clean(keep_char='')

Clean up the primary sequence

get_id()

Return the ModPipe sequence identifier

class modpipe.sequence.UniqueFile

Mapping file from alignment codes to ModPipe IDs

add_sequence(modpipe_id, align_code)

Add a single mapping from an align code to a ModPipe ID

file_name_from_seqfile(seqfile)

Given an input sequence file, return a suitable name for the unique file

write(fh)

Write the code-ID mapping to a stream