Skip to content

Instantly share code, notes, and snippets.

@mtw
Last active January 3, 2016 23:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mtw/8537962 to your computer and use it in GitHub Desktop.
Save mtw/8537962 to your computer and use it in GitHub Desktop.
Simple wrapper script for cufflinks
#!/bin/bash
bamdir="./"
cufflinks=`which cufflinks`
annotation="foo.gtf"
threads=40
label_RABT="CUFFRABT"
label_denovo="CUFFDENOVO"
for BAM in $(ls $bamdir/*.bam)
do
bn=$(basename $BAM .complete.cuff.bam)
echo "processing" $bn
outdir_no_assembly="cuffout_${bn}_no_assembly"
if ! [ -d ${outdir_no_assembly} ];
then
mkdir -p ${outdir_no_assembly}
fi
outdir_RABT="cuffout_${bn}_RABT"
if ! [ -d ${outdir_RABT} ];
then
mkdir -p ${outdir_RABT}
fi
outdir_denovo_assembly="cuffout_${bn}_denovo_assembly"
if ! [ -d ${outdir_denovo_assembly} ];
then
mkdir -p ${outdir_denovo_assembly}
fi
set -x
## run cufflinks based on supplied reference annotation; no novel transcript assembly
$cufflinks -p $threads -o ${outdir_no_assembly} -G $annotation $BAM 2>${outdir_no_assembly}/${bn}.cuff.err > ${outdir_no_assembly}/${bn}.cuff.out
## run cufflinks based on supplied reference annotation to guide RABT assembly
$cufflinks -p $threads -o ${outdir_RABT} -g $annotation -L ${label_RABT} $BAM 2>${outdir_RABT}/${bn}.cuff.err > ${outdir_RABT}/${bn}.cuff.out
## run cufflinks de-novo transcript assembly
$cufflinks -q -p $threads -o ${outdir_denovo_assembly} -L ${label_denovo} $BAM 2>${outdir_denovo_assembly}/${bn}.cuff.err > ${outdir_denovo_assembly}/${bn}.cuff.out
set +x
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment