Hi,
When running the extractRanges function from the DMRcate package on a dmrcate.output object reporting only one DMR I get the following error:
Error in `$<-.data.frame`(`*tmp*`, "chromStart", value = integer(0)) : replacement has 0 rows, data has 3
It seems to me that in such case the function extractCoords doesn't report a data frame with coordinates, as it should, but a character vector instead.
What about something like?:
extractCoords <- function(xx)
{
coords <- sapply(xx, strsplit, '[:-]')
coords <- as.data.frame(do.call(rbind, coords), stringsAsFactors=F)
colnames(coords) <- c('chrom', 'chromStart', 'chromEnd')
return(coords)
}
Is it a valid solution?
R version 3.3.1 (2016-06-21) Platform: x86_64-pc-linux-gnu (64-bit) Running under: openSUSE 13.1 (Bottle) (x86_64) locale: [1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C [3] LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8 [5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 [7] LC_PAPER=en_US.UTF-8 LC_NAME=C [9] LC_ADDRESS=C LC_TELEPHONE=C [11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C attached base packages: [1] splines grid parallel stats4 stats graphics grDevices [8] utils datasets methods base other attached packages: [1] DMRcate_1.10.1 DMRcatedata_1.10.1 [3] DSS_2.14.0 bsseq_1.10.0 [5] minfi_1.20.0 bumphunter_1.14.0 [7] locfit_1.5-9.1 iterators_1.0.8 [9] foreach_1.4.3 Biostrings_2.42.0 [11] XVector_0.14.0 SummarizedExperiment_1.4.0 [13] Biobase_2.34.0 ComplexHeatmap_1.12.0 [15] gridExtra_2.2.1 limma_3.30.6 [17] ggplot2_2.2.0 GenomicRanges_1.26.1 [19] GenomeInfoDb_1.10.0 IRanges_2.8.0 [21] S4Vectors_0.12.0 BiocGenerics_0.20.0
Thanks,
Xavier
Hi Tim,
Thanks a lot :-),
Xavier