Skip to content

Commit

Permalink
Merge branch 'grl-parser' of https://github.com/BiocPy/rds2py into gr…
Browse files Browse the repository at this point in the history
…l-parser
  • Loading branch information
jkanche committed Jul 14, 2024
2 parents 02ea395 + 7dde91b commit 4e7ffb9
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/rds2py/granges.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,25 @@ def as_granges(robj):
_fstrand.extend([_strds[i]] * x)

_seqinfo_seqnames = robj["attributes"]["seqinfo"]["attributes"]["seqnames"]["data"]
_seqinfo_seqlengths = robj["attributes"]["seqinfo"]["attributes"]["seqlengths"]["data"]
_seqinfo_is_circular = robj["attributes"]["seqinfo"]["attributes"]["is_circular"]["data"]
_seqinfo_seqlengths = robj["attributes"]["seqinfo"]["attributes"]["seqlengths"][
"data"
]
_seqinfo_is_circular = robj["attributes"]["seqinfo"]["attributes"]["is_circular"][
"data"
]
_seqinfo_genome = robj["attributes"]["seqinfo"]["attributes"]["genome"]["data"]
_seqinfo = SeqInfo(
seqnames=_seqinfo_seqnames,
seqlengths=[None if x == -2147483648 else int(x) for x in _seqinfo_seqlengths],
is_circular=[None if x == -2147483648 else bool(x) for x in _seqinfo_is_circular],
is_circular=[
None if x == -2147483648 else bool(x) for x in _seqinfo_is_circular
],
genome=_seqinfo_genome,
)

_mcols = BiocFrame.from_pandas(as_pandas_from_dframe(robj["attributes"]["elementMetadata"]))
_mcols = BiocFrame.from_pandas(
as_pandas_from_dframe(robj["attributes"]["elementMetadata"])
)

_gr_names = None
if "NAMES" in robj["attributes"]:
Expand Down

0 comments on commit 4e7ffb9

Please sign in to comment.