Mercurial > repos > biomonika > linkyx
comparison scripts/createBamFromResults.sh @ 0:05c27700e5ca
initial commit
author | biomonika <biomonika@psu.edu> |
---|---|
date | Thu, 04 Sep 2014 18:24:19 -0400 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:05c27700e5ca |
---|---|
1 #!/bin/bash | |
2 set -e; | |
3 #example usage: ./createBamFromResults list_of_sequences bam_file outfile reference | |
4 #creates small bam files containg only sex-linked genes and their corresponding reads | |
5 | |
6 list_of_sequences=$1; | |
7 bam_file=$2; | |
8 outfile=$3; | |
9 reference=$4 | |
10 | |
11 samtools view -h -o out.sam $bam_file; | |
12 grep -f $list_of_sequences out.sam >igv; | |
13 cat igv | sort -r >$outfile; | |
14 samtools view -bS $outfile | samtools sort - ${outfile%????}; | |
15 | |
16 rm -f igv out.sam; |