From a0a029583122ead30da94c010c731be59c1ae701 Mon Sep 17 00:00:00 2001
From: Jeremy Mathews <Jeremy.Mathews@utsouthwestern.edu>
Date: Tue, 3 Sep 2019 07:09:29 -0500
Subject: [PATCH] Update cross correlation and related tests

---
 .gitlab-ci.yml                         |  2 ++
 workflow/scripts/xcor.py               |  2 +-
 workflow/tests/test_call_peaks_macs.py |  4 ++--
 workflow/tests/test_xcor.py            | 12 ++++++------
 4 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 3e6393e..83ef6e5 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -57,6 +57,7 @@ single_end_diff:
     - master
   script:
   - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_SE.txt" --genome 'GRCm38' --astrocyte false -resume
+  - pytest -m singleend
   - pytest -m singlediff
   artifacts:
     expire_in: 2 days
@@ -67,6 +68,7 @@ paired_end_diff:
   stage: multiple
   script:
   - nextflow run workflow/main.nf --designFile "$CI_PROJECT_DIR/test_data/design_diff_PE.txt" --genome 'GRCh38' --pairedEnd true --astrocyte false -resume
+  - pytest -m pairedend
   - pytest -m paireddiff
   artifacts:
     expire_in: 2 days
diff --git a/workflow/scripts/xcor.py b/workflow/scripts/xcor.py
index 096afc9..66fa9ae 100644
--- a/workflow/scripts/xcor.py
+++ b/workflow/scripts/xcor.py
@@ -103,7 +103,7 @@ def xcor(tag, paired):
     uncompressed_tag_filename = tag_basename
 
     # Subsample tagAlign file
-    number_reads = 15000000
+    number_reads = 20000000
     subsampled_tag_filename = \
         tag_basename + ".%d.tagAlign.gz" % (number_reads/1000000)
 
diff --git a/workflow/tests/test_call_peaks_macs.py b/workflow/tests/test_call_peaks_macs.py
index f8a0842..cd94e17 100644
--- a/workflow/tests/test_call_peaks_macs.py
+++ b/workflow/tests/test_call_peaks_macs.py
@@ -26,7 +26,7 @@ def test_peaks_xls_singleend():
 @pytest.mark.singleend
 def test_peaks_bed_singleend():
     peak_file = test_output_path +  'ENCSR238SGC/1/' + 'ENCLB144FDT.narrowPeak'
-    assert utils.count_lines(peak_file) == 199317
+    assert utils.count_lines(peak_file) == 226738
 
 
 @pytest.mark.pairedend
@@ -47,4 +47,4 @@ def test_peaks_xls_pairedend():
 @pytest.mark.pairedend
 def test_peaks_bed_pairedend():
     peak_file = test_output_path + 'ENCSR729LGA/2/' + 'ENCLB568IYX.narrowPeak'
-    assert utils.count_lines(peak_file) == 113821
+    assert utils.count_lines(peak_file) == 112631
diff --git a/workflow/tests/test_xcor.py b/workflow/tests/test_xcor.py
index 4b65aa9..19777a0 100644
--- a/workflow/tests/test_xcor.py
+++ b/workflow/tests/test_xcor.py
@@ -17,9 +17,9 @@ def test_cross_plot_singleend():
 def test_cross_qc_singleend():
     qc_file = os.path.join(test_output_path,"ENCLB144FDT/ENCLB144FDT.cc.qc")
     df_xcor = pd.read_csv(qc_file, sep="\t", header=None)
-    assert df_xcor[2].iloc[0] == '220,240,255'
-    assert df_xcor[8].iloc[0] == 1.024935
-    assert round(df_xcor[9].iloc[0], 6) == 0.697252
+    assert df_xcor[2].iloc[0] == '185,195,205'
+    assert df_xcor[8].iloc[0] == 1.02454
+    assert df_xcor[9].iloc[0] == 0.8098014
 
 
 @pytest.mark.pairedend
@@ -31,6 +31,6 @@ def test_cross_qc_pairedend():
 def test_cross_plot_pairedend():
     qc_file = os.path.join(test_output_path,"ENCLB568IYX/ENCLB568IYX.cc.qc")
     df_xcor = pd.read_csv(qc_file, sep="\t", header=None)
-    assert df_xcor[2].iloc[0] == '220,420,450'
-    assert round(df_xcor[8].iloc[0],6) == 1.058694
-    assert df_xcor[9].iloc[0] == 3.004596
+    assert df_xcor[2].iloc[0] == '215,225,455'
+    assert round(df_xcor[8].iloc[0],6) == 1.056201
+    assert df_xcor[9].iloc[0] == 3.599357
-- 
GitLab