Skip to content

Commit

Permalink
added maturing build to github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
gerikson committed Jan 20, 2025
1 parent fa70398 commit 61a3581
Show file tree
Hide file tree
Showing 6 changed files with 59 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- name: pip install
run: |
pip install .[actions]
maturin build --release
- name: Test deepTools
run: |
pytest -v
Expand All @@ -72,6 +73,7 @@ jobs:
- name: pip install
run: |
pip install .[actions]
maturin build --release
- name: Test deepTools
run: |
pytest -v
3 changes: 3 additions & 0 deletions pydeeptools/deeptools/test/test_data/r_bamcompare.bedgraph
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
3R 0 500 0.834942
3R 500 1000 1.10469
3R 1000 1500 0.422782
6 changes: 6 additions & 0 deletions pydeeptools/deeptools/test/test_data/r_bamcompare1.bedgraph
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
chr2 0 5000000 1
chr2 5000000 5000500 1.20408
chr2 5000500 5001000 0.961332
chr2 5001000 5001500 0.960754
chr2 5001500 5002000 0.972789
chr2 5002000 5010000 1
6 changes: 6 additions & 0 deletions pydeeptools/deeptools/test/test_data/r_bamcompare2.bedgraph
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
chr2 0 5000000 1
chr2 5000000 5000500 1.2040817
chr2 5000500 5001000 0.9613319
chr2 5001000 5001500 0.9607535
chr2 5001500 5002000 0.9727891
chr2 5002000 5010000 1
3 changes: 3 additions & 0 deletions pydeeptools/deeptools/test/test_data/testA.bedgraph
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
3R 0 50 0
3R 50 150 5000000
3R 150 200 10000000
39 changes: 39 additions & 0 deletions pydeeptools/deeptools/test/test_r_bamCompare.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,45 @@ def test_r_bamcompare():
regions = []
verbose = False

# Call the Rust function
r_bamcompare(
bamifile1, bamifile2, ofile, ofiletype, norm, effective_genome_size, scalefactorsmethod, operation,
pseudocount, ignoreduplicates, minmappingquality, samflaginclude, samflagexclude, minfraglen, maxfraglen, nproc,
_ignorechr, binsize, regions, verbose
)
# Add assertions to verify the expected behavior
expected = ['3R\t0\t500\t0.6213592\n',
'3R\t500\t1000\t0.8252427\n',
'3R\t1000\t1500\t0.2\n',]
_foo = open(ofile, 'r')
resp = _foo.readlines()
_foo.close()
assert f"{resp}" == f"{expected}", f"{resp} != {expected}"
unlink(ofile)

def test_r_bamcompare_RPKM():
bamifile1 = BAMFILE_A
bamifile2 = BAMFILE_B
ofile = ROOT + "r_bamcompare_output.bedgraph"
ofiletype = "bedgraph"
norm = "RPKM"
effective_genome_size = 0
scalefactorsmethod = "None"
operation = "ratio"
pseudocount = 0
# filtering options
ignoreduplicates = False
minmappingquality = 0
samflaginclude = 0
samflagexclude = 0
minfraglen = 0
maxfraglen = 0
nproc = 1
_ignorechr = []
binsize = 500
regions = []
verbose = False

# Call the Rust function
r_bamcompare(
bamifile1, bamifile2, ofile, ofiletype, norm, effective_genome_size, scalefactorsmethod, operation,
Expand Down

0 comments on commit 61a3581

Please sign in to comment.