Closed lawremi closed 5 years ago
Fine with me to propagate the names but only if we also propagate the metadata columns:
library(GenomicRanges)
ir <- IRanges(1:5, 10, names=LETTERS[1:5])
mcols(ir)$score <- 21:25
irl <- split(ir, Rle(c("chr1", "chr2"), 2:3))
irl
# IRangesList of length 2
# $chr1
# IRanges object with 2 ranges and 1 metadata column:
# start end width | score
# <integer> <integer> <integer> | <integer>
# A 1 10 10 | 21
# B 2 10 9 | 22
#
# $chr2
# IRanges object with 3 ranges and 1 metadata column:
# start end width | score
# <integer> <integer> <integer> | <integer>
# C 3 10 8 | 23
# D 4 10 7 | 24
# E 5 10 6 | 25
as(irl, "GRanges")
# GRanges object with 5 ranges and 0 metadata columns:
# seqnames ranges strand
# <Rle> <IRanges> <Rle>
# [1] chr1 1-10 *
# [2] chr1 2-10 *
# [3] chr2 3-10 *
# [4] chr2 4-10 *
# [5] chr2 5-10 *
# -------
# seqinfo: 2 sequences from an unspecified genome; no seqlengths
Thanks!
@lawremi Are you planning to follow up on this or can we close the issue?
I was just wondering about this in the abstract and thought it would be good to record it. It sounds like you'd prefer it to be closed, so I'll go ahead and do that.
Thanks! If you're not going to do anything about this then there is no point in keeping the issue open. This coercion method is originally yours. Feel free to improve it as you wish. I already added a note in the source code many years ago about the names and metadata columns not being propagated https://github.com/Bioconductor/GenomicRanges/blob/550a4794511968d9b2a65fd269cc329ae94af831/R/GRanges-class.R#L337-L357 I don't feel that we also need to record this as an issue unless you feel it's actually an issue but it doesn't seem so.
Should this give
"foo"
orNULL
(as currently):