If your data is in a data.frame (see below), using the Bioconductor GenomicRanges package I create a GRanges instance, keeping the non-range columns too library(GenomicRanges) gr <- makeGRangesFromDataFrame(df, TRUE) The discrete ranges represented by the data are given by the disjoin function, and the overlap between the disjoint ranges ('query')...

r,concatenation,bioinformatics,bioconductor,genome

I couldn't think of any pretty solution using basic dataframe manipulation, so here's a bad-looking one that works: First, add stringsAsFactors to df creation: df <- read.table(text=df, header=T, stringsAsFactors = FALSE) start <- df$Position[1] end <- integer() output <- NULL count <- 1 for (i in 1:(nrow(df)-1)) { if(df$Bel[i] <...

r,apply,data-conversion,bioconductor,genome

This is just a warning, not an error. A simple web search found: https://www.biostars.org/p/122005/...

I suggest to use bedtools: http://bedtools.readthedocs.org/en/latest/ Intersect function likely does what you want. Also, using bedtools or not, algorithm can be improved by first sorting the two input files....

The code: p.adjust # typed at command line prints out the code # copy the body of the function ... is really very simple and all R. Just redefine a function that comments out that stopifnot() line: my.p.adj <- function (p, method = p.adjust.methods, n = length(p)) # paste the...