I would like to add n
(e.g., 1k) bases to a PyRange object (i.e., shifting PyRanges coordinates).
How can I do that?
Input:
import pyranges as pr
gr = pr.random(3)
# gr:
# +--------------+-----------+-----------+--------------+
# | Chromosome | Start | End | Strand |
# | (category) | (int32) | (int32) | (category) |
# |--------------+-----------+-----------+--------------|
# | chr1 | 10000000 | 20000000 | - |
# | chr2 | 20000000 | 30000000 | + |
# | chr22 | 30000000 | 40000000 | - |
# +--------------+-----------+-----------+--------------+
Desired output:
# magical command[gr + 1000]:
# +--------------+-----------+-----------+--------------+
# | Chromosome | Start | End | Strand |
# | (category) | (int32) | (int32) | (category) |
# |--------------+-----------+-----------+--------------|
# | chr1 | 10001000 | 20001000 | - |
# | chr2 | 20001000 | 30001000 | + |
# | chr22 | 30001000 | 40001000 | - |
# +--------------+-----------+-----------+--------------+