guigolab / grape-nf

An automated RNA-seq pipeline using Nextflow
GNU General Public License v3.0
37 stars 10 forks source link

STAR 2.4.0j with singularity gives segmentation fault error #67

Open asalhab opened 1 year ago

asalhab commented 1 year ago

Hi @emi80

I have been using grap-nf [10fde600ff] for long time with singulairty 3.6.3 and nextflow 20.10.0. Recently, I had to change to a new HPC environemnt. So, I donwloaded the grape-nf [93be727a26] with the same nextflow and singularity vesions as before, I also copied the exact singulairty images from the old to the new environemnt. When I run grape-nf it failed at the mapping step complaining about sambamba but actually when I debug it (by looking into .command.run & .command.sh, it turns out that the problem is due to STAR when using singluarity image "grapenf-mapping-star-2.4.0j.img" for STAR-2.4-sambamba-Transcriptome template. when I singularity exec grapenf-mapping-star-2.4.0j.img STAR --help I get segmentation fault. Howeve when I singularity exec grapenf-mapping-star-2.4.0j.img sambamba --help I get the proper help output. I downloaded another version using singularity pull docker://grapenf/mapping:star-2.6.0c. I repeated the command with this version singularity exec mapping_star-2.6.0c.sif STAR --help and I got a proper STAR help output.

do you have an idea what might be the problem with STAR-2.4.0j ? and for reproducibiliy issue, can I instruct nextflow to download the revision 10fde600ff that I have been using in the old environemnt?

Best, Abdul

emi80 commented 1 year ago

Hi @asalhab, thanks for reporting the issue.

About the problem with STAR-2.4.0j, I guess the singualrity image might be corrupted. Can you try to pull it again (outside of Nextflow) and run STAR --help using it? I just tried it out on our HPC environment and it works (the STAR error message is because 2.4.0j did not have an help command line option):

❯ singularity pull docker://grapenf/mapping:star-2.4.0j
INFO:    Using cached SIF image

❯ singularity exec ./mapping_star-2.4.0j.sif STAR --help

EXITING: FATAL INPUT ERROR: empty value for parameter "help" in input "Command-Line-Initial"
SOLUTION: use non-empty value for this parameter

Dec 09 09:25:38 ...... FATAL ERROR, exiting

Let me know if that solves the issue.

For the second question, you can add -r 10fde60 to the nextflow run command to stick with a specific revision of the pipeline.

Best, Emilio

asalhab commented 1 year ago

Hi @emi80, it seems as you suggested the image is corrupted. I tried to pull it again but I got the same error (segmentation fault). I rebuilt the image grapenf-mapping-star-2.4.0j.img by writing a docker definiton file which contains STAR 2.4.0j and sambamba 0.7.1 and pigz 2.4 with ubuntu18.04. I ran grape-nf using this image and the mapping step finished successfully. However, it failed again at the bigwig step since it has a STAR command which gives segmentation fault error. So, I rebuilt the grapenf-bigwig-star-2.4.0j.img with STAR 2.4.0j, sambamba 0.7.1 and ucsc tools: bedGraphTobigwig, genePredToBed and gtfToGenePred from http://hgdownload.soe.ucsc.edu/admin/exe/linux.x86_64/ which are not exactly matching KentUtils v308. I ran the pipeline and fortunately I am not getting the segmentation fault error anymore, but I am getting the error: Signal/Signal.UniqueMultiple.str1.out.bg is not case-sensitive sorted at line 5061610. Please use "sort -k1,1 -k2,2n" with LC_COLLATE=C, or bedSort and try again. I looked at the working directory and I can see the bedGraph file has been properly generated by STAR but it is not sorted in the way how BedGraphToBigWig expects. I sorted it manually sort -k1,1 -k2,2 and ran the bedGraphToBigWig commands and I could generate the bigwigs. I tested it with the revision [10fde60] that I was using previously on the old HPC and also tested with the master vesion [10fde60]. Both failed becasue the bedGraph is not sorted. do you think the unsorted BedGraph is related to STAR command: STAR --runThreadN 4 --runMode inputAlignmentsFromBAM --inputBAMfile iNGN_d8_DKO2_5019.IHECrsem.20221130.hs38_m4_n10_toGenome.bam --outWigType bedGraph --outWigStrand Stranded --outFileNamePrefix ./Signal/

asalhab commented 1 year ago

any update on this issue @emi80 ?