-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot retrieve progeny weights for mouse: url for homologene needs to be updated #278
Comments
Hello @ruhisayana , Thanks for reporting this! I'll check the HomoloGene URL soon, however, we've recently transitioned to OMA (orthologous Matrix) as the default resource for orthology data. And I think since then, using the release that I've just published today, it should work fine. I've just tested PROGENy access (by Best, Denes |
Hi, I'm having a similar issue when trying to run progeny = dc.get_progeny(organism = 'mouse', top=500) with pypath-omnipath version 0.16.9 and decoupler version 1.6.0. I have also installed via pip install git+https://github.com/saezlab/pypath.git and it shows up when I run pip show pypath-omnipath, but am getting an import error when I try to run dc.get_progeny with mouse (it works fine with human). Any help you can provide would be much appreciated.
|
Hi @haleymac, Yours looks like a different issue. I was unable to reproduce it with the latest versions of
The error happens here, then check the log:
Also, you can check directly if any of these fail with error:
Best, Denes |
Btw, since c257159 HomoloGene access should be fine too (though it shouldn't affect |
Describe the bug
UPDATE:
The main issue seems to be that the url for homologene is inactive - would it be possible for this to be updated?
Original:
I'm trying to run
progeny = dc.get_progeny(organism = 'Mus musculus', top=500)
in Python 3.9 with decoupler-py 1.5 and pypath-omnipath version 0.16.4. I'm getting a modulenotfound error for pypath-omnipath even though I've installed viapip install git+https://github.com/saezlab/pypath.git
and it shows up when I runpip show pypath-omnipath
. The command works fine when I don't use organism='Mus musculus' or organism='mouse' and seems to be related to both not being able to import homology and the translate_net function.To Reproduce
Steps to reproduce the behavior:
progeny = dc.get_progeny(organism = 'Mus musculus', top=500)
orprogeny = dc.get_progeny(organism = 'mouse', top=500)
Expected behavior
Expected to get progeny annotation. Command works when I run
progeny = dc.get_progeny(top=500)
, so for human.Traceback (UPDATED)
TypeError Traceback (most recent call last)
Cell In[2], line 5
3 sys.path.insert(0, "~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath")
4 print(sys.path)
----> 5 progeny = dc.get_progeny(organism='mouse',top=500)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/decoupler/omnip.py:160, in get_progeny(organism, top, **kwargs)
156 p.columns = ['source', 'target', 'weight', 'p_value']
158 if not _is_human(organism):
--> 160 p = translate_net(
161 p,
162 columns='target',
163 source_organism=9606,
164 target_organism=organism,
165 )
167 return p.reset_index(drop=True)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/decoupler/omnip.py:587, in translate_net(net, columns, source_organism, target_organism, id_type, unique_by, **kwargs)
584 hom_net = net.copy()
586 # Translate
--> 587 hom_net = homology.translate_df(
588 df=hom_net,
589 target=_target_organism,
590 cols=columns,
591 source=_source_organism,
592 )
594 unique_by = common.to_list(unique_by)
596 if unique_by and all(c in hom_net.columns for c in unique_by):
597
598 # Remove duplicated based on source and target
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:1904, in translate_df(df, target, cols, source, homologene, ensembl, ensembl_hc, ensembl_types, **kwargs)
1901 args.pop('manager')
1902 kwargs = args.pop('kwargs')
-> 1904 return manager.translate_df(**args, **kwargs)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:483, in HomologyManager.translate_df(self, df, target, cols, source, homologene, ensembl, ensembl_hc, ensembl_types, **kwargs)
480 source = taxonomy.ensure_ncbi_tax_id(source)
481 target = taxonomy.ensure_ncbi_tax_id(target)
--> 483 table = self.which_table(
484 target = target,
485 source = source,
486 )
488 param = self._translation_param(locals())
490 return table.translate_df(
491 df = df,
492 cols = cols,
(...)
495 **kwargs
496 )
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:184, in HomologyManager.which_table(self, target, source, only_swissprot)
180 self.expiry[key] = time.time()
182 if key not in self.tables:
--> 184 self.load(key)
186 if key in self.tables:
188 return self.tables[key]
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:215, in HomologyManager.load(self, key)
208 self._log(
209 'Homology table from taxon %u to %u (only SwissProt: %s) '
210 'has been loaded from
%s
.' % (key + (cachefile,))211 )
213 else:
--> 215 self.tables[key] = self._load(key)
216 pickle.dump(self.tables[key], open(cachefile, 'wb'))
217 self._log(
218 'Homology table from taxon %u to %u (only SwissProt: %s) '
219 'has been saved to
%s
.' % (key + (cachefile,))220 )
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:225, in HomologyManager._load(self, key)
223 def _load(self, key):
--> 225 return ProteinHomology(
226 target = key[1],
227 source = key[0],
228 only_swissprot = key[2],
229 homologene = self.homologene,
230 ensembl = self.ensembl,
231 ensembl_hc = self.ensembl_hc,
232 ensembl_types = self.ensembl_types,
233 )
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:718, in ProteinHomology.init(self, target, source, only_swissprot, homologene, ensembl, ensembl_hc, ensembl_types)
714 self.load_proteome(self.target, self.only_swissprot)
716 if source is not None:
--> 718 self.load(source)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:734, in ProteinHomology.load(self, source)
730 def load(self, source = None):
732 if self.homologene:
--> 734 self.load_homologene(source)
736 if self.ensembl:
738 self.load_ensembl(source)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/utils/homology.py:1175, in ProteinHomology.load_homologene(self, source)
1171 if source not in self.orthologs:
1173 self.orthologs[source] = collections.defaultdict(set)
-> 1175 hge = homologene_input.homologene_dict(source, self.target, 'entrez')
1176 hgr = homologene_input.homologene_dict(source, self.target, 'refseq')
1178 self.load_proteome(source, self.only_swissprot)
File ~/opt/miniconda3/envs/py39/lib/python3.9/site-packages/pypath/inputs/homologene.py:95, in homologene_dict(source, target, id_type)
92 hgroup = None
93 result = collections.defaultdict(set)
---> 95 for l in hg:
97 l = l.strip().split('\t')
98 this_hgroup = l[0].strip()
TypeError: 'NoneType' object is not iterable
Log file
n/a
Desktop (please complete the following information):
The text was updated successfully, but these errors were encountered: