This is a test version of Biostars. For the public version, visit https://www.biostars.org.
GATK GetSampleName is not working?

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.

snp assembly genome gene
> 13:07:15.455 INFO  NativeLibraryLoader - Loading libgkl_compression.so
> from
> jar:file:/home/cytong/gatk-4.1.4.0/gatk-package-4.1.4.0-local.jar!/com/intel/gkl/native/libgkl_compression.so Oct 28, 2019 1:07:15 PM
> shaded.cloud_nio.com.google.auth.oauth2.ComputeEngineCredentials
> runningOnComputeEngine INFO: Failed to detect whether we are running
> on Google Compute Engine. 13:07:15.624 INFO  GetSampleName -
> ------------------------------------------------------------ 13:07:15.625 INFO  GetSampleName - The Genome Analysis Toolkit (GATK)
> v4.1.4.0 13:07:15.625 INFO  GetSampleName - For support and
> documentation go to https://software.broadinstitute.org/gatk/
> 13:07:15.625 INFO  GetSampleName - Executing as
> cytong@mendel.dldcc.bcm.edu on Linux v3.10.0-957.21.3.el7.x86_64 amd64
> 13:07:15.625 INFO  GetSampleName - Java runtime: OpenJDK 64-Bit Server
> VM v1.8.0_152-release-1056-b12 13:07:15.625 INFO  GetSampleName -
> Start Date/Time: October 28, 2019 1:07:15 PM CDT 13:07:15.625 INFO 
> GetSampleName -
> ------------------------------------------------------------ 13:07:15.625 INFO  GetSampleName -
> ------------------------------------------------------------ 13:07:15.626 INFO  GetSampleName - HTSJDK Version: 2.20.3 13:07:15.626
> INFO  GetSampleName - Picard Version: 2.21.1 13:07:15.626 INFO 
> GetSampleName - HTSJDK Defaults.COMPRESSION_LEVEL : 2 13:07:15.626
> INFO  GetSampleName - HTSJDK Defaults.USE_ASYNC_IO_READ_FOR_SAMTOOLS :
> false 13:07:15.626 INFO  GetSampleName - HTSJDK
> Defaults.USE_ASYNC_IO_WRITE_FOR_SAMTOOLS : true 13:07:15.626 INFO 
> GetSampleName - HTSJDK Defaults.USE_ASYNC_IO_WRITE_FOR_TRIBBLE : false
> 13:07:15.626 INFO  GetSampleName - Deflater: IntelDeflater
> 13:07:15.626 INFO  GetSampleName - Inflater: IntelInflater
> 13:07:15.626 INFO  GetSampleName - GCS max retries/reopens: 20
> 13:07:15.626 INFO  GetSampleName - Requester pays: disabled
> 13:07:15.626 WARN  GetSampleName - 
> 
>    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 
>    Warning: GetSampleName is a BETA tool and is not yet ready for use
> in production
> 
>    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
> 
> 
> 13:07:15.626 INFO  GetSampleName - Initializing engine 13:07:16.247
> INFO  GetSampleName - Done initializing engine 13:07:17.337 INFO 
> ProgressMeter - Starting traversal 13:07:17.338 INFO  ProgressMeter - 
> Current Locus  Elapsed Minutes     Records Processed   Records/Minute
> 13:07:17.339 INFO  ProgressMeter -             unmapped             
> 0.0                     0              NaN 13:07:17.339 INFO  ProgressMeter - Traversal complete. Processed 0 total records in 0.0
> minutes. 13:07:17.339 INFO  GetSampleName - Shutting down engine
> [October 28, 2019 1:07:17 PM CDT]
> org.broadinstitute.hellbender.tools.GetSampleName done. Elapsed time:
> 0.03 minutes. Runtime.totalMemory()=2081423360

It seems the output do not generate any error. The most suspicious part may be:

> 13:07:17.338 INFO  ProgressMeter -        Current Locus  Elapsed
> Minutes     Records Processed   Records/Minute 13:07:17.339 INFO 
> ProgressMeter -             unmapped              0.0                  0              NaN

But I have no idea what it means.

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.