How to extract and save the header of .bam,vcf and idat files in a text file
2
0
Entering edit mode
6.1 years ago
nsonkole • 0

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!

bam ida vcf extract header • 4.1k views
ADD COMMENT
1
Entering edit mode
6.1 years ago
ATpoint 82k
## 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 COMMENT
0
Entering edit mode
4.3 years ago

You can use my bcftools plugin gtc2vcf as follows:

bcftools +gtc2vcf --idat file.idat

There is header information both at the beginning and the end of an IDAT file though

ADD COMMENT

Login before adding your answer.

Traffic: 1769 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6