Is there an easy way to do pos(x) <- pos(x) + 1 for a GPos object ?
1
0
Entering edit mode
@charles-plessy-7857
Last seen 14 months ago
Japan

Hello,

I have some single-nucleotide positions in a GPos object, and I would like to move them of one base. But pos<- does not seem to be implemented and shift fail…

p <- GPos("chr1:10:+", stitch = FALSE)

pos(p) <- pos(p) + 1
    Error in pos(p) <- pos(p) + 1 : impossible de trouver la fonction "pos<-"

shift(p, 1)
    Error in (function (classes, fdef, mtable)  : 
      unable to find an inherited method for function ‘update_ranges’ for signature ‘"UnstitchedIPos"’

edit: I suppose there is some kind of hadean punishment for something like p@ranges@pos <- p@ranges@pos + 1L ?

GenomicRanges GPos • 848 views
ADD COMMENT
0
Entering edit mode
ATpoint ★ 4.5k
@atpoint-13662
Last seen 2 days ago
Germany
p2 <- GPos(seqnames = seqnames(p), pos = start(p)+1)
ADD COMMENT

Login before adding your answer.

Traffic: 531 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6