Skip to content

Instantly share code, notes, and snippets.

@wbgalvao
Created August 13, 2020 18:10
Show Gist options
  • Save wbgalvao/969eb980ebc3ee30bf95387b4d0871b9 to your computer and use it in GitHub Desktop.
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)
#!/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