Skip to content

Commit

Permalink
add pytest for correctGCBias
Browse files Browse the repository at this point in the history
  • Loading branch information
pavanvidem committed Jan 22, 2025
1 parent c8b8802 commit 3f2e806
Show file tree
Hide file tree
Showing 6 changed files with 327 additions and 0 deletions.
26 changes: 26 additions & 0 deletions pydeeptools/deeptools/test/test_correctGCBias.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# from unittest import TestCase

import deeptools.correctGCBias
import deeptools.utilities
import os.path
from os import unlink
import pysam

ROOT = os.path.dirname(os.path.abspath(__file__)) + "/test_data/"


def test_correctGCBias():
"""
Test minimal command line args for correctGCBias
"""
GCbiasFreq = ROOT + 'computeGCBias_result1.tabular'
BAM = ROOT + 'paired_chr2L.bam'
GENOME = ROOT + 'sequence.2bit'
outfile = '/tmp/test_correctbias.bam'
args = "--GCbiasFrequenciesFile {} --bamfile {} --genome {} --effectiveGenomeSize 10050 --correctedFile {}".format(GCbiasFreq, BAM, GENOME, outfile).split()
deeptools.correctGCBias.main(args)

alignment_count = pysam.AlignmentFile(outfile, "rb").count()
expected_count = 11630
assert abs(alignment_count - expected_count) < 50
unlink(outfile)
Loading

0 comments on commit 3f2e806

Please sign in to comment.