Mercurial > repos > biomonika > linkyx
annotate scripts/createBamFromResults.sh @ 0:1955f03f092e
initial commit
| author | biomonika <biomonika@psu.edu> |
|---|---|
| date | Tue, 02 Sep 2014 14:16:04 -0400 |
| parents | |
| children |
| rev | line source |
|---|---|
| 0 | 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; |
