Package PyML :: Package utils :: Module fasta
[hide private]
[frames] | no frames]

Module fasta

source code


A parser for FASTA files.

Copyright (C) 2003, 2004 by BiRC -- Bioinformatics Research Center
                                    University of Aarhus, Denmark
                                    Contact: Thomas Mailund <mailund@birc.dk>
with changes by Asa Ben-Hur

Classes [hide private]
  MalformedInput
Exception raised when the input file does not look like a fasta file.
  FastaRecord
a fasta record.
  fasta_itr
An iterator through a sequence of fasta records.
  fasta_slice
Provide an iteration through the fasta records in 'src', from 'start' to 'stop'.
Functions [hide private]
 
myopen(fileName) source code
 
_fasta_itr_from_file(file)
Provide an iteration through the fasta records in file.
source code
 
_fasta_itr_from_name(fname)
Provide an iteration through the fasta records in the file named fname.
source code
 
_fasta_itr(src)
Provide an iteration through the fasta records in file `src'.
source code
 
fasta_get_by_name(itr, name)
Return the record in itr with the given name.
source code
 
get_sequence(src, name)
Return the record in src with the given name.
source code
 
fasta_count(src)
count the number of records in a fasta file
source code
 
fasta_split(fileName, num_files, directory=None)
split a fasta file into a given number of files the resulting files are named by adding a number to the provided file name.
source code
 
fasta_subset(infileName, outfileName, ids) source code
 
fasta_delimiter(fastaFile) source code
Function Details [hide private]

_fasta_itr(src)

source code 

Provide an iteration through the fasta records in file `src'.

Here `src' can be either a file object or the name of a file.

fasta_split(fileName, num_files, directory=None)

source code 

split a fasta file into a given number of files
the resulting files are named by adding a number to the provided file name.

:Parameters:
- `fileName` - the fasta file to split
- `num_files` - the number of files to split into
- `directory` - the directory into which to write the files