Question: How to extract and save the header of .bam,vcf and idat files in a text file
0
gravatar for nsonkole
9 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 • 346 views
ADD COMMENTlink modified 9 months ago by ATpoint11k • written 9 months ago by nsonkole0
0
gravatar for ATpoint
9 months ago by
ATpoint11k
Germany
ATpoint11k 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 9 months ago • written 9 months ago by ATpoint11k
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: 1185 users visited in the last hour