Question: How to extract and save the header of .bam,vcf and idat files in a text file
0
gravatar for nsonkole
6 months ago by
nsonkole0
nsonkole0 wrote:

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!

header extract bam ida vcf • 267 views
ADD COMMENTlink modified 6 months ago by ATpoint7.4k • written 6 months ago by nsonkole0
0
gravatar for ATpoint
6 months ago by
ATpoint7.4k
Germany
ATpoint7.4k wrote:
## 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 modified 6 months ago • written 6 months ago by ATpoint7.4k
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 963 users visited in the last hour