Skip to content

Instantly share code, notes, and snippets.

@drio
Created May 18, 2010 16:32
Show Gist options
  • Save drio/405196 to your computer and use it in GitHub Desktop.
Save drio/405196 to your computer and use it in GitHub Desktop.
bfast script
$ cat run_bfast.sh
#!/bin/bash
#
set -e
#set -x
dist=`pwd`
#fq="$dist/reads/ecoli.reads.fastq"
fq="$dist/reads/reads.problem_zlib.fastq"
ref_h="/stornext/snfs4/next-gen/solid/bf.references/h/hsap.36.1.hg18/hsap_36.1_hg18.fa"
ref_e="$dist/bfast.indexes/ecoli/ecoli.drio.test.fa"
ref_e_s="$dist/bfast.indexes/one.ecoli/ecoli.drio.test.fa"
ref=$ref_e
echo "Total #reads: `wc -l $fq`"
# bfast-0.6.3c
bbin="../bf.versions/bfast-0.6.3c/bfast/bfast"
seed="bfast-0.6.3c"
o_dir=output.$seed
mkdir $o_dir
cd $o_dir
time $bbin match -A1 -t -n 8 -f $ref -r $fq > $seed.bmf 2> match.$seed.log
time $bbin localalign -A1 -t -f $ref -n 8 -m $seed.bmf > $seed.baf 2> localalign.$seed.log
time $bbin postprocess -f $ref -i $seed.baf -a 3 -O 3 > $seed.sam 2> post.$seed.log
ls -lach *
echo "wc sam: `wc -l $seed.bam`"
cd ..
echo "Done."
# bfast-0.6.4c
bbin="../bf.versions/bfast-0.6.4d/bfast/bfast"
seed="bfast-0.6.4d"
o_dir=output.$seed
mkdir $o_dir
cd $o_dir
time $bbin match -A1 -t -n 8 -f $ref -r $fq > $seed.bmf 2> match.$seed.log
time $bbin localalign -A1 -t -f $ref -n 8 -m $seed.bmf > $seed.baf 2> localalign.$seed.log
# That's the only difference
time $bbin postprocess -f $ref -i $seed.baf -a 3 -O 1 > $seed.sam 2> post.$seed.log
ls -lach *
echo "wc sam: `wc -l $seed.bam`"
echo "Done."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment