Commit 32217667 authored by Spencer Barnes's avatar Spencer Barnes
Browse files

modify pytests for full scale data

parent 2001be2d
Pipeline #7414 failed with stages
in 269 minutes and 12 seconds
#!/usr/bin/env python3
"#!/usr/bin/env python3
import pytest
import os
test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
'/../output/alignReads/'
'/../output/alignReads/'
@pytest.mark.singleend
def test_map_reads_singleend():
assert os.path.exists(os.path.join(test_output_path, '/heart1/Heart_S3_R1_001_shortened_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + '/heart1/Heart_S3_R1_001_shortened_trimmed_bismark_bt2_SE_report.txt'
assert os.path.exists(os.path.join(test_output_path, 'liver1/ENCFF000MBY_hsap_hepato_rep1_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + 'liver1/ENCFF000MBY_hsap_hepato_rep1_trimmed_bismark_bt2_SE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 1000' in samtools_report[7]
assert 'Mapping efficiency: 64.2%' in samtools_report[9]
assert "Total number of C's analysed: 10256" in samtools_report[24]
assert 'Sequences analysed in total: 30645122' in samtools_report[7]
assert 'Mapping efficiency: 42.9%' in samtools_report[9]
assert "Total number of C's analysed: 145657914" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/kidney1/Kidney_S4_R1_001_shortened_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + '/kidney1/Kidney_S4_R1_001_shortened_trimmed_bismark_bt2_SE_report.txt'
assert os.path.exists(os.path.join(test_output_path, '/liver2/ENCFF000MCD_hsap_hepato_rep2_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + '/liver2/ENCFF000MCD_hsap_hepato_rep2_trimmed_bismark_bt2_SE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 999' in samtools_report[7]
assert 'Mapping efficiency: 63.3%' in samtools_report[9]
assert "Total number of C's analysed: 10180" in samtools_report[24]
assert 'Sequences analysed in total: 36753283' in samtools_report[7]
assert 'Mapping efficiency: 35.8%' in samtools_report[9]
assert "Total number of C's analysed: 141487023" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/lung1/ENCFF000MDS_hsap_lung_rrbs_rep1_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + '/lung1/ENCFF000MDS_hsap_lung_rrbs_rep1_trimmed_bismark_bt2_SE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequences analysed in total: 41727993' in samtools_report[7]
assert 'Mapping efficiency: 15.3%' in samtools_report[9]
assert "Total number of C's analysed: 69933546" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/lung2/ENCFF000MDT_hsap__lung_rep2_trimmed_bismark_bt2.bam'))
aligned_reads_report = test_output_path + '/lung2/ENCFF000MDT_hsap__lung_rep2_trimmed_bismark_bt2_SE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequences analysed in total: 37152735' in samtools_report[7]
assert 'Mapping efficiency: 32.5%' in samtools_report[9]
assert "Total number of C's analysed: 134685946" in samtools_report[24]
@pytest.mark.pairedend
def test_map_reads_pairedend():
assert os.path.exists(os.path.join(test_output_path, '/liver1/liver_a_S4_R1_001_shortened_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/liver1/liver_a_S4_R1_001_shortened_val_1_bismark_bt2_PE_report.txt'
assert os.path.exists(os.path.join(test_output_path, '/heart1/heart_a_S2_R1_001_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/heart1/heart_a_S2_R1_001_val_1_bismark_bt2_PE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 984' in samtools_report[7]
assert 'Mapping efficiency: 53.6%' in samtools_report[9]
assert "Total number of C's analysed: 18014" in samtools_report[24]
assert 'Sequence pairs analysed in total: 18107045' in samtools_report[7]
assert 'Mapping efficiency: 57.3%' in samtools_report[9]
assert "Total number of C's analysed: 345193812" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/liver2/Liver_b_S2_R1_001_shortened_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/liver2/Liver_b_S2_R1_001_shortened_val_1_bismark_bt2_PE_report.txt'
assert os.path.exists(os.path.join(test_output_path, '/heart2/heart_b_S4_R1_001_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/heart2/heart_b_S4_R1_001_val_1_bismark_bt2_PE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 990' in samtools_report[7]
assert 'Mapping efficiency: 51.7%' in samtools_report[9]
assert "Total number of C's analysed: 16881" in samtools_report[24]
assert 'Sequence pairs analysed in total: 12016511' in samtools_report[7]
assert 'Mapping efficiency: 51.4%' in samtools_report[9]
assert "Total number of C's analysed: 200311991" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/heart1/heart_a_S2_R1_001_shortened_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/heart1/heart_a_S2_R1_001_shortened_val_1_bismark_bt2_PE_report.txt'
assert os.path.exists(os.path.join(test_output_path, '/liver1/liver_a_S4_R1_001_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/liver1/liver_a_S4_R1_001_val_1_bismark_bt2_PE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 996' in samtools_report[7]
assert 'Mapping efficiency: 56.5%' in samtools_report[9]
assert "Total number of C's analysed: 18486" in samtools_report[24]
assert 'Sequence pairs analysed in total: 16444589' in samtools_report[7]
assert 'Mapping efficiency: 55.9%' in samtools_report[9]
assert "Total number of C's analysed: 310540010" in samtools_report[24]
assert os.path.exists(os.path.join(test_output_path, '/heart2/heart_b_S4_R1_001_shortened_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/heart2/heart_b_S4_R1_001_shortened_val_1_bismark_bt2_PE_report.txt'
assert os.path.exists(os.path.join(test_output_path, '/liver2/Liver_b_S2_R1_001_val_1_bismark_bt2_pe.bam'))
aligned_reads_report = test_output_path + '/liver2/Liver_b_S2_R1_001_val_1_bismark_bt2_PE_report.txt'
samtools_report = open(aligned_reads_report).readlines()
assert 'Sequence pairs analysed in total: 979' in samtools_report[7]
assert 'Mapping efficiency: 47.9%' in samtools_report[9]
assert "Total number of C's analysed: 15321" in samtools_report[24]
assert 'Sequence pairs analysed in total: 8166172' in samtools_report[7]
assert 'Mapping efficiency: 50.0%' in samtools_report[9]
assert "Total number of C's analysed: 137359898" in samtools_report[24]
......@@ -10,8 +10,10 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
@pytest.mark.methData_se
def test_trimData_se():
assert os.path.exists(os.path.join(test_output_path, '/heart1/Heart_S3_R1_001_shortened_trimmed_bismark_bt2.bismark.cov.gz'))
assert os.path.exists(os.path.join(test_output_path, '/kidney1/Kidney_S4_R1_001_shortened_trimmed_bismark_bt2.bismark.cov.gz'))
assert os.path.exists(os.path.join(test_output_path, '/lung1/ENCFF000MDS_hsap_lung_rrbs_rep1_trimmed_bismark_bt2.bismark.cov.gz'))
assert os.path.exists(os.path.join(test_output_path, '/lung2/ENCFF000MDT_hsap__lung_rep2_trimmed_bismark_bt2.bismark.cov.gz'))
assert os.path.exists(os.path.join(test_output_path, '/liver1/ENCFF000MBY_hsap_hepato_rep1_trimmed_bismark_bt2.bismark.cov.gz'))
assert os.path.exists(os.path.join(test_output_path, '/liver2/ENCFF000MCD_hsap_hepato_rep2_trimmed_bismark_bt2.bismark.cov.gz'))
@pytest.mark.methData_pe
def test_trimData_pe():
......
......@@ -10,8 +10,10 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
@pytest.mark.trimData_se
def test_trimData_se():
assert os.path.exists(os.path.join(test_output_path, '/heart1/Heart_S3_R1_001_shortened_trimmed.fq.gz'))
assert os.path.exists(os.path.join(test_output_path, '/kidney1/Kidney_S4_R1_001_shortened_trimmed.fq.gz'))
assert os.path.exists(os.path.join(test_output_path, '/lung1/ENCFF000MDS_hsap_lung_rrbs_rep1_trimmed.fq.gz'))
assert os.path.exists(os.path.join(test_output_path, '/lung2/ENCFF000MDT_hsap__lung_rep2_trimmed.fq.gz'))
assert os.path.exists(os.path.join(test_output_path, '/liver1/ENCFF000MBY_hsap_hepato_rep1_trimmed.fq.gz'))
assert os.path.exists(os.path.join(test_output_path, '/liver2/ENCFF000MCD_hsap_hepato_rep2_trimmed.fq.gz'))
@pytest.mark.trimData_pe
def test_trimData_pe():
......
Markdown is supported
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