load_seq#

load_seq(filename: PathLike, annotation_path: PathLike | None = None, format: str | None = None, moltype: str | None = None, label_to_name: Callable | None = None, parser_kw: dict | None = None, info: dict | None = None, new_type: bool = False, annotation_offset: int = 0, **kw: dict) Sequence#

loads unaligned sequences from file

Parameters:
filename

path to sequence file

annotation_path

path to annotation file, ignored if format is genbank

format

sequence file format, if not specified tries to guess from the path suffix

moltype

the moltype, eg DNA, PROTEIN, ‘dna’, ‘protein’

label_to_name

function for converting original name into another name.

parser_kw

optional arguments for the parser

info

a dict from which to make an info object

new_type

if True, returns a new type Sequence (cogent3.core.new_sequence.Sequence) The default will be changed to True in 2025.1. Support for the old style will be removed as of 2025.6.

annotation_offset

integer indicating start position relative to annotations

**kw

other keyword arguments passed to sequence loader

Returns:
Sequence

Notes

Returns one sequence from a file. Use load_aligned_seqs or load_unaligned_seqs to get a collection.