Mercurial > repos > plus91-technologies-pvt-ltd > softsearch
comparison 2.4/script/Subset_targets.sh @ 18:1163c16cb3c0 draft
Uploaded
author | plus91-technologies-pvt-ltd |
---|---|
date | Mon, 02 Jun 2014 07:35:53 -0400 |
parents | e3609c8714fb |
children |
comparison
equal
deleted
inserted
replaced
17:5343ef57827f | 18:1163c16cb3c0 |
---|---|
1 #!/bin/sh | |
2 #$ -V | |
3 #$ -cwd | |
4 #$ -q 1-day | |
5 #$ -m ae | |
6 #$ -M hart.steven@mayo.edu | |
7 #$ -l h_vmem=1G | |
8 #$ -l h_stack=10M | |
9 BAM=$1 | |
10 TARGET_BED=$2 | |
11 SAMPLE_NUMBER=$3 | |
12 | |
13 #cat $HEADER > out.${SAMPLE_NUMBER}.sam | |
14 samtools view -L $TARGET_BED $BAM| | |
15 perl -ane ' | |
16 next if ($F[10]=~/#/); | |
17 $minSize=1000; | |
18 if( $F[1] & 8 || $F[1] & 4 || $F[8] == 0 || abs($F[8]) > $minSize || $F[5] =~/S/){ | |
19 $rName=join("","@",@F[0]); | |
20 print join ("\n",$rName,$F[9],"+",@F[10])."\n"; | |
21 }; | |
22 ' >> out.${SAMPLE_NUMBER}.fq | |
23 echo "Done with $BAM `date`" |