modos.genomics.formats#

Classes#

GenomicFileSuffix

Enumeration of all supported genomic file suffixes.

Functions#

read_pysam(path[, region])

Automatically instantiate a pysam file object from input path and passes any additional kwarg to it.

Module Contents#

class modos.genomics.formats.GenomicFileSuffix[source]#

Bases: tuple, enum.Enum

Enumeration of all supported genomic file suffixes.

CRAM = ('.cram',)[source]#
BAM = ('.bam',)[source]#
SAM = ('.sam',)[source]#
VCF = ('.vcf', '.vcf.gz')[source]#
BCF = ('.bcf',)[source]#
FASTA = ('.fasta', '.fa')[source]#
FASTQ = ('.fastq', '.fq')[source]#
classmethod from_path(path)[source]#
Parameters:

path (pathlib.Path)

Return type:

GenomicFileSuffix

get_index_suffix()[source]#

Return the supported index suffix related to a genomic filetype

Return type:

str

to_htsget_endpoint()[source]#

Return the htsget endpoint for a genomic file type

Return type:

str

modos.genomics.formats.read_pysam(path, region=None, **kwargs)[source]#

Automatically instantiate a pysam file object from input path and passes any additional kwarg to it.

Parameters:
Return type:

Iterator[pysam.AlignedSegment | pysam.VariantRecord]