utils Module

Provide utilities.

platform:Unix
synopsis:Give utility function for the analysis of TFFMs.
utils.get_sequences_info(seq_file)[source]

Get the number of sequences, number of residues, and starting nucleotides.

Parameters:seq_file (str) – File containing the sequences in fasta format
Returns:The number of sequences, number of residues, and starting nucleotides occurrences
Return type:tuple of (int, int, dic of str->int)
utils.parse_fasta(fasta_file)[source]

Parse a fasta file and return the list of SeqRecord items.

Parameters:fasta_file (str) – Fasta file containing the sequences.
Returns:The set of Bio.SeqRecord instances found in the fasta file.
Return type:list of Bio.SeqRecord
utils.roundrobin(*iterables)[source]

Create a generator interlacing the iterables given in argument.

For example, roundrobin(‘ABC’, ‘D’, ‘EF’) –> A D E B F C

Parameters:iterables – Pointer to the iterables.
Returns:The generator over the intarlaced iterables.
Return type:Generator
utils.set_sequences_weight(sequences, weight)[source]

Give the same weight weight to all the sequences in sequences.

The sequences are constructed using the ghmm module and form a ghmm.SequenceSet.

Parameters:sequences (ghmm.SequenceSet) – List of sequences to weight

Module author: Anthony Mathelier <amathelier@cmmt.ubc.ca>

Previous topic

drawing Module

Next topic

constants Module

This Page