Skip to content

Annotation.R strand(x) may have length >1 when a transcript has multiple exons.  #8

@pratibhajagannatha

Description

@pratibhajagannatha

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):

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:

GenomicRanges 1.50.0
GenomicFeatures 1.50.2
annotate 1.24.0
GenomicAlignments 1.34.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions