Created
January 7, 2015 14:52
-
-
Save pontikos/20da3519f79523c2cdcb to your computer and use it in GitHub Desktop.
Takes vcf file and writes to vcf.gz OR takes gz filename as arguments and reads from stdin.
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 characters
| #!/bin/bash | |
| f=$1 | |
| extension=${f##*.} | |
| if [[ "$extension" == 'vcf' ]] | |
| then | |
| in=$f | |
| out=${in}.gz | |
| bgzip $in > $out | |
| tabix -f -p vcf $out | |
| elif [[ "$extension" == 'gz' ]] | |
| then | |
| out=$f | |
| #read from standard input | |
| bgzip > $out | |
| tabix -f -p vcf $out | |
| fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment