Question: How to extract and save the header of .bam,vcf and idat files in a text file
0
Entering edit mode

Can someone help with how to extract the header data (metainfo) from these three files: .bam, vcf and idat files.

I want to be able to extract these medatadata info and save each in a text file. I hope someone can help me with the how to.

Thanks!

ADD COMMENTlink 23 months ago nsonkole • 0 • updated 23 months ago ATpoint 17k
0
Entering edit mode
## BAM:
samtools view -H file.bam > header_BAM.txt

## VCF:
awk '{if(/^#/)print;else exit}' file.vcf > header_VCF.txt

For idat I don't know.

ADD COMMENTlink 23 months ago ATpoint 17k

Login before adding your answer.

Powered by the version 1.8