R/sortGR.R

Defines functions sortGR

Documented in sortGR

sortGR <- function(.ele){
    str <- as.character(strand(.ele))[1] == "+"
    if(str){ ## sort the element by position
        .ele <- .ele[order(start(.ele))]
    }else{
        .ele <- .ele[order(-end(.ele))]
    }
    .ele
}

Try the InPAS package in your browser

Any scripts or data that you put into this service are public.

InPAS documentation built on Nov. 8, 2020, 5:03 p.m.