From 2b651306c155f22afa8d80842f319d601fe6c905 Mon Sep 17 00:00:00 2001 From: Venkat Malladi <venkat.malladi@utsouthwestern.edu> Date: Mon, 14 Jan 2019 07:41:54 -0600 Subject: [PATCH] Update tests and output file names. --- workflow/scripts/call_peaks_macs.py | 2 +- workflow/scripts/map_reads.py | 4 ++-- workflow/scripts/trim_reads.py | 6 +++--- workflow/tests/test_convert_reads.py | 4 ++-- workflow/tests/test_trim_reads.py | 8 ++++---- workflow/tests/test_xcor.py | 4 ++-- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/workflow/scripts/call_peaks_macs.py b/workflow/scripts/call_peaks_macs.py index 69a5968..99e2900 100644 --- a/workflow/scripts/call_peaks_macs.py +++ b/workflow/scripts/call_peaks_macs.py @@ -126,7 +126,7 @@ def call_peaks_macs(experiment, xcor, control, prefix, genome_size, chrom_sizes) # Remove coordinates outside chromosome sizes int_narrowpeak_fn = '%s_peaks.narrowPeak' % (prefix) - narrowpeak_fn = '%s_peaks.narrowPeak' % (prefix) + narrowpeak_fn = '%s.narrowPeak' % (prefix) clipped_narrowpeak_fn = 'clipped-%s' % (narrowpeak_fn) diff --git a/workflow/scripts/map_reads.py b/workflow/scripts/map_reads.py index 3c20ac8..a1f8161 100644 --- a/workflow/scripts/map_reads.py +++ b/workflow/scripts/map_reads.py @@ -104,7 +104,7 @@ def generate_sa(fastq, reference): def align_se(fastq, sai, reference, fastq_basename): '''Use BWA to align SE data.''' - bam_filename = '%s.srt.bam' % (fastq_basename) + bam_filename = '%s.bam' % (fastq_basename) steps = [ "bwa samse %s %s %s" @@ -125,7 +125,7 @@ def align_pe(fastq, sai, reference, fastq_basename): sam_filename = "%s.sam" % (fastq_basename) badcigar_filename = "%s.badReads" % (fastq_basename) - bam_filename = '%s.srt.bam' % (fastq_basename) + bam_filename = '%s.bam' % (fastq_basename) # Remove read pairs with bad CIGAR strings and sort by position steps = [ diff --git a/workflow/scripts/trim_reads.py b/workflow/scripts/trim_reads.py index e31ec93..bf5f901 100644 --- a/workflow/scripts/trim_reads.py +++ b/workflow/scripts/trim_reads.py @@ -76,15 +76,15 @@ def rename_reads(fastq, sample, paired): if paired: # paired-end data # Set file names - renamed_fastq.append(cwd + '/' + sample + '_R1.fastq.gz') - renamed_fastq.append(cwd + '/' + sample + '_R2.fastq.gz') + renamed_fastq.append(cwd + '/' + sample + '_R1.fq.gz') + renamed_fastq.append(cwd + '/' + sample + '_R2.fq.gz') # Great symbolic links os.symlink(fastq[0], renamed_fastq[0]) os.symlink(fastq[1], renamed_fastq[1]) else: # Set file names - renamed_fastq.append(cwd + '/' + sample + '_R1.fastq.gz') + renamed_fastq.append(cwd + '/' + sample + '_R1.fq.gz') # Great symbolic links os.symlink(fastq[0], renamed_fastq[0]) diff --git a/workflow/tests/test_convert_reads.py b/workflow/tests/test_convert_reads.py index 753b54b..d1ef045 100644 --- a/workflow/tests/test_convert_reads.py +++ b/workflow/tests/test_convert_reads.py @@ -9,8 +9,8 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ @pytest.mark.singleend def test_convert_reads_singleend(): - assert os.path.exists(os.path.join(test_output_path, 'ENCFF646LXU.tagAlign.gz')) - assert os.path.exists(os.path.join(test_output_path, 'ENCFF646LXU.bedse.gz')) + assert os.path.exists(os.path.join(test_output_path, 'ENCLB831RUI.tagAlign.gz')) + assert os.path.exists(os.path.join(test_output_path, 'ENCLB831RUI.bedse.gz')) @pytest.mark.pairedend diff --git a/workflow/tests/test_trim_reads.py b/workflow/tests/test_trim_reads.py index aeb3eb3..5220f18 100644 --- a/workflow/tests/test_trim_reads.py +++ b/workflow/tests/test_trim_reads.py @@ -13,9 +13,9 @@ 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_trimmed.fq.gz' + trimmed_fastq = test_output_path + 'ENCLB144FDT_R1_trimmed.fq.gz' trimmed_fastq_report = test_output_path + \ - 'ENCLB144FDT.fastq.gz_trimming_report.txt' + 'ENCLB144FDT_R1_trimmed.fq.gz_trimming_report.txt' assert os.path.getsize(raw_fastq) != os.path.getsize(trimmed_fastq) assert os.path.getsize(trimmed_fastq) == 2512853101 assert 'Trimming mode: single-end' in open(trimmed_fastq_report).readlines()[4] @@ -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 + 'ENCFF582IOZ_val_2.fq.gz' + trimmed_fastq = test_output_path + 'ENCLB637LZP_R2_trimmed.fq.gz' trimmed_fastq_report = test_output_path + \ - 'ENCLB637LZP.fastq.gz_trimming_report.txt' + 'ENCLB637LZP_R2_trimmed.fq.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 69006a0..40548cf 100644 --- a/workflow/tests/test_xcor.py +++ b/workflow/tests/test_xcor.py @@ -10,8 +10,8 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ @pytest.mark.singleend def test_cross_singleend(): - assert os.path.exists(os.path.join(test_output_path, 'ENCFF833BLU.cc.plot.pdf')) - qc_file = os.path.join(test_output_path,"ENCFF833BLU.cc.qc") + assert os.path.exists(os.path.join(test_output_path, 'ENCLB144FDT.cc.plot.pdf')) + qc_file = os.path.join(test_output_path,"ENCLB144FDT.cc.qc") df_xcor = pd.read_csv(qc_file, sep="\t", header=None) assert df_xcor[2].iloc[0] == '190,200,210' assert df_xcor[8].iloc[0] == 1.025906 -- GitLab