To celebrate the release of GATK 4.0, we are giving away free credits for running the GATK4 Best Practices pipelines in FireCloud, our secure online analysis portal. It’s first come first serve, so sign up now to claim your free credits worth $250. Sponsored by Google Cloud. Learn more at

GATK4 SplitNCigarReads RuntimeIOException: Attempt to add record to closed writer.

gerzsgerzs Member
edited February 6 in Ask the GATK team

On a Linux cluster, I ran this command on a node (no job scheduler):

./gatk SplitNCigarReads -R /bigdisk/databases/genomes/human/Homo_sapiens.GRCh37.75.dna.primary_assembly.fa -I 28_tumor.dedupped.bam -O 28_tumor.split.bam

I get this error during SplitN's second pass:

13:27:28.945 INFO  ProgressMeter -           4:74283282            163.1             288256000        1767147.3`
13:27:38.955 INFO  ProgressMeter -           4:74283830            163.3             288523000        1766976.9`
13:27:46.176 INFO  SplitNCigarReads - Shutting down engine`
[February 6, 2018 1:27:46 PM CET] done. Elapsed time: 163.42 minutes.`
htsjdk.samtools.util.RuntimeIOException: Attempt to add record to closed writer.
    at htsjdk.samtools.util.AbstractAsyncWriter.write(
    at htsjdk.samtools.AsyncSAMFileWriter.addAlignment(
    at org.broadinstitute.hellbender.engine.GATKTool.doWork(
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.runTool(
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMainPostParseArgs(
    at org.broadinstitute.hellbender.cmdline.CommandLineProgram.instanceMain(
    at org.broadinstitute.hellbender.Main.runCommandLineProgram(
    at org.broadinstitute.hellbender.Main.mainEntry(
    at org.broadinstitute.hellbender.Main.main(

The output file 28_tumor.split.bam is 0 bytes, and ther is an index file, 0 bytes also.

Java version: 1.8.0_162
GATK version:
OS: CentOS release 6.8

I ran this command on a different computer with Ubuntu 16.04 and had no problems. On different BAM files I get the same error. Any ideas? It's frustrating that I can't get GATK to run efficentlyon the cluster, only on slow computers or with computers with limited disk space. It took a month to run on about 45 pairs of RNA-Seq samples (of course I made errors during the time), so I really need it to run on the cluster.


Issue · Github
by Sheila

Issue Number
Last Updated


Sign In or Register to comment.