Skip to content
Snippets Groups Projects
Commit 89340f9c authored by Venkat Malladi's avatar Venkat Malladi
Browse files

Modify tests.

parent 21aac926
Branches
Tags
1 merge request!20Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
......@@ -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
......@@ -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
......@@ -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
......
......@@ -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
......@@ -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]
......@@ -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
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment