This is a test version of Biostars. For the public version, visit https://www.biostars.org.
how to make a header name in a haplotyping script of gatk?

Hi, I want to ask how we can make the header name as per our choice in a haplotyping script of gatk because by default the header name of the output.vcf file is mentioned as sample1? here is the script

gatk --java-options "-Xmx32g" HaplotypeCaller --native-pair-hmm-threads 20 -R ~/path//PitayaGenomic.fa -I ${inputbam_files} -O ${output}.g.vcf -ERC GVCF
headername gatk haplotypecalling

I don't understand.

the header name

the header name of what ?

because by default the header name of the output.vcf file is mentioned as sample1

what is sample1 ?

as you can see here the sample1 is the header name (this is the output.vcf file after haplotypecalling). For example I want to change it to the name American-beauty. Like multiple files with their header name same as the file name

#CHROM  POS ID  REF ALT QUAL    FILTER  INFO    FORMAT  sample1
chr01   1   .   G   <NON_REF>   .   .   END=41  GT:DP:GQ:MIN_DP:PL  0/0:0:0:0:0,0,0
chr01   42  .   C   <NON_REF>   .   .   END=69  GT:DP:GQ:MIN_DP:PL  0/0:1:3:1:0,3,15
chr01   70  .   C   <NON_REF>   .   .   END=599 GT:DP:GQ:MIN_DP:PL  0/0:0:0:0:0,0,0
chr01   600 .   C   <NON_REF>   .   .   END=612 GT:DP:GQ:MIN_DP:PL  0/0:2:3:2:0,3,45
chr01   613 .   A   <NON_REF>   .   .   END=613 GT:DP:GQ:MIN_DP:PL  0/0:2:0:2:0,0,0
chr01   614 .   C   <NON_REF>   .   .   END=619 GT:DP:GQ:MIN_DP:PL  0/0:2:3:2:0,3,45

I have changed the header name following the suggestion of Ram. But my concern now is to change the name before haplotypecalling.

1 answer

"Sample1" should have been specified from the very start when mapping the reads to a reference genome using read groups. https://gatk.broadinstitute.org/hc/en-us/articles/360035890671-Read-groups

you can change sample1 to another thing use gatk RenameSampleInVcf https://gatk.broadinstitute.org/hc/en-us/articles/360040510011-RenameSampleInVcf-Picard- or bcftools reheader

Log in to answer this question.