Skip to content

Commit

Permalink
adding fastq_pair
Browse files Browse the repository at this point in the history
  • Loading branch information
antgonza committed Oct 2, 2024
1 parent a2df57d commit a8a8aba
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
11 changes: 9 additions & 2 deletions qp_woltka/tests/test_woltka.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def test_woltka_syndna_to_array(self):
f'#SBATCH --error {out_dir}/{job_id}_%a.err\n',
'#SBATCH --array 1-1%8\n',
f'cd {out_dir}\n',
'mkdir -p reads sams\n',
'mkdir -p reads/uneven sams\n',
f'{self.environment}\n',
'date\n',
'hostname\n',
Expand All @@ -470,7 +470,8 @@ def test_woltka_syndna_to_array(self):
f' bowtie2 -p 8 -x {database} -q '
'${f} -S $PWD/sams/${sn}.sam --seed 42 --very-sensitive -k 16 '
'--np 1 --mp "1,1" --rdg "0,1" --rfg "0,1" --score-min '
'"L,0,-0.05" --no-head --no-unal --un $PWD/reads/${fn/.gz/}\n',
'"L,0,-0.05" --no-head --no-unal --un '
'$PWD/reads/uneven/${fn/.gz/}\n',
' done < sample_details_${SLURM_ARRAY_TASK_ID}.txt\n',
'date']
self.assertEqual(main, exp_main)
Expand All @@ -495,6 +496,12 @@ def test_woltka_syndna_to_array(self):
'sjobs=`ls sams/*.sam | wc -l`\n',
'if [[ $sruns -eq $sjobs ]]; then\n',
' mkdir -p sams/final\n',
' while read -r fwd rev; do \n'
' echo fastq_pair -t 50000000 reads/uneven/${fwd} ',
'reads/uneven/${rev}; mv reads/uneven/${fwd}.paired.fq ',
'reads/${fwd}; mv reads/uneven/${rev}.paired.fq reads/${rev};',
'gzip reads/${fwd} reads/${rev}\n done < ',
'finish_sample_details.txt | parallel -j 8\n',
' for f in `ls sams/fwd_*`;\n',
' do\n',
' fn=`basename $f`;\n',
Expand Down
12 changes: 10 additions & 2 deletions qp_woltka/woltka.py
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ def woltka_syndna_to_array(files, output, database_bowtie2, prep, url, name):
'-q ${f} -S $PWD/sams/${sn}.sam ' +\
'--seed 42 --very-sensitive -k 16 --np 1 --mp "1,1" ' + \
'--rdg "0,1" --rfg "0,1" --score-min "L,0,-0.05" ' + \
'--no-head --no-unal --un $PWD/reads/${fn/.gz/}'
'--no-head --no-unal --un $PWD/reads/uneven/${fn/.gz/}'

# all the setup pieces
lines = ['#!/bin/bash',
Expand All @@ -440,7 +440,7 @@ def woltka_syndna_to_array(files, output, database_bowtie2, prep, url, name):
f'#SBATCH --error {output}/{name}_%a.err',
f'#SBATCH --array 1-{n_files}%{MAX_RUNNING}',
f'cd {output}',
'mkdir -p reads sams',
'mkdir -p reads/uneven sams',
f'{environment}',
'date', # start time
'hostname', # executing system
Expand Down Expand Up @@ -482,6 +482,14 @@ def woltka_syndna_to_array(files, output, database_bowtie2, prep, url, name):
'sjobs=`ls sams/*.sam | wc -l`',
'if [[ $sruns -eq $sjobs ]]; then',
' mkdir -p sams/final',
' while read -r fwd rev; do ',
' echo fastq_pair -t 50000000 reads/uneven/${fwd} '
'reads/uneven/${rev}; '
'mv reads/uneven/${fwd}.paired.fq reads/${fwd};'
'mv reads/uneven/${rev}.paired.fq reads/${rev};'
'gzip reads/${fwd} reads/${rev}',
' done < finish_sample_details.txt | '
f'parallel -j {PPN}'
' for f in `ls sams/fwd_*`;',
' do',
' fn=`basename $f`;',
Expand Down

0 comments on commit a8a8aba

Please sign in to comment.