Created
August 13, 2020 18:10
-
-
Save wbgalvao/969eb980ebc3ee30bf95387b4d0871b9 to your computer and use it in GitHub Desktop.
Given a multianno file (annovar's output) fix its header by adding the vcf columns (CHROM, POS, ID, REF, ALT, QUAL, FILTER, INFO, FORMAT and SAMPLE)
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 | |
multianno=${1} | |
header=$(head -1 ${multianno}) | |
fixedHeader=$(echo "${header}" \ | |
| sed 's/Otherinfo/VCF_CHROM/' \ | |
| awk '{print $0"\tVCF_POS\tVCF_ID\tVCF_REF\tVCF_ALT\tVCF_QUAL\tVCF_FILTER\tVCF_INFO\tVCF_FORMAT\tVCF_SAMPLE"}' \ | |
) | |
sed -i '1 s,'"${header}"','"${fixedHeader}"',' ${multianno} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment