Code Monkey home page Code Monkey logo

multitax's People

Contributors

pirovc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

apduncan alienzj

multitax's Issues

urllib error

Hello, I have used the multitax package before to mainly translate taxon ids to the taxon name (e.g. 3702 -> Arabidopsis thaliana). When I run code that previously was working, now I get the following error:

>>> from multitax import NcbiTx
>>> ncbi_tx = NcbiTx()
Traceback (most recent call last):
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 1555, in ftp_open
    host = socket.gethostbyname(host)
socket.gaierror: [Errno -2] Name or service not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/site-packages/multitax/ncbitx.py", line 15, in __init__
    super().__init__(**kwargs)
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/site-packages/multitax/multitax.py", line 82, in __init__
    fhs = download_files(urls=urls if urls else self._default_urls,
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/site-packages/multitax/utils.py", line 71, in download_files
    fileobj=load_url_mem(url), mode='r:gz')
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/site-packages/multitax/utils.py", line 107, in load_url_mem
    urlstream = urllib.request.urlopen(url)
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 519, in open
    response = self._open(req, data)
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 536, in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/zfs/omics/personal/asanche2/miniconda3/envs/aa/lib/python3.10/urllib/request.py", line 1557, in ftp_open
    raise URLError(msg)
urllib.error.URLError: <urlopen error [Errno -2] Name or service not known>

Library returns 404

Hi, I just ran these three commands, and it raises an Exception:

xapple@local ~ $ python3 -m pip install --user multitax
xapple@local ~ $ ipython3

In [1]: from multitax import GtdbTx

In [2]: tax = GtdbTx()

HTTPError: HTTP Error 404: Not Found

Translation between Silva and NCBI

Hi there,

The translation table says that from Silva to NCBI is fully implemented and from NCBI to Silva is partially implemented. And yet I get the following errors.

from multitax import SilvaTx, NcbiTx

silva_tax = SilvaTx()
ncbi_tax = NcbiTx()

ncbi_tax.build_translation(silva_tax)
# /path/to/multitax/ncbitx.py:86: UserWarning: Translation between taxonomies [NcbiTx,SilvaTx] not yet implemented.

silva_tax.build_translation(ncbi_tax)
# /path/to/multitax/silvatx.py:17: UserWarning: Translation between taxonomies [SilvaTx,NcbiTx] not yet implemented.

Is this because the linkage data isn't available in the default data? I'm new to microbiome taxonomy, and some clarity on what linkage data is would be greatly appreciated.

Changed GTDB metadata naming and format

I was attempting to map from NCBI to GTDB taxonomy, when building translation multitax was unable to download GTDB metadata

from multitax import GtdbTx, NcbiTx

ncbi = NcbiTx()
gtdb = GtdbTx()

ncbi.build_translation(gtdb)

Exception: One or more files could not be downloaded: https://data.gtdb.ecogenomic.org/releases/latest/ar53_metadata.tar.gz, https://data.gtdb.ecogenomic.org/releases/latest/bac120_metadata.tar.gz

For r214.1, the metadata is no longer a tarball, appears to be a gzipped tsv: bac120_metadata.tsv.gz, ar53_metadta.tsv.gz. Looks like it would need some different handling in build_translation as well as that extract tar members.

I'd be happy to put together a pull request to fix, if you're interested.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.