sctools.metrics.gatherer.MetricGatherer

class sctools.metrics.gatherer.MetricGatherer(bam_file: str, output_stem: str, mitochondrial_gene_ids: Set[str] = {}, compress: bool = True)[source]

Gathers Metrics from an experiment

Because molecules tend to have relatively small numbers of reads, the memory footprint of this method is typically small (tens of megabytes).

Parameters
  • bam_file (str) – the bam file containing the reads that metrics should be calculated from. Can be a chunk of cells or an entire experiment

  • output_stem (str) – the file stem for the gzipped csv output

extract_metrics()[source]

extracts metrics from bam_file and writes them to output_stem.csv.gz

__init__(bam_file: str, output_stem: str, mitochondrial_gene_ids: Set[str] = {}, compress: bool = True)[source]

Methods

__init__(bam_file, output_stem[, ...])

extract_metrics([mode])

extract metrics from the provided bam file and write the results to csv.

Attributes

bam_file

the bam file that metrics are generated from