我想通过使用包Rsubread获得RNA-Seq数据的读取计数。我从sra获得了RNA-Seq数据,并从NCBI汇编中获得了所有其他文件(基因,基因组等)。我在4种不同的生物体上尝试了以下代码,对于2种生物体,它可以正常工作,但对于其他两种生物,则出现以下错误:
错误:无法完成SAM文件!请检查输出目录中的磁盘空间。没有生成输出文件。
.load.delete.summary(output_file [i])中的Fehler:错误:未生成摘要文件Bacillus_amyloliquefaciens_samfile.sam.summary!程序错误地终止了!
有足够的可用磁盘空间。这是我的代码:
rna_counts <- function(path, organism, genome_gff, genome_fna, feature_table, reads_1, reads_2=NULL){
require(Rsubread)
require(rtracklayer)
require(biomaRt)
RNAseqDATADIR <- path
setwd(RNAseqDATADIR)
dir(RNAseqDATADIR)
REF_GENOME <- paste0("ref_data/",genome_fna)
RSUBREAD_INDEX_PATH <- "ref_data"
RSUBREAD_INDEX_BASE <- organism
buildindex(basename=file.path(RSUBREAD_INDEX_PATH,RSUBREAD_INDEX_BASE), reference=REF_GENOME)
inputfilefwd <- file.path(RNAseqDATADIR, paste0("raw_data/", reads_1))
if (!is.na(reads_2)) inputfilervs <- file.path(RNAseqDATADIR, paste0("/raw_data/", reads_2))
else inputfilervs <- NA
align(index=file.path(RSUBREAD_INDEX_PATH,RSUBREAD_INDEX_BASE), readfile1=inputfilefwd, readfile2=inputfilervs, output_file=paste0(organism,"_samfile.sam"), output_format="SAM",nthreads = 4)
outputsamfile <- paste0(path,"/", organism, "_samfile.sam")
propmap <- propmapped(outputsamfile)
feature_table <- read.table(paste0(path,"/ref_data/",feature_table),header=TRUE,sep = c("\t","\n"))
GENOME_GFF <- readGFF(paste0(path,"/ref_data/",genome_gff))
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)
}
输入:
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"
reads_1 = "SRR1916792_1.fastq"
reads_2 = "SRR1916792_2.fastq"
在计算过程中,还出现了以下打印输出,看上去有些毛病:
|| 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 ||
感谢您的帮助!