Reference

bam2tensor package

bam2tensor.functions module

Core functions for bam2tensor.

extract_methylation_data_from_bam(input_bam, genome_methylation_embedding, quality_limit=20, verbose=False, debug=False)

Extract methylation data from a .bam file.

Parameters:
  • input_bam (Path to the input .bam file.)

  • quality_limit (Minimum mapping quality to include.)

  • genome_methylation_embedding (A GenomeMethylationEmbedding object.)

  • verbose (Print verbose output.)

  • debug (Print debug output.)

Return type:

coo_matrix

Returns:

A scipy.sparse.coo_matrix of the methylation data.

Raises:

FileNotFoundError – If the input .bam file is not found.: