QC Report

Outputs quality control report from given bam files.

Creating QC Report

Usually as a first step after receiving bam files, we want to do a quality check and assess our data. This code generates a PDF report of important QC statistics for long read methylation modification bam files

import dimelo as dm

# first we specify the locations of our bam files
in_bam = "../../dimelo/test/data/winnowmap_guppy_merge_subset.bam"
sample_name = "test"
out_dir = "../../dimelo/dimelo_test"

# next we run the "qc_report" function
dm.qc_report(in_bam, sample_name, out_dir)
# now our output directory that we specified, will have a file called "test_qc_report.pdf"

Out:

Processing reads:   0%|          | 0/10 [00:00<?, ? batches/s]
Processing reads:  10%|#         | 1/10 [00:00<00:05,  1.78 batches/s]
Processing reads:  20%|##        | 2/10 [00:01<00:04,  1.92 batches/s]
Processing reads:  30%|###       | 3/10 [00:01<00:03,  1.92 batches/s]
Processing reads:  40%|####      | 4/10 [00:02<00:02,  2.05 batches/s]
Processing reads:  50%|#####     | 5/10 [00:02<00:02,  2.18 batches/s]
Processing reads:  60%|######    | 6/10 [00:02<00:01,  2.21 batches/s]
Processing reads:  70%|#######   | 7/10 [00:03<00:01,  2.19 batches/s]
Processing reads:  80%|########  | 8/10 [00:03<00:00,  2.05 batches/s]
Processing reads:  90%|######### | 9/10 [00:05<00:00,  1.39 batches/s]
Processing reads: 100%|##########| 10/10 [00:06<00:00,  1.05s/ batches]
Processing reads: 100%|##########| 10/10 [00:06<00:00,  1.45 batches/s]
mean length:  12202
num reads:  3243
num bases:  39571086
QC report located at: ../../dimelo/dimelo_test/test_qc_report.pdf
Database located at: ../../dimelo/dimelo_test/winnowmap_guppy_merge_subset.db

Total running time of the script: ( 0 minutes 12.341 seconds)

Gallery generated by Sphinx-Gallery