gffutils.Feature.sequence

Feature.sequence(fasta, use_strand=True)

Retrieves the sequence of this feature as a string.

Uses the pyfaidx package.

Parameters:

fasta : str

If str, then it’s a FASTA-format filename; otherwise assume it’s a pyfaidx.Fasta object.

use_strand : bool

If True (default), the sequence returned will be reverse-complemented for minus-strand features.

Returns:

string