Closed merlevede closed 9 months ago
Hi @merlevede, I also noticed it. I will make sure to have it accessible in the next update (should be very soon).
Hi @merlevede, I also noticed it. I will make sure to have it accessible in the next update (should be very soon).
Great, thanks a lot @dbdimitrov! Just to have an idea about what you mean by "very soon", is it a couple of days? I had nice results in my former analysis that I wanted to report for a project deliverable that I have to deliver in the coming days.
Hi @merlevede,
It might take me more than a couple of days, in the meantime you can use the folllowing function to replace the one that is used in the decoupler tutorial:
def explode_complexes(resource: pd.DataFrame,
SOURCE='ligand',
TARGET='receptor') -> pd.DataFrame:
"""
Function to explode ligand-receptor complexes
Parameters
----------
resource
Ligand-receptor resource
SOURCE
Name of the source (typically ligand) column
TARGET
Name of the target (typically receptor) column
Returns
-------
A resource with exploded complexes
"""
resource['interaction'] = resource[SOURCE] + '&' + resource[TARGET]
resource = (resource.set_index('interaction')
.apply(lambda x: x.str.split('_'))
.explode([TARGET])
.explode(SOURCE)
.reset_index()
)
resource[[f'{SOURCE}_complex', f'{TARGET}_complex']] = resource[
'interaction'].str.split('&', expand=True)
return resource
This should be resolved now with the latest update.
Hello,
To make my analysis reproducible, I am creating an environment for my decoupler analyses and I am not able to run the liana quantification anymore. I am using the code described in the doc to perform this analysis:
I get the following error message:
'liana.resource' has no attribute 'explode_complexes'
It seems that the code of liana select_resource was updated last month. I have the impression that the function ln.resource.explode_complexes is not accessible anymore.
Have you encountered a similar issue?
I am using the following versions: decoupler 1.4.0 liana 1.0.3
Thanks for your help.