I was using the Annotation.R script for running AnnotationSite as shown on the differential APA tutorial and ran into an error when creating an Rds file for the annotation (gtf). I tried it with the gtf provided in the tutorial and my own. I believe the issue is with line 74 (the following function):
x <- lapply(exons_grl, function(x) {
exonrank <- length(x$exon_rank)
if (as.character(strand(x)) == "+") {
x[exonrank]
} else{
x[1]
}
When a transcript has multiple exons, if (as.character(strand(x)) == "+") causes an error. When a transcript has multiple exons, as.character(strand(x)) has length >1 and is cannot be compared with "+." I solved the issue by replacing as.character(strand(x)) with as.character(unique(strand(x))). For reference, I am using the following versions of packages:
Hi all,
I was using the Annotation.R script for running AnnotationSite as shown on the differential APA tutorial and ran into an error when creating an Rds file for the annotation (gtf). I tried it with the gtf provided in the tutorial and my own. I believe the issue is with line 74 (the following function):
When a transcript has multiple exons,
if (as.character(strand(x)) == "+")
causes an error. When a transcript has multiple exons,as.character(strand(x))
has length >1 and is cannot be compared with "+." I solved the issue by replacingas.character(strand(x))
withas.character(unique(strand(x)))
. For reference, I am using the following versions of packages:GenomicRanges 1.50.0 GenomicFeatures 1.50.2 annotate 1.24.0 GenomicAlignments 1.34.0