Hi. Recently I am running a tumor-only SNV calling pipeline and encounter a problem when running GATK GetSampleName.
In the tutorial (https://software.broadinstitute.org/gatk/documentation/tooldocs/current/org_broadinstitute_hellbender_tools_GetSampleName.php), the code is like this.
gatk GetSampleName \
-I input.bam \
-O sample_name.txt
Finally, I get an empty txt file. As the tutorial says that this tool is to emit a single sample name from the bam header into an output file. So I use samtool view -H to check the header, and the @RG should be correct (
@RG ID:4 LB:lib1 PL:illumina SM:20 PU:unit1
). So the sample name should be 20 as stated in @RG. I am not sure which part causes the problem.
1 answer
do you have any error message on the screen ? Otherwise a good old linux script should be faster than invoking java+gatk.
samtools view -H input.bam | grep ^@RG | tr "\t" "\n" | grep -m1 '^SM:' | cut -d ':' -f 2 > sample_name.txt
Log in to answer this question.
It seems the output do not generate any error. The most suspicious part may be:
But I have no idea what it means.
you should report a bug to the gatk forum.