biotite.sequence.io.fasta.get_sequence

biotite.sequence.io.fasta.get_sequence(fasta_file, header=None)[source]

Get a sequence from a FastaFile instance.

Parameters:
fasta_file : FastaFile

The FastaFile to be accessed.

header : str, optional

The header to get the sequence from. By default, the first sequence of the file is returned.

Returns:
sequence : NucleotideSequence or ProteinSequence

The first sequence in the FastaFile. NucleotideSequence if the sequence string fits the corresponding alphabet, ProteinSequence otherwise.

Raises:
ValueError

If the sequence data can be neither converted into a NucleotideSequence nor a ProteinSequence.