This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Help with summarizeOverlaps function in RNASeq analysis using R

Hi,

I am a new bioinformatics MSc student and I need help with the summarizeOverlaps function from the GenomicAlignments R package in order to perform a RNASeq analysis. I keep getting this error:

Error in array(x, c(length(x), 1L), if (!is.null(names(x))) list(names(x),  : 
  'data' must be of a vector type, was 'NULL'*.

Could someone help me to find where the problem is and how to fix it?

pacman::p_load(Rsamtools, GenomicFeatures, GenomicAlignments, org.Mm.eg.db)

gtfFile <- "genes.gtf"
txdb <- makeTxDbFromGFF(gtfFile, format = "gtf", organism = "Mus musculus")
genes <- exonsBy(txdb, by = "gene")
files <- list.files("/BAM", pattern = ".bam")
bamLst <- BamFileList(files, index=character(), obeyQname = TRUE)

PRJNA838600 <- summarizeOverlaps(features = genes,
                                 read = bamLst,
                                 mode = "Union",
                                 singleEnd = FALSE,
                                 ignore.strand = TRUE,
                                 fragments = FALSE)

save(PRJNA838600, file = "PRJNA838600.rda")
r rna-seq summarizeoverlaps genomicalignments

1) Which line of code produces the error?

2) Can you check the contents of your objects and post the results here?

head(c(txdb, genes, files, bamLst))

Why did you delete the post?

That comment from @Ram was directed at original poster. They probably had deleted this post after having received comment/answer.

1 answer

I'm guessing you are trying to get the gene expression counts from your BAM files. In this case, I suggest using featureCounts from the subread toolkit to quantify gene expression from BAM files generated with STAR (ideally the reads should be QC'ed/Trimmed). This is pretty much the community standard to process raw RNAseq fastq files.

The summarizeOverlaps count modes are fashioned after the "Union", "IntersectionStrict", and "IntersectionNotEmpty" methods found in HTSeq

Log in to answer this question.