You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@stuppie
I refactored a bit of the phenotype_similarity code but the overall functionality still stays the same.
I ran into the following issue when trying to do a similarity search:
Traceback (most recent call last):
File "pheno_test.py", line 24, in <module>
File "/Users/deepak.unni3/GIT/mvp-module-library/Modules/phenotype_similarity.py", line 50, in similarity_search
self.phenogene_score = reduce(lambda x, y: pd.merge(x, y, on='id').set_index('id').sum(axis=1), self.results)
File "/Users/deepak.unni3/GIT/mvp-module-library/Modules/phenotype_similarity.py", line 50, in <lambda>
self.phenogene_score = reduce(lambda x, y: pd.merge(x, y, on='id').set_index('id').sum(axis=1), self.results)
File "/Users/deepak.unni3/GIT/mvp-module-library/env/lib/python3.6/site-packages/pandas/core/reshape/merge.py", line 61, in merge
validate=validate)
File "/Users/deepak.unni3/GIT/mvp-module-library/env/lib/python3.6/site-packages/pandas/core/reshape/merge.py", line 524, in __init__
'type {left}'.format(left=type(left)))
ValueError: can not merge DataFrame with instance of type <class 'pandas.core.series.Series'>
I am not entirely sure what that line is trying to do.
Test script used:
fromBioLink.biolink_clientimportBioLinkWrapperfromSimSearch.simsearch_clientimportSimSearchWrapperinput_disease='MONDO:0019391'# Fanconi Anemiablw=BioLinkWrapper()
# get fa related genes from BioLinkfa_gene_associations=blw.disease2genes(input_disease)
fa_gene_curies=fa_gene_associations['objects']
fa_gene_curiesfromModules.phenotype_similarityimportPhenotypeSimilarityp=PhenotypeSimilarity()
p.load_gene_set(fa_gene_curies,taxon='9606')
p.load_associations()
p.similarity_search()
The text was updated successfully, but these errors were encountered:
I cannot run it because it says it cannot find "ontobio.analysis" (link). (I installed ontobio from pip and cloned git repo, but still doesn't find it).
But I see its a bug anyways!! I'm summing the df before finishing the reduce! reduce(lambda x, y: pd.merge(x, y, on='id').set_index('id').sum(axis=1), self.results)
should be reduce(lambda x, y: pd.merge(x, y, on='id'), self.results).set_index('id').sum(axis=1)
The line is merging all of the dataframes in that list together, and then summing the counts
Also, there is another bug. Should be doing an outer join not inner (the default) reduce(lambda x, y: pd.merge(x, y, on='id', how='outer'), self.results).set_index('id').sum(axis=1)
Whoops. A recently merged PR relies on a new release of Ontobio.
You can comment out the breaking line from GenericSimilarity and then run your code for Phenotype Similarity. That should still work.
I'll create another issue for the ontobio.analysis error.
@stuppie
I refactored a bit of the phenotype_similarity code but the overall functionality still stays the same.
I ran into the following issue when trying to do a similarity search:
I am not entirely sure what that line is trying to do.
Test script used:
The text was updated successfully, but these errors were encountered: