-
-
Save ipstone/4e35ddf39c231681b2a188d73107e71d to your computer and use it in GitHub Desktop.
Revisions
-
mtw created this gist
Oct 26, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ #!/bin/bash samtools=`which samtools` bn=$(basename $1 .bam) echo processing $bn $samtools view -h -b -f99 $1 > $bn.flag99.bam $samtools view -h -b -f147 $1 > $bn.flag147.bam $samtools view -h -b -f163 $1 > $bn.flag163.bam $samtools view -h -b -f83 $1 > $bn.flag83.bam echo merging tmp BAM files $samtools merge $bn.uns.pp.bam $bn.flag99.bam $bn.flag147.bam $bn.flag163.bam $bn.flag83.bam echo sorting final BAM file $samtools sort $bn.uns.pp.bam $bn.pp echo cleaning up rm $bn.flag99.bam rm $bn.flag147.bam rm $bn.flag163.bam rm $bn.flag83.bam rm $bn.uns.pp.bam