new_majiq.SJExperiment.from_bam

classmethod SJExperiment.from_bam(path, sg, strandness='auto', nthreads=1, allow_disjoint_contigs=False, auto_minreads=10, auto_minjunctions=100, auto_mediantolerance=0.2, update_exons_thresholds=ExperimentThresholds(minreads=3, mindenovo=5, minpos=2, max_pctbins=0.6, junction_acceptance_probability=0.5, intron_acceptance_probability=0.95))

Load SJExperiment from BAM file

Load intron and junction coverage from BAM file using splicegraph to define intron regions for coverage. If strandness is “auto”, use coverage assigned to each strand on known junctions to infer experimental strandness.

Parameters:
  • path (Union[str, Path]) – Path for input BAM file

  • sg (SpliceGraph) – Used to determine regions for contig intron coverage

  • strandness (Union[str, ExperimentStrandness]) – strandness to parse BAM files with. If str, one of “auto”, “forward”, “reverse”, or “none” (not case-sensitive). If auto, automatically detects strand using median ratio of forward vs reverse stranded reads at annotated junctions

  • nthreads (int) – Number of threads to parse BAM with

  • allow_disjoint_contigs (bool) – If true, don’t raise error if BAM doesn’t have any contigs that overlap sg

  • auto_minreads (int) – Only consider evidence from splicegraph junctions with at least this many total (unstranded) reads

  • auto_minjunctions (int) – Infer unstranded if the number of splicegraph junctions with sufficient reads is less than this argument

  • auto_mediantolerance (float) – Infer unstranded if the median proportion of junctions of forward strand vs all reads deviates from 0.5 by at most this amount

  • update_exons_thresholds (Optional[ExperimentThresholds]) – If specified, use denovo junction coverage passing thresholds to split intronic coverage by novel splice sites. If None, do not update junctions from splicegraph using input junction coverage.

Returns:

SJExperiment – intron and junction coverage from specified BAM file