From 89340f9c4767f9f18daf41fe3a61c320fcea73d0 Mon Sep 17 00:00:00 2001 From: Venkat Malladi <venkat.malladi@utsouthwestern.edu> Date: Tue, 15 Jan 2019 09:29:46 -0600 Subject: [PATCH] Modify tests. --- workflow/tests/test_annotate_peaks.py | 4 ++-- workflow/tests/test_call_peaks_macs.py | 6 +++--- workflow/tests/test_map_qc.py | 4 ++-- workflow/tests/test_overlap_peaks.py | 4 ++-- workflow/tests/test_trim_reads.py | 6 +++--- workflow/tests/test_xcor.py | 6 +++--- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/workflow/tests/test_annotate_peaks.py b/workflow/tests/test_annotate_peaks.py index 692ddce..4608f66 100644 --- a/workflow/tests/test_annotate_peaks.py +++ b/workflow/tests/test_annotate_peaks.py @@ -16,7 +16,7 @@ def test_annotate_peaks_singleend(): assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC.chipseeker_upsetplot.pdf')) annotation_file = test_output_path + 'ENCSR238SGC.chipseeker_annotation.tsv' assert os.path.exists(annotation_file) - assert utils.count_lines(annotation_file) == 152840 + assert utils.count_lines(annotation_file) == 149820 @pytest.mark.pairedend @@ -25,4 +25,4 @@ def test_annotate_peaks_pairedend(): assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA.chipseeker_upsetplot.pdf')) annotation_file = test_output_path + 'ENCSR729LGA.chipseeker_annotation.tsv' assert os.path.exists(annotation_file) - assert utils.count_lines(annotation_file) == 25391 + assert utils.count_lines(annotation_file) == 25579 diff --git a/workflow/tests/test_call_peaks_macs.py b/workflow/tests/test_call_peaks_macs.py index dabfd71..628a914 100644 --- a/workflow/tests/test_call_peaks_macs.py +++ b/workflow/tests/test_call_peaks_macs.py @@ -12,7 +12,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ def test_call_peaks_macs_singleend(): assert os.path.exists(os.path.join(test_output_path, 'ENCLB144FDT.fc_signal.bw')) assert os.path.exists(os.path.join(test_output_path, 'ENCLB144FDT.pvalue_signal.bw')) - assert os.path.exists(os.path.join(test_output_path, 'ENCLB144FDT.xls')) + assert os.path.exists(os.path.join(test_output_path, 'ENCLB144FDT_peaks.xls')) peak_file = test_output_path + 'ENCLB144FDT.narrowPeak' assert utils.count_lines(peak_file) == 227389 @@ -21,6 +21,6 @@ def test_call_peaks_macs_singleend(): def test_call_peaks_macs_pairedend(): assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX.fc_signal.bw')) assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX.pvalue_signal.bw')) - assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX.xls')) + assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX_peak.xls')) peak_file = test_output_path + 'ENCLB568IYX.narrowPeak' - assert utils.count_lines(peak_file) == 112652 + assert utils.count_lines(peak_file) == 113821 diff --git a/workflow/tests/test_map_qc.py b/workflow/tests/test_map_qc.py index 5ae8218..1c0d23e 100644 --- a/workflow/tests/test_map_qc.py +++ b/workflow/tests/test_map_qc.py @@ -31,8 +31,8 @@ def test_map_qc_pairedend(): assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX.dedup.qc')) filtered_reads_report = test_output_path + 'ENCLB568IYX.dedup.flagstat.qc' samtools_report = open(filtered_reads_report).readlines() - assert '47389080 + 0 in total' in samtools_report[0] - assert '47389080 + 0 mapped (100.00%:N/A)' in samtools_report[4] + assert '47388510 + 0 in total' in samtools_report[0] + assert '47388510 + 0 mapped (100.00%:N/A)' in samtools_report[4] library_complexity = test_output_path + 'ENCLB568IYX.pbc.qc' df_library_complexity = pd.read_csv(library_complexity, sep='\t') assert df_library_complexity["NRF"].iloc[0] == 0.947064 diff --git a/workflow/tests/test_overlap_peaks.py b/workflow/tests/test_overlap_peaks.py index 99d43b8..63d4752 100644 --- a/workflow/tests/test_overlap_peaks.py +++ b/workflow/tests/test_overlap_peaks.py @@ -37,11 +37,11 @@ def test_check_update_design(design_diff): def test_overlap_peaks_singleend(): assert os.path.exists(os.path.join(test_output_path, 'ENCSR238SGC.rejected.narrowPeak')) peak_file = test_output_path + 'ENCSR238SGC.replicated.narrowPeak' - assert utils.count_lines(peak_file) == 152848 + assert utils.count_lines(peak_file) == 149828 @pytest.mark.pairedend def test_overlap_peaks_pairedend(): assert os.path.exists(os.path.join(test_output_path, 'ENCSR729LGA.rejected.narrowPeak')) peak_file = test_output_path + 'ENCSR729LGA.replicated.narrowPeak' - assert utils.count_lines(peak_file) == 25655 + assert utils.count_lines(peak_file) == 25847 diff --git a/workflow/tests/test_trim_reads.py b/workflow/tests/test_trim_reads.py index 680f237..dd3f779 100644 --- a/workflow/tests/test_trim_reads.py +++ b/workflow/tests/test_trim_reads.py @@ -13,7 +13,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ @pytest.mark.singleend def test_trim_reads_singleend(): raw_fastq = test_data_path + 'ENCFF833BLU.fastq.gz' - trimmed_fastq = test_output_path + 'ENCLB144FDT_R1.fq.gz' + trimmed_fastq = test_output_path + 'ENCLB144FDT_R1_trimmed.fq.gz' trimmed_fastq_report = test_output_path + \ 'ENCLB144FDT_R1_trimmed.fq.gz_trimming_report.txt' assert os.path.getsize(raw_fastq) != os.path.getsize(trimmed_fastq) @@ -24,9 +24,9 @@ def test_trim_reads_singleend(): @pytest.mark.pairedend def test_trim_reads_pairedend(): raw_fastq = test_data_path + 'ENCFF582IOZ.fastq.gz' - trimmed_fastq = test_output_path + 'ENCLB637LZP_R2.fq.gz' + trimmed_fastq = test_output_path + 'ENCLB637LZP_R2_val_2.fq.gz' trimmed_fastq_report = test_output_path + \ - 'ENCLB637LZP_R2_val_2.fq.gz_trimming_report.txt' + 'ENCLB637LZP_R2.fastq.gz_trimming_report.txt' assert os.path.getsize(raw_fastq) != os.path.getsize(trimmed_fastq) assert os.path.getsize(trimmed_fastq) == 2229312710 assert 'Trimming mode: paired-end' in open(trimmed_fastq_report).readlines()[4] diff --git a/workflow/tests/test_xcor.py b/workflow/tests/test_xcor.py index 40548cf..c408c98 100644 --- a/workflow/tests/test_xcor.py +++ b/workflow/tests/test_xcor.py @@ -23,6 +23,6 @@ def test_cross_pairedend(): assert os.path.exists(os.path.join(test_output_path, 'ENCLB568IYX.cc.plot.pdf')) qc_file = os.path.join(test_output_path,"ENCLB568IYX.cc.qc") df_xcor = pd.read_csv(qc_file, sep="\t", header=None) - assert df_xcor[2].iloc[0] == '210,220,475' - assert round(df_xcor[8].iloc[0],6) == 1.062032 - assert df_xcor[9].iloc[0] == 3.737722 + assert df_xcor[2].iloc[0] == '220,430,475' + assert round(df_xcor[8].iloc[0],6) == 1.060018 + assert df_xcor[9].iloc[0] == 4.099357 -- GitLab