Hi,
This works with the latest devel version of GenomicRanges (1.37.13):
GPos("A", pos=IPos("3-8"))
# StitchedGPos object with 9 positions and 0 metadata columns:
# seqnames pos strand
# <Rle> <integer> <Rle>
# [1] A 3 *
# [2] A 4 *
# [3] A 5 *
# [4] A 6 *
# [5] A 7 *
# [6] A 8 *
# -------
# seqinfo: 1 sequence from an unspecified genome; no seqlengths
GPos("chr1", pos=IPos(1:3))
# UnstitchedGPos object with 3 positions and 0 metadata columns:
# seqnames pos strand
# <Rle> <integer> <Rle>
# [1] chr1 1 *
# [2] chr1 2 *
# [3] chr1 3 *
# -------
# seqinfo: 1 sequence from an unspecified genome; no seqlengths
However, please note that the 2nd argument of the GPos()
constructor function is named pos
rather than ranges
:
args(GRanges)
# function (seqnames = NULL, ranges = NULL, strand = NULL, ...,
# seqinfo = NULL, seqlengths = NULL)
# NULL
args(GPos)
# function (seqnames = NULL, pos = NULL, strand = NULL, ...,
# seqinfo = NULL, seqlengths = NULL, stitch = NA)
# NULL
Also note that IPos and GPos objects now exist in 2 flavors: unstitched and stitched. The stitched flavor corresponds to what IPos and GPos objects used to be. See ?IPos
and ?GPos
for more information.
Best,
H.