Skip to content

IO

A memory-efficient FASTA parser yielding (header, sequence).

Methods:

  • __new__

    Open a FASTA file for reading.

__new__

Python
__new__(path: str) -> FastaReader

Open a FASTA file for reading.

Parameters:

  • path

    (str) –

    The path to the FASTA file.

A memory-efficient FASTQ parser yielding (header, sequence, qualities).

Methods:

  • __new__

    Open a FASTQ file for reading.

  • __next__

    Yields a tuple of (header, sequence, quality_string)

__new__

Python
__new__(path: str) -> FastqReader

Open a FASTQ file for reading.

__next__

Python
__next__() -> tuple[bytes, bytes, bytes]

Yields a tuple of (header, sequence, quality_string)

A streaming writer for Extended BED (BED6+1) files.

A streaming writer for VCF v4.2 files.

Methods:

  • __enter__

    Context manager entry (__enter__)

  • __exit__

    Context manager exit (__exit__). Flushes and closes the file.

  • __new__

    Opens the file and writes the VCF headers.

  • write_record

    Writes the frameshift variants for a single contig/sequence.

__enter__

Python
__enter__() -> VcfWriter

Context manager entry (__enter__)

__exit__

Python
__exit__(_exc_type: Optional[Any], _exc_value: Optional[Any], _traceback: Optional[Any]) -> None

Context manager exit (__exit__). Flushes and closes the file.

__new__

Python
__new__(output_path: str) -> VcfWriter

Opens the file and writes the VCF headers.

write_record

Python
write_record(genes: Sequence[Gene], header: str, sequence: bytes) -> None

Writes the frameshift variants for a single contig/sequence.

A streaming writer for INSDC-compliant GFF3 files.

A streaming writer for non-wrapped nucleotide FASTA (.fna) files.

A streaming writer for non-wrapped amino acid FASTA (.faa) files.