-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fixed bwa_index input/output. bwa_mem can accept ref.fasta.bwt or ref…
….fasta as input. interleave_index_filter now accepts stdin correctly. paired_to_interleave removed unused forward/revese options. created simple map_pipe to simulate mapping pipeline using many of our tools to show usage as well as do integration testing
- Loading branch information
1 parent
4d9246a
commit 29daf30
Showing
11 changed files
with
163 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
#!/usr/bin/env jip | ||
# | ||
# Simple pipeline to run cutadapt, bwa index, bwa mem, samtools view | ||
# | ||
# Usage: | ||
# simplepipe <input>... -r <reference> [--trimn] [--trimlq <trimlq>...] [--removebases <removebases>] [--indexqual <indexqual> --indexes <indexes>...] [-o <output>] [--interleave] | ||
# | ||
# Options: | ||
# -r, --reference=<reference> Reference file to index and map to | ||
# --trimn Flag to indicate trimming of all N's from reads | ||
# --trimlq=<trimlq>... The quality cutoff for the read trimming | ||
# [Default: 25,25] | ||
# --removebases=<removebases> Number of bases to remove from ends of reads | ||
# See trim_reads --help for more details of -x | ||
# option | ||
# --indexqual=<indexqual> The quality of the supplied read index files | ||
# --indexes=<indexes> Index fastq files for fastq files | ||
# [Default: None] | ||
# -o, --output=<output> The output bam file | ||
# [Default: mapped.bam] | ||
# Help: | ||
# <input> Input can be multiple fastq/sff files | ||
|
||
#%begin validate | ||
if options['indexqual'] and len(options['indexes'].value) != 2: | ||
validation_error("You must supply 2 index files when using --indexqual") | ||
#%end | ||
|
||
#%begin pipeline | ||
# Convert format if needed | ||
_inputs = [] | ||
for fq in options['input'].value: | ||
if fq.endswith('.sff'): | ||
outpath = basename(fq) + '.fastq' | ||
_x = run('convert_format', input=fq, output=outpath) | ||
_inputs.append(outpath) | ||
else: | ||
_inputs.append(fq) | ||
|
||
if len(_inputs) > 1: | ||
output = run('paired_to_interleave', input=_inputs) | ||
else: | ||
output = _inputs[0] | ||
|
||
# Run index qual filter | ||
if options['indexqual']: | ||
output = run( | ||
'interleaved_index_filter', | ||
input=output, | ||
index1=options['indexes'].value[0], | ||
index2=options['indexes'].value[1], | ||
minimum=options['indexqual'] | ||
) | ||
|
||
# Run general trimming | ||
if options['trimn'] or options['trimlq'] or options['removebases']: | ||
output = run( | ||
'trim_reads', | ||
input=output, | ||
trim_n=options['trimn'], | ||
qualcutoff=options['trimlq'], | ||
removebases=options['removebases'] | ||
) | ||
|
||
# Map fastq to reference | ||
refindex = run('bwa_index', input=options['reference']) | ||
output = run( | ||
'bwa_mem', | ||
input=output, | ||
interleaved=True, | ||
reference=refindex | ||
) | ||
|
||
bash('cat', input=output) | ||
|
||
#trimmed = run('cutadapt', input=fastq, qualcutoff=options['qualcutoff'], interleave=options['interleave']) | ||
#index_ref = run('bwa_index', reference=options['reference']) | ||
#sam = run('bwa_mem', reference=reference, fastq=trimmed) | ||
#ubam = run('sam_to_bam', input=sam) | ||
#bam = run('sort_bam', input=ubam, output=options['output']) | ||
#run('plot_bam', input=bam, output=options['output']+'.svg', format='svg') | ||
|
||
#index_ref >> sam | ||
|
||
#%end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/usr/bin/env bash | ||
|
||
export JIP_PATH=$PWD/jip_modules | ||
|
||
# Super simple test to make sure pieces all work nicely together | ||
tests/jip_modules/map_pipe.jip tests/testinput/f1.fastq tests/testinput/f1.fastq -r tests/testinput/ref.fasta --indexqual 21 --indexes tests/testinput/f1.index.fastq tests/testinput/f2.index.fastq --removebases 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@read1 | ||
ATGC | ||
+ | ||
IIII | ||
@read2 | ||
ATGC | ||
+ | ||
IIII | ||
@read3 | ||
ATGC | ||
+ | ||
II5I | ||
@read4 | ||
ATGC | ||
+ | ||
II5I |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@read1 | ||
ATGC | ||
+ | ||
IIII | ||
@read2 | ||
ATGC | ||
+ | ||
II5I | ||
@read3 | ||
ATGC | ||
+ | ||
IIII | ||
@read4 | ||
ATGC | ||
+ | ||
II5I |