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

Update tests and output file names.

parent 4aa91a5c
Branches
Tags
1 merge request!20Resolve "Use SampleIds/ Experiment Id as file names throughtout pipeline"
Pipeline #2828 failed with stages
in 1 hour, 48 minutes, and 6 seconds
......@@ -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)
......
......@@ -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 = [
......
......@@ -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])
......
......@@ -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
......
......@@ -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]
......@@ -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
......
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