Skip to main content
`Ctrl`+`K`

# skbio.sequence.Sequence.read

Sequence.read(format=None, **kwargs)

  Create a new `Sequence` instance from a file.

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

  Supported file formats include:

  - `'embl'` (`skbio.io.format.embl`)

  - `'fasta'` (`skbio.io.format.fasta`)

  - `'fastq'` (`skbio.io.format.fastq`)

  - `'qseq'` (`skbio.io.format.qseq`)

  - `'genbank'` (`skbio.io.format.genbank`)

  - `'gff3'` (`skbio.io.format.gff3`)

  Parameters:
    file openable (filepath, URL, filehandle, etc.)

      The location to read the given format into. Something that is understood by `skbio.io.util.open`. Filehandles are not automatically closed, it is the responsibility of the caller.

    format str, optional

      The format of the file. The format must be a format name with a reader for `Sequence`. If None, the format will be inferred.

    kwargs dict, optional

      Additional arguments passed to `skbio.io.registry.read` and the reader for `Sequence`.

  Returns:
    `Sequence`

      A new instance.

  See also

  `write`
  `skbio.io.registry.read`
  `skbio.io.util.open`
  `skbio.io.format.embl`
  `skbio.io.format.fasta`
  `skbio.io.format.fastq`
  `skbio.io.format.qseq`
  `skbio.io.format.genbank`
  `skbio.io.format.gff3`