Skip to content

Instantly share code, notes, and snippets.

@jayrbolton
Created March 25, 2019 17:20
Show Gist options
  • Save jayrbolton/61dbb9ea668ec213c2e0b96fb05e14e9 to your computer and use it in GitHub Desktop.
Save jayrbolton/61dbb9ea668ec213c2e0b96fb05e14e9 to your computer and use it in GitHub Desktop.
jgi qc pipeline for shifter
workflow jgi_read_qc
{
File raw_fastq
Array[String] sketch_dbs = [ "nt", "refseq", "silva" ]
call subsample
{
input:
infile=raw_fastq
}
call mer_sampling
{
input:
infile=raw_fastq
}
call dedupe
{
input:
infile=subsample.outfile
}
scatter( db in sketch_dbs )
{
call sketch as a_sketch
{
input:
infile=raw_fastq,
db=db
}
}
}
task subsample
{
File infile
command
{
ln -s ${infile} .; \
INFILE=`basename ${infile}`; \
shifter \
--image=bryce911/bbtools -- \
/bbmap/reformat.sh \
in=$INFILE \
out=subsample.fastq.gz \
bhist=bhist.txt \
gchist=gchist.txt \
bqhist=bqhist.txt \
obqhist=obqhist.txt \
samplerate=0.1 qin=33 qout=33 ow=t gcplot=t gcbins=auto
}
output
{
File outfile="subsample.fastq.gz"
File bhist="bhist.txt"
File gchist="gchist.txt"
File bqhist="bqhist.txt"
File obqhist="obqhist.txt"
}
}
task mer_sampling
{
File infile
command
{
ln -s ${infile} .; \
INFILE=`basename ${infile}`; \
shifter \
--image=bryce911/bbtools -- \
/bbmap/bbcountunique.sh \
in=$INFILE \
out=merSampler.m25.e25000_2 \
k=25 interval=25000 percent=t count=t cumulative=f ow=t
}
output
{
File outfile="merSampler.m25.e25000_2"
}
}
task dedupe
{
File infile
command
{
ln -s ${infile} .; \
INFILE=`basename ${infile}`; \
shifter \
--image=bryce911/bbtools -- \
/bbmap/dedupe.sh -Xmx23G \
in=$INFILE out=null \
qin=33 ow=t s=0 ftr=49 ac=f showspeed=f; \
cp stderr subsample.bwa.summary
}
output
{
File outfile = "subsample.bwa.summary"
}
}
task sketch
{
File infile
String db
command
{
ln -s ${infile} .; \
INFILE=`basename ${infile}`; \
shifter \
--image=bryce911/bbtools -- \
/bbmap/sendsketch.sh \
in=$INFILE \
out=sketch_vs_${db}.txt \
ow=t colors=f printtaxa=t depth depth2 unique2 merge ${db}
}
output
{
File outfile = "sketch_vs_${db}.txt"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment