Rsubread: ERROR: cannot finish the SAM file
0
0
Entering edit mode
3.0 years ago

Hello everyone, I want to get the read counts for RNA-Seq data by using the package Rsubread. I got my RNA-Seq data from sra and all other files (genes, genome,...) from NCBI assembly. I tried the following code on 4 different organisms and for 2 it worked perfectly fine but for the other two I got the following error:

ERROR: cannot finish the SAM file! Please check the disk space in the output directory. No output file was generated.

Fehler in .load.delete.summary(output_file[i]) : ERROR: Summary file Bacillus_amyloliquefaciens_samfile.sam.summary was not generated! The program terminated wrongly!

There is enough disk space available. Here is my code:

rna_counts <- function(path, organism, genome_gff, genome_fna, feature_table, reads_1, reads_2=NULL){
require(rtracklayer)
require(biomaRt)

REF_GENOME <- paste0("ref_data/",genome_fna)

else inputfilervs <- NA

outputsamfile <- paste0(path,"/", organism, "_samfile.sam")
propmap <- propmapped(outputsamfile)

saf_file = gff_to_saf(GENOME_GFF)       # own function for creating a saf file
if is.na(reads_2)) paired = FALSE else paired = TRUE
feature_counts <-featureCounts(outputsamfile, annot.ext=saf_file, isPairedEnd=paired)
return(feature_counts)
}


Input:

genome_gff  = "GCA_000221645.1_ASM22164v1_genomic.gff"

genome_fna = "GCA_000221645.1_ASM22164v1_genomic.fna"

feature_table = GCA_000221645.1_ASM22164v1_feature_table.txt"



During the calculations there were also following print outs which look a bit buggy:

|| 311% completed, 17 mins elapsed, rate=7,8k fragments per second ||
|| 363% completed, 17 mins elapsed, rate=8,8k fragments per second ||
||365% completed, 18 mins elapsed, rate=8,7k fragments per second ||

RNA-Seq rna-seq rsubread • 1.3k views
1
Entering edit mode

Since you have enough space, I wonder if the problem is that something is wrong with your output directory. Maybe its not being named properly?

0
Entering edit mode

It is correct since there is a temporary SAM file in the directory while it is calculating and it works till a cerain point where it throws the error message. For the one organism it was always at 51% (tried it multiple times) and for the other 365% (which is a bit strange).

0
Entering edit mode

Hi! I hope you were able to figure out what was going on. Can I ask what your feature table input is? Is it like the metadata file? I'm learning this type of analysis and would love to understand this. Thanks a lot!