Rnaseq: STAR Command error

Created on 8 Apr 2019  Â·  13Comments  Â·  Source: nf-core/rnaseq

I met this error on my work.

nextflow run nf-core/rnaseq --reads '*_R{1,2}.fq.gz' \
    --genome GRCh37 \
    --skip_qc \
    --skip_genebody_coverage \
    -profile docker \
    --max_memory '15.GB' \
    --max_time '9.day'  \
--max_cpus 2

the run log as follows:

N E X T F L O W  ~  version 19.03.0-edge
Launching `nf-core/rnaseq` [deadly_chandrasekhar] - revision: 37f260d360 [master]
Pipeline Release  : master
Run Name          : deadly_chandrasekhar
Reads             : *_R{1,2}.fq.gz
Data Type         : Paired-End
Genome            : GRCh37
Strandedness      : None
Trimming          : 5'R1: 0 / 5'R2: 0 / 3'R1: 0 / 3'R2: 0
Aligner           : STAR
STAR Index        : /home/cllcentosvm/cllcentosvm/references/Homo_sapiens/Ensembl/GRCh37/Sequence/STARIndex/
GTF Annotation    : /home/cllcentosvm/cllcentosvm/references/Homo_sapiens/Ensembl/GRCh37/Annotation/Genes/genes.gtf
BED Annotation    : /home/cllcentosvm/cllcentosvm/references/Homo_sapiens/Ensembl/GRCh37/Annotation/Genes/genes.bed
Save prefs        : Ref Genome: No / Trimmed FastQ: No / Alignment intermediates: No
Max Resources     : 15.GB memory, 2 cpus, 9.day time per job
Container         : docker - nfcore/rnaseq:1.3
Output dir        : ./results
Launch dir        : /home/cllcentosvm/HCC78CRRNASEQ
Working dir       : /home/cllcentosvm/HCC78CRRNASEQ/work
Script dir        : /home/cllcentosvm/.nextflow/assets/nf-core/rnaseq
User              : cllcentosvm
Config Profile    : docker

executor >  local (16)
[eb/27adb0] process > trim_galore           [100%] 6 of 6 ✔
[8c/343e4f] process > get_software_versions [100%] 1 of 1 ✔
[c1/74a6d3] process > output_documentation  [100%] 1 of 1 ✔
[5f/bf6b88] process > star                  [ 88%] 7 of 8, failed: 7
ERROR ~ Error executing process > 'star (180811A_HCC78CR5)'

Caused by:
  Process `star (180811A_HCC78CR5)` terminated with an error exit status (137)

Command executed:

  STAR --genomeDir STARIndex \
      --sjdbGTFfile genes.gtf \
      --readFilesIn 180811A_HCC78CR5_R1_val_1.fq.gz 180811A_HCC78CR5_R2_val_2.fq.gz  \
      --runThreadN 2 \
      --twopassMode Basic \
      --outWigType bedGraph \
      --outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 16006127360 \
      --readFilesCommand zcat \
      --runDirPerm All_RWX \
       --outFileNamePrefix 180811A_HCC78CR5 

  samtools index 180811A_HCC78CR5Aligned.sortedByCoord.out.bam

Command exit status:
  137

Command output:
  Apr 08 00:54:12 ..... started STAR run
  Apr 08 00:54:12 ..... loading genome
  Apr 08 02:23:14 ..... processing annotations GTF
  Apr 08 02:25:25 ..... inserting junctions into the genome indices

Command error:
  .command.sh: line 11:    28 Killed                  STAR --genomeDir STARIndex --sjdbGTFfile genes.gtf --readFilesIn 180811A_HCC78CR5_R1_val_1.fq.gz 180811A_HCC78CR5_R2_val_2.fq.gz --runThreadN 2 --twopassMode Basic --outWigType bedGraph --outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 16006127360 --readFilesCommand zcat --runDirPerm All_RWX --outFileNamePrefix 180811A_HCC78CR5

Work dir:
  /home/cllcentosvm/HCC78CRRNASEQ/work/5f/bf6b8827d084e486dc66ffba184084

Tip: when you have fixed the problem you can continue the execution appending to the nextflow command line the option `-resume`

 -- Check '.nextflow.log' file for details

executor >  local (16)
[eb/27adb0] process > trim_galore           [100%] 6 of 6 ✔
[8c/343e4f] process > get_software_versions [100%] 1 of 1 ✔
[c1/74a6d3] process > output_documentation  [100%] 1 of 1 ✔
[2b/acb0ca] process > star                  [100%] 8 of 8, failed: 8
WARN: Killing pending tasks (1)
ERROR ~ Error executing process > 'star (180811A_HCC78CR5)'

Caused by:
  Process `star (180811A_HCC78CR5)` terminated with an error exit status (137)

Command executed:

  STAR --genomeDir STARIndex \
      --sjdbGTFfile genes.gtf \
      --readFilesIn 180811A_HCC78CR5_R1_val_1.fq.gz 180811A_HCC78CR5_R2_val_2.fq.gz  \
      --runThreadN 2 \
      --twopassMode Basic \
      --outWigType bedGraph \
      --outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 16006127360 \
      --readFilesCommand zcat \
      --runDirPerm All_RWX \
       --outFileNamePrefix 180811A_HCC78CR5 

  samtools index 180811A_HCC78CR5Aligned.sortedByCoord.out.bam

Command exit status:
  137

Command output:
  Apr 08 00:54:12 ..... started STAR run
  Apr 08 00:54:12 ..... loading genome
  Apr 08 02:23:14 ..... processing annotations GTF
  Apr 08 02:25:25 ..... inserting junctions into the genome indices

Command error:
  .command.sh: line 11:    28 Killed                  STAR --genomeDir STARIndex --sjdbGTFfile genes.gtf --readFilesIn 180811A_HCC78CR5_R1_val_1.fq.gz 180811A_HCC78CR5_R2_val_2.fq.gz --runThreadN 2 --twopassMode Basic --outWigType bedGraph --outSAMtype BAM SortedByCoordinate --limitBAMsortRAM 16006127360 --readFilesCommand zcat --runDirPerm All_RWX --outFileNamePrefix 180811A_HCC78CR5

Work dir:
  /home/cllcentosvm/HCC78CRRNASEQ/work/5f/bf6b8827d084e486dc66ffba184084

Tip: when you have fixed the problem you can continue the execution appending to the nextflow command line the option `-resume`

 -- Check '.nextflow.log' file for details

Most helpful comment

In case it helps anyone else, I needed to edit this config as follows:

process {
   withName: genebody_coverage {
      time = '48h'
   }
}

All 13 comments

Hi there,

An exit code of 137 usually means that the job was killed because it was using too much memory. STAR is quite memory-hungry and I suspect that 15GB is not enough for it to run. I’d recommend running with HiSAT2 instead (--aligner hisat2)

Phil

@ewels Many thanks for your quick reply and suggestion. I will try again.

hi Phil,
Can I solve this error by expanding the swap space on my centos system ?

Maybe? I'd be fairly surprised though to be honest. It's a little difficult to know sorry, there can be so many system-specific variables. Is there a reason that you can't use HiSAT2? The results should be highly comparable.

If it's ok, I'll close this issue now as I don't think that this is a problem with the pipeline as such.

Phil

@ewels thanks for your reply ! HiSAT2 runs fine for me for the alignment step. but an error occurs to me.

ERROR ~ Error executing process > 'genebody_coverage (180811A_HCC78CR5)'

Caused by:
  Process exceeded running time limit (8h)

Command executed:

  samtools index 180811A_HCC78CR5.sorted.bam
  geneBody_coverage.py \
      -i 180811A_HCC78CR5.sorted.bam \
      -o 180811A_HCC78CR5.sorted.rseqc \
      -r genes.bed
  mv log.txt 180811A_HCC78CR5.sorted.rseqc.log.txt

this was the command for nextflow:

nextflow run nf-core/rnaseq --reads '*_R{1,2}.fq.gz' \
    --genome GRCh37 \
    --aligner hisat2 \
    -profile docker \
    --max_memory '15.GB' \
    --max_time '9.day'  \
    --max_cpus 2 \
    -resume

Ouch, gene body coverage is taking more than 8 hours? You can quickly fix this by rerunning the same command (with -resume again) but adding --skip_genebody_coverage to skip this step.

If you want to give it more time to finish, you can create a custom config file which looks like this:

process {
  withName: genebody_coverage {
    time: 48h
  }
}

Then add -c path/to/this/file.config when you run nextflow.

Great that HiSAT2 is working on your machine!

Phil

Its still a slow step, we're also skipping it for many processes :-(/

Ouch, gene body coverage is taking more than 8 hours? You can quickly fix this by rerunning the same command (with -resume again) but adding --skip_genebody_coverage to skip this step.

If you want to give it more time to finish, you can create a custom config file which looks like this:

process {
  withName: genebody_coverage {
    time: 48h
  }
}

Then add -c path/to/this/file.config when you run nextflow.

Great that HiSAT2 is working on your machine!

Phil

Many thanks !

In case it helps anyone else, I needed to edit this config as follows:

process {
   withName: genebody_coverage {
      time = '48h'
   }
}

Hi,
I'm having similar issues with the star alignment step, fatal error 137.. I'm using a iMac with 64 gb RAM and 8 i9 cores. I'm trying to do RNA-seq alignment on mouse samples. 64 gb ram should be enough, yes?

Pipeline Release  : master
Run Name          : reverent_easley
Reads             : data/Solo-Total/*_R{1,2}_001.fastq.gz
Data Type         : Paired-End
Genome            : m38-star
Strandedness      : Forward
Trimming          : 5'R1: 0 / 5'R2: 0 / 3'R1: 0 / 3'R2: 0
Aligner           : STAR
STAR Index        : references/Mus_musculus/Ensembl/GRCm38/Sequence/STARIndex
GTF Annotation    : references/Mus_musculus/Ensembl/GRCm38/Sequence/STARIndex/genes.gtf
BED Annotation    : references/Mus_musculus/Ensembl/GRCm38/Annotation/Genes/genes.bed
Save prefs        : Ref Genome: Yes / Trimmed FastQ: Yes / Alignment intermediates: Yes
Max Resources     : 64.GB memory, 16 cpus, 10d time per job
Container         : docker - nfcore/rnaseq:1.3
Output dir        : results/outs_nextflow_solo
Launch dir        : /Users/alexchamessian/Desktop/FW_AVP_OXT
Working dir       : /Users/alexchamessian/Desktop/FW_AVP_OXT/work
Script dir        : /Users/alexchamessian/.nextflow/assets/nf-core/rnaseq
User              : alexchamessian
Config Profile    : docker
[2m----------------------------------------------------
executor >  local (3)
executor >  local (3)
[38/6756fe] process > get_software_versions           [100%] 1 of 1 ✔
[e4/2ce717] process > fastqc (OXT2-Neg_S81_L004)      [100%] 16 of 16, cached: 16 ✔
[f5/bc3750] process > trim_galore (OXT2-Pos_S82_L004) [100%] 16 of 16, cached: 16 ✔
[47/c29404] process > star (OXT2-Neg_S81_L004_R1_001) [100%] 2 of 2, failed: 2
[-        ] process > rseqc                           -
[-        ] process > bam_subsample                   -
[-        ] process > genebody_coverage               -
[-        ] process > preseq                          -
[-        ] process > markDuplicates                  -
[-        ] process > dupradar                        -
[-        ] process > featureCounts                   -
[-        ] process > merge_featureCounts             -
[-        ] process > stringtieFPKM                   -
[-        ] process > sample_correlation              -
[-        ] process > multiqc                         -
[34/23b0b7] process > output_documentation (1)        [100%] 1 of 1, cached: 1 ✔
[0;35m[nf-core/rnaseq] Pipeline completed with errors
[43/bd0669] NOTE: Process `star (AVP5-Pos_S76_L004_R1_001)` terminated with an error exit status (137) -- Execution is retried (1)

Here is the command I'm giving to run the pipeline:

nextflow run nf-core/rnaseq --reads 'data/Solo-Total/*_R{1,2}_001.fastq.gz' \
--genome m38-star  -profile docker --forward_stranded --saveReference --saveTrimmed \
--saveAlignedIntermediates --outdir results/outs_nextflow_solo \
--aligner star \
--max_memory '64.GB' -resume 20190919-solo-nf -c src/nextflow.config 

Of note, I had to download the reference genes directly, hence the custom config file because I was getting another fatal error when I was trying to let the pipeline just download from AWS.

Thanks!

Hi @achamess,

Have you tried the above solution, changing genebody_coverage for star?

Phil

@ewels I think the issue was that my Docker memory limits were set at the default 2GB. I can try it though. Is my pipeline even getting to genebody coverage though? I think it's still at the star alignment step, unless I'm misunderstanding where that step falls in the pipeline.

The pipeline is now making it through star and is aligning some of my fastqs, but it's stopping midstream because Docker throws and error and shuts down (and I need to restart).

https://github.com/nf-core/rnaseq/issues/285#issuecomment-534257955

Yes sorry, I just saw your other issue thread. That sounds more likely.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

prmac picture prmac  Â·  10Comments

sstadick picture sstadick  Â·  6Comments

arnoldliaoILMN picture arnoldliaoILMN  Â·  11Comments

orzechoj picture orzechoj  Â·  11Comments

mjsteinbaugh picture mjsteinbaugh  Â·  5Comments