Mercurial > repos > plus91-technologies-pvt-ltd > softsearch
diff 2.4/script/Subset_targets.sh @ 16:8eb7d93f7e58 draft
Uploaded
author | plus91-technologies-pvt-ltd |
---|---|
date | Sat, 31 May 2014 11:23:36 -0400 |
parents | e3609c8714fb |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/2.4/script/Subset_targets.sh Sat May 31 11:23:36 2014 -0400 @@ -0,0 +1,23 @@ +#!/bin/sh +#$ -V +#$ -cwd +#$ -q 1-day +#$ -m ae +#$ -M hart.steven@mayo.edu +#$ -l h_vmem=1G +#$ -l h_stack=10M +BAM=$1 +TARGET_BED=$2 +SAMPLE_NUMBER=$3 + +#cat $HEADER > out.${SAMPLE_NUMBER}.sam +samtools view -L $TARGET_BED $BAM| + perl -ane ' + next if ($F[10]=~/#/); + $minSize=1000; + if( $F[1] & 8 || $F[1] & 4 || $F[8] == 0 || abs($F[8]) > $minSize || $F[5] =~/S/){ + $rName=join("","@",@F[0]); + print join ("\n",$rName,$F[9],"+",@F[10])."\n"; +}; + ' >> out.${SAMPLE_NUMBER}.fq +echo "Done with $BAM `date`"