alexdobin / STAR

RNA-seq aligner
MIT License
1.85k stars 506 forks source link

FATAL ERROR: outSAMtype BAM SortedByCoordinate #1641

Open boomath opened 2 years ago

boomath commented 2 years ago

Dear alexdobin,

                    I am not able to identify the error in "outSAMtype BAM SortedByCoordinate". But when I run the command for single fastq file it was success.  I have given the code in the below and its error output: 

for file in *.fastq; do /Users/boomathipandi/STAR-2.7.10a/bin/MacOSX_x86_64/STAR --runMode alignReads –-genomeDir /Users/boomathipandi/ref/ --outSAMtype BAM SortedByCoordinate –-readFilesIn ${file} –-runThreadN 12 –-outFileNamePrefix /Users/boomathipandi/mapped/${file}; done

Aug 30 15:31:16 ...... FATAL ERROR, exiting

EXITING because of fatal input ERROR: unknown value for the word 3 of outSAMtype: –-readFilesIn SOLUTION: re-run STAR with one of the allowed values of --outSAMtype BAM Unsorted or SortedByCoordinate or both

Can you kindly help me to rectify this issue?

Thank you

boomath commented 2 years ago

Hi, If I make it to run after trying many timesalso, I am not getting the sorted BAM file. The result folder has a BAM file but without anything. finished mapping started sorting BAM finished successfully

These three process is not happening.

May I know the reason for this? Kindly, please help me to figure out.

Thank you

alexdobin commented 2 years ago

Hi @boomath

this looks like an issue with the formatting of the command line. The first dash in --readFilesIn is not a normal one.

boomath commented 2 years ago

Thank you so much. I have corrected it and run that.

It is not showing below three processes

STAR version: 2.7.10a   compiled:  :/Users/travis/build/alexdobin/travis-tests/STARcompile/source

Sep 02 14:25:19 ..... started STAR run Sep 02 14:25:19 ..... loading genome

Some files showing starting mapping also

finished mapping started sorting BAM finished successfully

only these output files are saving:

PBS-Glial-1_S22_L004_R1_001.fastq_STARtmp PBS-Glial-1_S22_L004_R1_001.fastqAligned.sortedByCoord.out.bam PBS-Glial-1_S22_L004_R1_001.fastqLog.out PBS-Glial-1_S22_L004_R1_001.fastqLog.progress.out

However," PBS-Glial-1_S22_L004_R1_001.fastqAligned.sortedByCoord.out.bam" these are zero bytes.

May I know the reason for it.

alexdobin commented 2 years ago

Hi @boomath please post the contents of the Log.final.out file.

boomath commented 2 years ago

STAR version=2.7.10a STAR compilation time,server,dir= :/Users/travis/build/alexdobin/travis-tests/STARcompile/source STAR git: On branch master ; commit 51b64d4fafb7586459b8a61303e40beceeead8c0 ; diff files:

Command Line:

/Users/boomathipandi/STAR-2.7.10a/bin/MacOSX_x86_64/STAR --runMode alignReads --genomeDir /Users/boomathipandi/ref/ --outSAMtype BAM SortedByCoordinate --readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq --runThreadN 16 --outFileNamePrefix /Users/boomathipandi/mapped/PBS-Glial-1_S22_L004_R1_001.fastq

Initial USER parameters from Command Line:

outFileNamePrefix /Users/boomathipandi/mapped/PBS-Glial-1_S22_L004_R1_001.fastq

All USER parameters from Command Line:

runMode alignReads ~RE-DEFINED genomeDir /Users/boomathipandi/ref/ ~RE-DEFINED outSAMtype BAM SortedByCoordinate ~RE-DEFINED readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq ~RE-DEFINED runThreadN 16 ~RE-DEFINED outFileNamePrefix /Users/boomathipandi/mapped/PBS-Glial-1_S22_L004_R1_001.fastq ~RE-DEFINED

Finished reading parameters from all sources
Final user re-defined parameters-----------------:

runMode alignReads
runThreadN 16 genomeDir /Users/boomathipandi/ref/ readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq
outFileNamePrefix /Users/boomathipandi/mapped/PBS-Glial-1_S22_L004_R1_001.fastq outSAMtype BAM SortedByCoordinate

This is the output I got from it.

boomath commented 2 years ago

PBS-Glial-1_S22_L004_R1_001.fastq_STARtmp PBS-Glial-1_S22_L004_R1_001.fastqAligned.sortedByCoord.out.bam PBS-Glial-1_S22_L004_R1_001.fastqLog.out PBS-Glial-1_S22_L004_R1_001.fastqLog.progress.out

In the "PBS-Glial-1_S22_L004_R1_001.fastqLog.progress.out"

       Time    Speed        Read     Read   Mapped   Mapped   Mapped   Mapped Unmapped Unmapped Unmapped Unmapped
                M/hr      number   length   unique   length   MMrate    multi   multi+       MM    short    other

There is no information.

Kindly help me for this. I am not able to go for the next step. Please.

Thank you

boomath commented 2 years ago

Hi, Recently, I am getting the following error.

/Users/boomathipandi/STAR-2.7.10a/bin/MacOSX_x86_64/STAR --runMode alignReads --genomeDir /Users/boomathipandi/ref/ --outSAMtype BAM SortedByCoordinate --readFilesIn PBS-Glial-8_S31_L004_R2_001.fastq --runThreadN 12 --outFileNamePrefix /Users/boomathipandi/mapped/PBS-Glial-8_S31_L004_R2_001.fastq
STAR version: 2.7.10a   compiled:  :/Users/travis/build/alexdobin/travis-tests/STARcompile/source

Sep 07 19:24:21 ..... started STAR run Sep 07 19:24:21 ..... loading genome Sep 07 19:36:03 ..... started mapping

BAMoutput.cpp:27:BAMoutput: exiting because of OUTPUT FILE error: could not create output file /Users/boomathipandi/mapped/PBS-Glial-8_S31_L004_R2_001.fastq_STARtmp//BAMsort/4/49 SOLUTION: check that the path exists and you have write permission for this file. Also check ulimit -n and increase it to allow more open files.

Sep 07 19:36:04 ...... FATAL ERROR, exiting

I checked all the way. I am not able to find out.

Can. you kindly help me for this!

Thank you .

alexdobin commented 2 years ago

Hi @boomath

please try ulimit -n 4000 before running STAR.

boomath commented 2 years ago

Thank you so much for reply.

I tried it, still it is not storing. here's the logout output:

STAR version=2.7.10a STAR compilation time,server,dir= :/Users/travis/build/alexdobin/travis-tests/STARcompile/source STAR git: On branch master ; commit 51b64d4fafb7586459b8a61303e40beceeead8c0 ; diff files:

Command Line:

/Users/boomathipandi/STAR-2.7.10a/bin/MacOSX_x86_64/STAR --runMode alignReads --genomeDir /Users/boomathipandi/ref/ --outSAMtype BAM SortedByCoordinate --readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq --runThreadN 12 --outFileNamePrefix /Users/boomathipandi/map/PBS-Glial-1_S22_L004_R1_001.fastq

Initial USER parameters from Command Line:

outFileNamePrefix /Users/boomathipandi/map/PBS-Glial-1_S22_L004_R1_001.fastq

All USER parameters from Command Line:

runMode alignReads ~RE-DEFINED genomeDir /Users/boomathipandi/ref/ ~RE-DEFINED outSAMtype BAM SortedByCoordinate ~RE-DEFINED readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq ~RE-DEFINED runThreadN 12 ~RE-DEFINED outFileNamePrefix /Users/boomathipandi/map/PBS-Glial-1_S22_L004_R1_001.fastq ~RE-DEFINED

Finished reading parameters from all sources
Final user re-defined parameters-----------------:

runMode alignReads
runThreadN 12 genomeDir /Users/boomathipandi/ref/ readFilesIn PBS-Glial-1_S22_L004_R1_001.fastq
outFileNamePrefix /Users/boomathipandi/map/PBS-Glial-1_S22_L004_R1_001.fastq outSAMtype BAM SortedByCoordinate

boomath commented 2 years ago

Dear Alexdobin, I am waiting for your reply regarding my previous query. Thank you.

alexdobin commented 2 years ago

Hi @boomath

you may need sudo privileges to change ulimit. If you cannot have them, then you would need to reduce the number of threads, e.g. --runThreadN 6. Also, you can generate unsorted BAM and then sort it with samtools.

boomath commented 2 years ago

I tried all your instruction. I am not able to. Is there any other possible ways? please

alexdobin commented 2 years ago

What happened when you run STAR without BAM sorting?

boomath commented 2 years ago

I tired. I think, my lapop is 16GB macbook pro m1, may be it is not able to do it. Is it true?

alexdobin commented 2 years ago

For 16GB, you would need to use at the genome generation step

--genomeSAsparseD 3 --genomeSAindexNbases 12 --limitGenomeGenerateRAM 15000000000
boomath commented 1 year ago

Hi Sir, I have created by using --genomeSAsparseD 3 --genomeSAindexNbases 12 --limitGenomeGenerateRAM 15000000000

genome generation was successful.

but still

(base) boomathipandi@dhcp-10-110-245-121 ~ % /Users/boomathipandi/STAR-2.7.10a/bin/MacOSX_x86_64/STAR --runMode alignReads --genomeDir /Users/boomathipandi/ref/ --outSAMtype BAM Unsorted SortedByCoordinate --readFilesIn /Users/boomathipandi/ PBS/ ${file}_R1.fastq ${file}_R2.fastq --runThreadN 6 --outFileNamePrefix /Users/boomathipandi/mapped/${file}

EXITING because of fatal input ERROR: could not open readFilesIn=_R1.fastq

Dec 05 14:39:50 ...... FATAL ERROR, exiting

pairend data file. .. _R1.fastq ; .._R12.fastq

Can you help me for this.

Thank you.

alexdobin commented 1 year ago

Hi @boomath

this is an issue with the formatting of the command line for STAR, please check that the paths for FASTQ files are correct.