STAR terminate called after throwing an instance of 'std::bad_alloc'

618 views
Skip to first unread message

Stacey

unread,
Feb 9, 2018, 4:07:48 PM2/9/18
to trinityrnaseq-users
Hello,

In an attempt to use run_variant_calling.py I ran into the following error.

##################################################################################################
Running: STAR --runThreadN 6 --runMode genomeGenerate --genomeDir star_genome_idx --genomeFastaFiles Cg_SuperT1.fasta --sjdbGTFfile Cg_SuperT1.gtf --sjdbOverhang 150 --limitGenomeGenerateRAM 100000000000
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Traceback (most recent call last):
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 212, in <module>
    main()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 133, in main
    pipeliner.run()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 58, in run
    run_cmd(cmd.get_cmd())
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 22, in run_cmd
    raise RuntimeError("Error while running command \"" + str(cmd) + "\":\n" + error)
RuntimeError: Error while running command "['STAR', '--runThreadN', '6', '--runMode', 'genomeGenerate', '--genomeDir', 'star_genome_idx', '--genomeFastaFiles', 'Cg_SuperT1.fasta', '--sjdbGTFfile', 'Cg_SuperT1.gtf', '--sjdbOverhang', '150', '--limitGenomeGenerateRAM', '100000000000']":
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
###########################################################################################################

I played around with various RAM inputs but no luck (I believe I have a little over 1 T to work with). I read that reducing the --genomeChrBinNbits default from the STAR command may help reduce the RAM needed but I'm not sure where to go to change that number or whether that would even solve my problem. Any insight would be much appreciated.

Sincerely,
Stacey

Brian Haas

unread,
Feb 9, 2018, 7:48:27 PM2/9/18
to Stacey, trinityrnaseq-users
Hi Stacey,

One thing you can try is to add  

      --genomeSAindexNbases 8

to the genome generate command and see if that helps.   The next version of the utility will include the command like so:

 star_genome_generate_cmd = str("STAR --runThreadN " +

                                   args.nthreads +

                                   " --runMode genomeGenerate" +

                                   " --genomeDir star_genome_idx " +

                                   " --genomeFastaFiles {} ".format(st_fa_path) +

                                   " --genomeSAindexNbases 8 " +  # as per A. Dobin

                                   " --sjdbGTFfile {} ".format(st_gtf_path) +

                                   " --sjdbOverhang {} ".format(args.sjdbOverhang) +

                                   " --limitGenomeGenerateRAM {}".format(args.maxram) )


> --
> You received this message because you are subscribed to the Google Groups "trinityrnaseq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-u...@googlegroups.com.
> To post to this group, send email to trinityrn...@googlegroups.com.
> Visit this group at https://groups.google.com/group/trinityrnaseq-users.
> For more options, visit https://groups.google.com/d/optout.




--
--
Brian J. Haas
The Broad Institute
http://broadinstitute.org/~bhaas

 

Stacey

unread,
Feb 9, 2018, 9:00:00 PM2/9/18
to trinityrnaseq-users
Thank you for your quick reply. I gave it a try but got the same error (Error 1). I then added the --genomeChrBinNbits 15 and it ran a bit longer but I then received Error 2. After adding --limitSjdbInsertNsi 2000000 to the same genome generate command, the run is still going but it got passed that command. The only thing is I have no idea what affect these additions have on the output.

###################################Error 1##############################################
Running: STAR --runThreadN 4 --runMode genomeGenerate --genomeDir star_genome_idx --genomeFastaFiles Cg_SuperT1.fasta --genomeSAindexNbases 8 --sjdbGTFfile Cg_SuperT1.gtf --sjdbOverhang 150 --limitGenomeGenerateRAM 100000000000

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

Traceback (most recent call last):
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 213, in <module>
    main()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 134, in main

    pipeliner.run()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 58, in run
    run_cmd(cmd.get_cmd())
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 22, in run_cmd
    raise RuntimeError("Error while running command \"" + str(cmd) + "\":\n" + error)
RuntimeError: Error while running command "['STAR', '--runThreadN', '4', '--runMode', 'genomeGenerate', '--genomeDir', 'star_genome_idx', '--genomeFastaFiles', 'Cg_SuperT1.fasta', '--genomeSAindexNbases', '8', '--sjdbGTFfile', 'Cg_SuperT1.gtf', '--sjdbOverhang', '150', '--limitGenomeGenerateRAM', '100000000000']":

terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc

#####################################################################################################
####################################################################################################
###############################Error 2###############################################################

Fatal LIMIT error: the number of junctions to be inserted on the fly =1177370 is larger than the limitSjdbInsertNsj=1000000
Fatal LIMIT error: the number of junctions to be inserted on the fly =1177370 is larger than the limitSjdbInsertNsj=1000000
SOLUTION: re-run with at least --limitSjdbInsertNsj 1177370

Feb 09 17:23:10 ...... FATAL ERROR, exiting

##############################################################################################
> To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsub...@googlegroups.com.

Brian Haas

unread,
Feb 9, 2018, 11:24:37 PM2/9/18
to Stacey, trinityrnaseq-users
Try keeping the

    --genomeSAindexNbases 8 

but increasing the --limitGenomeGenerateRAM to what's needed for your data set.   

I haven't seen the --limitSjdbInsertNsj needed to be updated, but it should be fine to increase that as well as needed.

Let's see how it goes.   I'll update the code so it'll be more accommodating in the next release. 

best of luck,

~b
>> > To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-u...@googlegroups.com.

>> > To post to this group, send email to trinityrn...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/trinityrnaseq-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> --
>> Brian J. Haas
>> The Broad Institute
>> http://broadinstitute.org/~bhaas
>>
>>  
>
> --
> You received this message because you are subscribed to the Google Groups "trinityrnaseq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-u...@googlegroups.com.

Stacey

unread,
Feb 12, 2018, 9:06:35 PM2/12/18
to trinityrnaseq-users
Hi Brian

I'm currently having an issue with the following command from run_variant_calling.py:

########################################################################
Pipeliner.Command("java -jar " + GATK_HOME + "/GenomeAnalysisTK.jar " +
                          "-T SplitNCigarReads -R " + st_fa_path +
                          " -I dedupped.bam -o splitNCigar.bam " +
                          " -rf ReassignOneMappingQuality -RMQF 255 -RMQT 60 -U ALLOW_N_CIGAR_READS",
                          "splitNCigarReads.ok")
#########################################################################

I renamed a jar file inside the gatk directory to match GenomeAnalysisTK.jar because there wasn't an available jar file with that name inside the directory but I assumed the local jar file was the same but perhaps was changed due to version updates. (The file name was: gatk-package-4.0.1.2-local.jar)

When the above command is run, I get the following error:

######################################################################################################
Running: java -jar /usr/share/gatk//GenomeAnalysisTK.jar -T SplitNCigarReads -R Cg_SuperT1.fasta -I dedupped.bam -o splitNCigar.bam -rf ReassignOneMappingQuality -RMQF 255 -RMQT 60 -U ALLOW_N_CIGAR_READS

A USER ERROR has occurred: '-T' is not a valid command.


***********************************************************************
Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace.


Traceback (most recent call last):
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 217, in <module>
    main()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 183, in main

    pipeliner.run()
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 58, in run
    run_cmd(cmd.get_cmd())
  File "/usr/share/trinityrnaseq-Trinity-v2.5.1/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 22, in run_cmd
    raise RuntimeError("Error while running command \"" + str(cmd) + "\":\n" + error)
RuntimeError: Error while running command "['java', '-jar', '/usr/share/gatk//GenomeAnalysisTK.jar', '-T', 'SplitNCigarReads', '-R', '/media/stacey/Stacey_2T/C_gigas_transcriptome/Cg_trinity_1/Variants/Cg_SuperT1.fasta', '-I', 'dedupped.bam', '-o', 'splitNCigar.bam', '-rf', 'ReassignOneMappingQuality', '-RMQF', '255', '-RMQT', '60', '-U', 'ALLOW_N_CIGAR_READS']":
USAGE:  <program name> [-h]

Available Programs:
 
## I Removed program list

A USER ERROR has occurred: '-T' is not a valid command.


***********************************************************************
Set the system property GATK_STACKTRACE_ON_USER_EXCEPTION (--java-options '-DGATK_STACKTRACE_ON_USER_EXCEPTION=true') to print the stack trace.

###########################################################################################################

Thanks again for your help
>> > To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsub...@googlegroups.com.

>> > To post to this group, send email to trinityrn...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/trinityrnaseq-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> --
>> Brian J. Haas
>> The Broad Institute
>> http://broadinstitute.org/~bhaas
>>
>>  
>
> --
> You received this message because you are subscribed to the Google Groups "trinityrnaseq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsub...@googlegroups.com.

Brian Haas

unread,
Feb 12, 2018, 9:21:39 PM2/12/18
to Stacey, trinityrnaseq-users
hi Stacey,

Try using the earlier version of gatk:

The Genome Analysis Toolkit (GATK) v3.8-0-ge9d806836, Compiled 2017/07/28 21:26:50

Copyright (c) 2010-2016 The Broad Institute

For support and documentation go to https://software.broadinstitute.org/gatk

[Mon Feb 12 21:19:16 EST 2018] Executing on Mac OS X 10.11.6 x86_64

Java HotSpot(TM) 64-Bit Server VM 1.8.0_102-b14


I haven't gotten around to testing w/ gatk 4 yet and some of the usage info might have changed there.   

best

~b




>> > To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsubscribe...@googlegroups.com.

>> > To post to this group, send email to trinityrn...@googlegroups.com.
>> > Visit this group at https://groups.google.com/group/trinityrnaseq-users.
>> > For more options, visit https://groups.google.com/d/optout.
>>
>>
>>
>>
>> --
>> --
>> Brian J. Haas
>> The Broad Institute
>> http://broadinstitute.org/~bhaas
>>
>>  
>
> --
> You received this message because you are subscribed to the Google Groups "trinityrnaseq-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsubscribe...@googlegroups.com.

> To post to this group, send email to trinityrn...@googlegroups.com.
> Visit this group at https://groups.google.com/group/trinityrnaseq-users.
> For more options, visit https://groups.google.com/d/optout.




--
--
Brian J. Haas
The Broad Institute
http://broadinstitute.org/~bhaas

 

--
You received this message because you are subscribed to the Google Groups "trinityrnaseq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trinityrnaseq-users+unsub...@googlegroups.com.
To post to this group, send email to trinityrnaseq-users@googlegroups.com.

Govind Raj

unread,
May 30, 2018, 7:41:41 AM5/30/18
to trinityrnaseq-users
Dear Dr Brian and other members,

I am having similar error related to this thread, that is, while running run_variant_calling.py from trinityrnaseq-Trinity-v2.6.5, I am getting following error:

Command used:
/home/raj/packages/trinityrnaseq-Trinity-v2.6.5/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py \
--st_fa pv_trinity_genes.fasta \
--st_gtf pv_trinity_genes.gtf \
-p pv_trimmed/ACPVAL1_R1_trimmed.fastq.gz pv_trimmed/ACPVAL1_R2_trimmed.fastq.gz \
-t 24 -m 30000000000 \
-o ACPVAL > ACPVAL/run_variant_calling_ACPVAL1_30052018.log 2>&1

Error generated:

terminate called after throwing an instance of 'std::bad_alloc'                                                                                                                    
  what():  std::bad_alloc                                                                                                                                                          
Traceback (most recent call last):                                                                                                                                                 
  File "/home/raj/packages/trinityrnaseq-Trinity-v2.6.5/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 234, in <module>                                   
    main()                                                                                                                                                                         
  File "/home/raj/packages/trinityrnaseq-Trinity-v2.6.5/Analysis/SuperTranscripts/AllelicVariants/run_variant_calling.py", line 142, in main                                       
    pipeliner.run()                                                                                                                                                                
  File "/home/raj/packages/trinityrnaseq-Trinity-v2.6.5/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 59, in run                                    
    run_cmd(cmd.get_cmd(), cmd.get_ignore_error_setting())                                                                                                                         
  File "/home/raj/packages/trinityrnaseq-Trinity-v2.6.5/Analysis/SuperTranscripts/AllelicVariants/../../../PyLib/Pipeliner.py", line 23, in run_cmd                                
    raise e                                                                                                                                                                        
subprocess.CalledProcessError: Command 'STAR --runThreadN 48 --runMode genomeGenerate --genomeDir star_genome_idx 
--genomeFastaFiles /home/raj/data2/files4mwavesim13042018/data3/pvulgata_supertranscript_analysis/pvulgata_trinity_genes.fasta 
--genomeSAindexNbases 8  --sjdbGTFfile /home/raj/data2/files4mwavesim13042018/data3/pvulgata_supertranscript_analysis/pvulgata_trinity_genes.gtf 
--sjdbOverhang 150  --limitGenomeGenerateRAM 50000000000  ' returned non-zero exit status -6

I changed RAM from 50GB to 20GB and also reduced threads from 48 to 24, but resulted in same error.

So, please give your input to resolve this error issue.

Many thanks in advance.

Regards,
Govindraj Chavan
 
Reply all
Reply to author
Forward
0 new messages