modos.genomics.cram#

Utilities to interact with genomic intervals in CRAM files.

Functions#

extract_cram_metadata(cram)

Extract metadata from the CRAM file header and

validate_cram_files(cram_path)

Validate CRAM files using pysam.

create_sequence_id(name, sequence_md5)

Helper function to create a unique id from a sequence name and md5 hash

Module Contents#

modos.genomics.cram.extract_cram_metadata(cram)[source]#

Extract metadata from the CRAM file header and convert specific attributes according to the modo schema.

Parameters:

cram (pysam.AlignmentFile)

Return type:

List

modos.genomics.cram.validate_cram_files(cram_path)[source]#

Validate CRAM files using pysam. Checks if the file is sorted and has an index.

Parameters:

cram_path (str)

modos.genomics.cram.create_sequence_id(name, sequence_md5)[source]#

Helper function to create a unique id from a sequence name and md5 hash

Parameters:
  • name (str)

  • sequence_md5 (str)

Return type:

str