Skip to content

Commit

Permalink
ramp_raw optionally remove prefixes from sourceIds
Browse files Browse the repository at this point in the history
  • Loading branch information
for-hyde committed Nov 22, 2024
1 parent a6c930a commit 455d0c7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pypath/inputs/ramp/_sqlite.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ def ramp_raw(
tables: str | list[str] = None,
sqlite: bool = False,
return_df: bool = True,
**kwargs
prefixes: bool = True,
**kwargs,
) -> dict[str, list[tuple] | pd.DataFrame | sqlite3.Connection]:
"""
Retrieve RaMP database contents from its SQLite build.
Expand Down Expand Up @@ -176,6 +177,9 @@ def ramp_raw(

result = {t: callback(t) for t in tables}

if not prefixes and 'source' in result:
result['source'].sourceId = result['source'].sourceId.apply(lambda x: x.split(':', maxsplit = 1)[1])

if len(result) == 1:

result = _misc.first(result.values())
Expand Down

0 comments on commit 455d0c7

Please sign in to comment.