skbio.sequence.DNASequence.read

classmethod DNASequence.read(fp, format=None, **kwargs)[source]

Create a new DNASequence instance from a file.

This is a convenience method for skbio.io.read. For more information about the I/O system in scikit-bio, please see skbio.io.

Supported file formats include:

Parameters:

fp : filepath or filehandle

The location to read the given format. Filepaths are automatically closed when read; filehandles are the responsibility of the caller.

format : str, optional

The format must be a format name with a reader for DNASequence. If a format is not provided or is None, it will attempt to guess the format.

kwargs : dict, optional

Keyword arguments passed to skbio.io.read and the file format reader for DNASequence.

Returns:

DNASequence

A new instance.