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

Fix passing of bedpe reads.

parent 938c75fd
1 merge request!10Resolve "Make tagAlign files"
Pipeline #1100 failed with stage
in 1 hour, 8 minutes, and 6 seconds
...@@ -203,7 +203,7 @@ process convertReads { ...@@ -203,7 +203,7 @@ process convertReads {
output: output:
set sampleId, file('*.tagAlign.gz'), file('*.bedpe.gz'), biosample, factor, treatment, replicate, controlId into tagReads set sampleId, file('*.tagAlign.gz'), file('*.bed{pe,se}.gz'), biosample, factor, treatment, replicate, controlId into tagReads
script: script:
......
...@@ -64,10 +64,9 @@ def check_tools(): ...@@ -64,10 +64,9 @@ def check_tools():
raise Exception('Missing samtools') raise Exception('Missing samtools')
def convert_mapped(bam, bam_basename): def convert_mapped(bam, tag_filename):
'''Use bedtools to convert to tagAlign.''' '''Use bedtools to convert to tagAlign.'''
tag_filename = bam_basename + '.tagAlign.gz'
out, err = utils.run_pipe([ out, err = utils.run_pipe([
"bamToBed -i %s" % (bam), "bamToBed -i %s" % (bam),
r"""awk 'BEGIN{OFS="\t"}{$4="N";$5="1000";print $0}'""", r"""awk 'BEGIN{OFS="\t"}{$4="N";$5="1000";print $0}'""",
...@@ -110,10 +109,14 @@ def main(): ...@@ -110,10 +109,14 @@ def main():
bam_basename = os.path.basename( bam_basename = os.path.basename(
utils.strip_extensions(bam, ['.bam'])) utils.strip_extensions(bam, ['.bam']))
convert_mapped(bam, bam_basename) tag_filename = bam_basename + 'tagAlign.gz'
convert_mapped(bam, tag_filename)
if paired: # paired-end data if paired: # paired-end data
convert_mapped_pe(bam, bam_basename) convert_mapped_pe(bam, bam_basename)
else:
bedse_filename = bam_basename + ".bedse.gz"
shutil(tag_filename, bedse_filename)
if __name__ == '__main__': if __name__ == '__main__':
......
...@@ -9,6 +9,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \ ...@@ -9,6 +9,7 @@ test_output_path = os.path.dirname(os.path.abspath(__file__)) + \
def test_convert_reads_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.tagAlign.gz'))
assert os.path.exists(os.path.join(test_output_path, 'ENCFF646LXU.bedse.gz'))
def test_map_qc_pairedend(): def test_map_qc_pairedend():
......
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