Skip to content

Commit

Permalink
Merge pull request #127 from GoekeLab/quant-dev
Browse files Browse the repository at this point in the history
Fixed bugs when running extend annotations

Former-commit-id: af94ef2
  • Loading branch information
cying111 authored Jul 1, 2020
2 parents 21bb0af + 396ec58 commit c905238
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions R/isore.R
Original file line number Diff line number Diff line change
Expand Up @@ -437,24 +437,26 @@ isore.extendAnnotations <- function(se,
fragmentStarts=rowData(seFilteredSpliced)$intronStarts,
fragmentEnds=rowData(seFilteredSpliced)$intronEnds,
strand=rowData(seFilteredSpliced)$strand)

names(intronsByReadClass) <- 1:length(intronsByReadClass)
seqlevels(intronsByReadClass) <- unique(c(seqlevels(intronsByReadClass), seqlevels(annotationGrangesList)))

exonEndsShifted <-paste(rowData(seFilteredSpliced)$intronStarts,
rowData(seFilteredSpliced)$end + 1,
as.integer(rowData(seFilteredSpliced)$end + 1),
sep=',')
exonStartsShifted <- paste(rowData(seFilteredSpliced)$start - 1,
exonStartsShifted <- paste(as.integer(rowData(seFilteredSpliced)$start - 1),
rowData(seFilteredSpliced)$intronEnds,
sep=',')

exonsByReadClass <- makeGRangesListFromFeatureFragments(seqnames=rowData(seFilteredSpliced)$chr,
fragmentStarts=exonStartsShifted,
fragmentEnds=exonEndsShifted,
strand=rowData(seFilteredSpliced)$strand)

exonsByReadClass <- narrow(exonsByReadClass, start = 2, end = -2) # correct junction to exon differences in coordinates

names(exonsByReadClass) <- 1:length(exonsByReadClass)

# add exon start and exon end rank
unlistData <- unlist(exonsByReadClass, use.names = FALSE)
partitioning <- PartitioningByEnd(cumsum(elementNROWS(exonsByReadClass)), names=NULL)
Expand Down

0 comments on commit c905238

Please sign in to comment.