Giter VIP home page Giter VIP logo

saezlab / pypath Goto Github PK

View Code? Open in Web Editor NEW
128.0 24.0 42.0 144.27 MB

Python module for prior knowledge integration. Builds databases of signaling pathways, enzyme-substrate interactions, complexes, annotations and intercellular communication roles.

Home Page: http://omnipathdb.org/

License: GNU General Public License v3.0

Shell 0.02% Python 99.96% HTML 0.02%
python pathway resource database network genetic-regulatory-network molecular-biology

pypath's Introduction

pypath: A Python module for molecular signaling prior knowledge processing

OmniPath

Are you interested in OmniPath data? Check out our R package OmnipathR, the most popular and most versatile access point to OmniPath, a database built from more than 150 original resources. If you use Python and don't need to build the database yourself, try our Python client. Read more about the web service here.

Do you need pypath?

Pypath is the database builder of OmniPath. For most people the data distributed in OmniPath is satisfying (see above), they don't really need pypath. Typically you need pypath to:

  • Build a custom or very fresh version of the OmniPath database(s)
  • Use one of the utilities such as ID translation, homology translation, etc. (see the utils module)
  • Access the raw or preprocessed data directly from the original resources (see the inputs module)

Installation

From PyPI:

pip install pypath-omnipath

From Git:

pip install git+https://github.com/saezlab/pypath.git

Docs

Read the reference documentation or check out the tutorials. The most comprehensive guide to pypath is The Pypath Book.

Get help

Should you have a question or experiencing an issue, please write us by the Github issues page.

Features

pypath is a Python module for processing molecular biology data resources, combining them into databases and providing a versatile interface in Python as well as exporting the data for access through other platforms such as R, web service, Cytoscape and BEL (Biological Expression Language).

pypath provides access to more than 100 resources! It builds 5 major combined databases and within these we can distinguish different datasets. The 5 major databases are interactions (molecular interaction network or pathways), enzyme-substrate relationships, protein complexes, molecular annotations (functional roles, localizations, and more) and inter-cellular communication roles.

pypath consists of a number of submodules and each of them again contains a number of submodules. Overall pypath consists of around 100 modules. The most important higher level submodules:

  • pypath.core: contains the database classes e.g. network, complex, annotations, etc
  • pypath.inputs: contains the resource specific methods which directly downlad and preprocess data from the original sources
  • pypath.omnipath: higher level applications, e.g. a database manager, a web server
  • pypath.utils: stand alone useful utilities, e.g. identifier translator, Gene Ontology processor, BioPax processor, etc

Integrated databases

In the beginning the primary aim of pypath was to build networks from multiple sources using an igraph object as the fundament of the integrated data structure. From version 0.7 and 0.8 this design principle started to change. Today pypath builds a number of different databases, exposes them by a rich API and each of them can be converted to pandas.DataFrame. The modules and classes responsible for the integrated databases are located in pypath.core. The five main databases are the followings:

  • network - core.network
  • enzyme-substrate - core.enz_sub
  • complexes - core.complex
  • annotations - core.annot
  • intercell - core.intercell

Some of the databases have different variants (e.g. PPI and transcriptional network) and all can be customized by many parameters.

Database management

The databases above can be loaded by calling the appropriate classes. However building the databases require time and memory so we want to avoid building them more often than necessary or keeping more than one copies in the memory. Some of the modules listed above have a method get_db which ensures only one instance of the database is loaded. But there is a more full featured database management system available in pypath, this is the pypath.omnipath module. This module is able to build the databases, automatically saves them to pickle files and loads them from there in subsequent sessions. pypath comes with a number of database definitions and users can add more. The pickle files are located by default in the ~/.pypath/pickles/ directory. With the omnipath module it's easy to get an instance of a database. For example to get the omnipath PPI network dataset:

from pypath import omnipath
op = omnipath.db.get_db('omnipath')

Important: Building the databases for the first time requires the download of several MB or GB of data from the original resources. This normally takes long time and is prone of errors (e.g. truncated or empty downloads due to interrupted HTTP connection). In this case you should check the log to find the path of the problematic cache file, check the contents of this file to find out the reason and possibly delete the file to ensure another download attempt when you call the database build again. Sometimes the original resources change their content or go offline. If you encounter such case please open an issue at https://github.com/saezlab/pypath/issues so we can fix it in pypath. Once all the necessary contents are downloaded and stored in the cache, the database builds are much faster, but still can take minutes.

Further modules in pypath

Apart from the databases, pypath has many submodules with standalone functionality which can be used in other modules and scripts. Below we present a few of these.

ID conversion

The ID conversion module utils.mapping translates between a large variety of gene, protein, miRNA and small molecule ID types. It has the feature to translate secondary UniProt ACs to primaries, and Trembl ACs to SwissProt, using primary Gene Symbols to find the connections. This module automatically loads and stores the necessary conversion tables. Many tables are predefined, such as all the IDs in UniProt mapping service, while users are able to load any table from file using the classes provided in the module input_formats. An example how to translate identifiers:

from pypath.utils import mapping
mapping.map_name('P00533', 'uniprot', 'genesymbol')
# {'EGFR'}

Homology translation

The pypath.utils.homology module is able to find the orthologs of genes between two organisms. It uses data both from NCBI HomoloGene, Ensembl and UniProt. This module is really simple to use:

from pypath.utils import homology
homology.translate('P00533', 10090) # translating the human EGFR to mouse
# ['Q01279'] # it returns the mouse Egfr UniProt AC

It is able to handle any ID type supported by pypath.utils.mapping. Alternatively, you can access a complete dictionary of orthologous genes, or translate columns in a pandas data frame.

FAQ

Does it run on my old Python?

Most likely it doesn't. The oldest supported version, currently 3.9, is defined in our pyproject.toml.

Is there something similar in R?

OmniPath's R client, besides accessing data from OmniPath, provides many similar services as pypath: ID translation, homology translation, taxonomy support, GO support, and many more.

Questions about OmniPath

Contact

We prefer to keep all communication within the Github issues. About private or sensitive matters feel free to contact us by [email protected].

Impressum

The development of pypath is coordinated by Dénes Türei in the Saez Lab, with the contribution of developers and scientists from other groups:

  • Erva Ulusoy, Melih Darcan, Ömer Kaan Vural, Tennur Kılıç, Elif Çevrim, Bünyamin Şen, Atabey Ünlü and Mert Ergün in the HU Biological Data Science Lab (PI: Tunca Doğan) created many new input modules in pypath;
  • Leila Gul, Dezső Módos, Márton Ölbei and Tamás Korcsmáros in the Korcsmaros Lab contributed to the overall design of OmniPath, the design and implementation of the intercellular communication database, and with various case studies and tutorials;
  • Michael Klein from the group of Fabian Theis developed the Python client for the OmniPath web service;
  • Charles Tapley Hoyt and Daniel Domingo-Fernández added the BEL export module.
  • From the Saez Lab, Olga Ivanova introduced the resource manager in pypath, Sophia Müller-Dott added the CollecTRI gene regulatory network, while Nicolàs Palacio, Sebastian Lobentanzer and Ahmet Rifaioglu have done various maintenance and refactoring works. Aurelien Dugourd and Christina Schmidt helped with the design of the metabolomics related datasets and services.
  • The R package and the Cytoscape app are developed and maintained by Francesco Ceccarelli, Attila Gábor, Alberto Valdeolivas, Dénes Türei and Nicolàs Palacio;
  • The first logo of OmniPath has been designed by Jakob Wirbel (Saez Lab), the current logo by Dénes Türei, while the cover graphics for Nature Methods is the work of Spencer Phillips from EMBL-EBI.

History and releases

See here a bird eye view of pypath's development history. For more details about recent developments see the Github releases.

pypath's People

Contributors

ahmetrifaioglu avatar atabeyunlu avatar bnymnsen avatar chernan avatar cthoyt avatar deeenes avatar dependabot[bot] avatar dnjst avatar ervau avatar gabora avatar ivanovaos avatar jakob-wirbel avatar melihdarcanxyz avatar mert-ergun avatar nic-nic avatar omerkaanvural avatar slobentanzer avatar smuellerd avatar tnnrklc 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pypath's Issues

Installation docs

You can use pip to install directly from github:

pip install git+https://github.com/saezlab/bioigraph.git

This way, you wouldn't need the local build instructions or the .tar.gz file in dist.

You should probably also mention that the igraph C library is required and not handled by pip.

PTMs for rat

I just tried to load the PTM network for rat using pypath but results in a network with 0 nodes and 0 interactions. What I did is:

pa = pypath.PyPath(ncbi_tax_id=10116)
pa.init_network(pypath.data_formats.ptm_all)

which after some ¨processing¨ gives this:

	### ERROR ###### Missing reference list for protein (default name type:
	uniprot), in taxon 10116
	Missing reference list for protein (default name type: uniprot), in taxon 10116

 > 0 interactions between 0 nodes
 from 0 resources have been loaded,
 for details see the log: ./log/k58ir.log

:(

Issue with loading data

After running the following (paraphrased) code (which is inside the CLI for the bel.py module)

from pypath import PyPath, data_formats
pa = PyPath()
pa.init_network(data_formats.pathway)

I got the following logging containing several errors/exceptions:

(hbp) [524] [11:52] [cthoyt@wlan-241:~/dev/pypath/src]
$ python pypath/bel.py bel
        :: Module `cairo` not available.
           Some plotting functionalities won't be accessible.
        :: Module `pygraphviz` not available.
           You don't need it unless you want to export dot files.

        :: Module `pysftp` not available. 
        Only downloading of a small number of resources 
        relies on this module.
        Please install by PIP if it is necessary for you.
        :: Module `bioservices` not available.
No module `cairo` available.
Some plotting functionalities won't be accessible.
        :: Module `hcluster` not available.

        === d i s c l a i m e r ===

        All data coming with this module
        either as redistributed copy or downloaded using the
        programmatic interfaces included in the present module
        are available under public domain, are free to use at
        least for academic research or education purposes.
        Please be aware of the licences of all the datasets
        you use in your analysis, and please give appropriate
        credits for the original sources when you publish your
        results. To find out more about data sources please
        look at `pypath.descriptions` and
        `pypath.data_formats.urls`.

        > New session started,
        session ID: 'dnzki'
        logfile: './log/dnzki.log'
        pypath version: 0.7.121
        Downloading `` from www.uniprot.org -- 0.00B downloaded: : 1.34Mit [00:39, 12.2kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/582ab5c0b5fffa42fb3e8d1757901ea1-`.
        :: Loading data from cache previously downloaded from www.uniprot.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/582ab5c0b5fffa42fb3e8d1757901ea1-`.
 > TRIP
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 430kit [00:05, 37.7kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/fe747bcda0777e9f7cd8b1ab47db1538-show`.
                could not find uniprot for Gơq/11
                could not find uniprot for Ƣ-tubulin-5
                could not find uniprot for ơ-actinin
                could not find uniprot for ơ-actinin-1
                could not find uniprot for ơ1-syntrophin
                could not find uniprot for PLCƣ1
                could not find uniprot for VAMP
                could not find uniprot for Homer
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 125kit [00:01, 21.5kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/cb1a9773e75b45415423b000eb70a4a4-show`.
                could not find uniprot for TRPC2
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/76731af40f25e153c424547e40373728-show`.
                could not find uniprot for 14-3-3 protein Ƣ/ơ
                could not find uniprot for 14-3-3 protein ƥ
                could not find uniprot for 14-3-3 protein Ƨ
                could not find uniprot for ATP synthase Ƣ
                could not find uniprot for Gơq
                could not find uniprot for Gz-ơ
                could not find uniprot for NKAơ1
                could not find uniprot for NKAơ2
                could not find uniprot for NKAơ3
                could not find uniprot for ơSNAP
                could not find uniprot for PKCƢ
                could not find uniprot for PLCƢ1
                could not find uniprot for PLCƣ2
                could not find uniprot for PLCƢ2
                could not find uniprot for PLCƢ3
                could not find uniprot for RyR
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/66325b3451fbe1d75a70d463396b725c-show`.
                could not find uniprot for Gơi2
                could not find uniprot for Ƣ-catenin
                could not find uniprot for ƢV-spectrin
                could not find uniprot for ơII-spectrin
                could not find uniprot for SHANK
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/c5f2ffd31855a92f7e488289af6d958a-show`.
                could not find uniprot for CaMKIIƢ
                could not find uniprot for Gơi3
                could not find uniprot for ƢII-spectrin
                could not find uniprot for ƢIII-spectrin
                could not find uniprot for ơ-actinin-4
                could not find uniprot for ơ2-actin
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/ce6ceb6edff7641e5526d53c5a68f460-show`.
                could not find uniprot for PKCơ
                could not find uniprot for TRPC2
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/7f61ed4b9bf1b751d96529758c866ce5-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 383kit [00:03, 59.8kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/07a8b3ce8b01eb8c5b54e58fac2278f5-show`.
                could not find uniprot for Actin
                could not find uniprot for Akt
                could not find uniprot for AMPKơ2
                could not find uniprot for CaMKII
                could not find uniprot for Catenin-ơ2
                could not find uniprot for Catenin-Ƥ2
                could not find uniprot for Ƣ-arrestin 2
                could not find uniprot for Ƣ-tubulin-3
                could not find uniprot for KPNƢ1
                could not find uniprot for KvƢ2
                could not find uniprot for ơ-tubulin-1A
                could not find uniprot for ơ-tubulin-1B
                could not find uniprot for ơENaC
                could not find uniprot for PI3K-p85Ƣ
                could not find uniprot for PI3K-p85ơ
                could not find uniprot for PKARIIơ
                could not find uniprot for PKC
                could not find uniprot for PKCƥ
                could not find uniprot for PPARơ
                could not find uniprot for PRKD1/PKCƬ
                could not find uniprot for Tubulin
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/788e78790c8b92e236360a36dfcc1256-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/7ead76a9f4f53bed612d584d81532e75-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/21482ce48ae07c59c560a6f88668cf17-show`.
                could not find uniprot for ƣ-actin
                could not find uniprot for Ƣ-actin
                could not find uniprot for Ƣ-arrestin 1
                could not find uniprot for ơ2-integrin
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 166kit [00:02, 22.6kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/227671676e74327da717392ec065629c-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/00bdaab72698946e2c53a3ba1e161996-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 82.8kit [00:01, 18.9kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/fecb73d49aba8341fc1db62417212ff8-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 100kit [00:01, 19.6kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/a358ff6a4e27f47cf3ee45365f6ac052-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/adf5d53c1038cdf2a3c0935761f240ab-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/d06c932e82cdc2a2073b1dcd1f3a4de6-show`.
                could not find uniprot for 14-3-3ƣ
                could not find uniprot for ƣENaC
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 57.0kit [00:01, 11.4kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/2d43a4d3fbf33eefd82daa86efe3622f-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 97.5kit [00:01, 19.2kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/4eda1e60f9b24541231a1253f943b8e0-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/2363983add5b88011be3eec09f638a05-show`.
                could not find uniprot for PLCƤ1
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 99.7kit [00:01, 20.9kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/b1448c259747e453e680439cf5c5cb91-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 197kit [00:02, 35.3kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/cb9900b1b9f2cef7716d2c6f40942f89-show`.
                could not find uniprot for NovelProtein/NP9
                could not find uniprot for Unnamed protein (BAE)
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/69788e06e95a5311786f04508170199e-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/91bcafcd37e96d2c2a27763379b66f16-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/62a420224285648723fa67eb83a988b9-show`.
                could not find uniprot for eIF2ơ
                could not find uniprot for ƣ-adaptin
                could not find uniprot for Ƣ-Trcp1
                could not find uniprot for Ƣ-Trcp2
                could not find uniprot for H2-D1
                could not find uniprot for H2-K1
                could not find uniprot for ơ-actinin-2
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 122kit [00:01, 16.9kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/80ba011a21cfecb35f405c1a1e49aecb-show`.
        Downloading `show` from www.trpchannel.org -- 0.00B downloaded: : 87.2kit [00:02, 12.8kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/909a3c98fd81f2a635605bcc0c5a268c-show`.
        :: Loading data from cache previously downloaded from www.trpchannel.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/adb2b5376d5b4e53192c2bef37d3c492-show`.
        :: Loading 'uniprot-sec' to 'uniprot-pri' mapping table
        Downloading `` from www.uniprot.org -- 0.00B downloaded: : 0.00it [00:00, ?it/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/15ff42ede8eb6a22b432a886075c2203-`.
        Downloading `sec_ac.txt` from ftp.uniprot.org -- 29.32MB downloaded: 100%|| 29.3M/29.3M [00:14<00:00, 1.25Mi        Downloading `sec_ac.txt` from ftp.uniprot.org -- 29.32MB downloaded: 100%|| 29.3M/29.3M [00:14<00:00, 1.25Mi        Downloading `sec_ac.txt` from ftp.uniprot.org -- 29.32MB downloaded: 100%|| 29.3M/29.3M [00:14<00:00, 1.25Mit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/.pypath/cache/49314fe217bf0f2a5544a2c4314b4adf-sec_ac.txt`.
        Reading from file -- finished: : 0.00it [00:00, ?it/s]
        :: Loading 'genesymbol' to 'trembl' mapping table
        Downloading `` from www.uniprot.org -- 0.00B downloaded: : 2.03Mit [00:15, 130kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/ef6ae0ad05e8af48aff2d74a77bd4520-`.
        Processing nodes -- finished: 100%|█████████████████████████████████████████| 370/370 [00:00<00:00, 420kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████████| 370/370 [00:00<00:00, 241kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████████| 370/370 [00:00<00:00, 9.61kit/s]
 > SPIKE
        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   0%| | 11.4k/3.89M [00:03<37:08, 1.74kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   0%| | 8.09k/3.89M [00:04<42:02, 1.54kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   0%| | 9.28k/3.89M [00:04<32:09, 2.01kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   1%| | 22.3k/3.89M [00:04<22:50, 2.82kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   1%| | 58.0k/3.89M [00:04<16:03, 3.98kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   2%| | 86.5k/3.89M [00:04<11:16, 5.62kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   2%| | 94.8k/3.89M [00:05<08:02, 7.86kit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   3%| | 116k/3.89M [00:05<05:56, 10.6kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   3%| | 130k/3.89M [00:05<04:20, 14.5kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   4%| | 148k/3.89M [00:05<03:11, 19.6kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   4%| | 170k/3.89M [00:05<02:22, 26.2kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   5%| | 191k/3.89M [00:06<01:47, 34.5kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   6%| | 218k/3.89M [00:06<01:21, 45.0kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   6%| | 247k/3.89M [00:06<01:03, 57.8kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   7%| | 278k/3.89M [00:06<00:49, 72.9kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   8%| | 309k/3.89M [00:06<00:40, 89.5kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:   9%| | 341k/3.89M [00:06<00:33, 107kit/s]        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  27%|▎| 1.04M/3.89M [00:08<00:07, 381kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  29%|▎| 1.14M/3.89M [00:09<00:08, 308kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  31%|▎| 1.20M/3.89M [00:09<00:08, 334kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  33%|▎| 1.27M/3.89M [00:09<00:07, 356kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  35%|▎| 1.36M/3.89M [00:09<00:06, 387kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  37%|▎| 1.43M/3.89M [00:09<00:06, 404kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  37%|▎| 1.45M/3.89M [00:09<00:05, 423kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  40%|▍| 1.54M/3.89M [00:10<00:05, 407kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  42%|▍| 1.63M/3.89M [00:10<00:05, 395kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  44%|▍| 1.72M/3.89M [00:10<00:04, 442kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  46%|▍| 1.81M/3.89M [00:10<00:05, 392kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  48%|▍| 1.88M/3.89M [00:10<00:04, 442kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  49%|▍| 1.91M/3.89M [00:10<00:04, 462kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  51%|▌| 1.97M/3.89M [00:11<00:03, 481kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  53%|▌| 2.07M/3.89M [00:11<00:03, 540kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  54%|▌| 2.12M/3.89M [00:11<00:03, 557kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  58%|▌| 2.26M/3.89M [00:11<00:03, 485kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  60%|▌| 2.35M/3.89M [00:11<00:03, 468kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  65%|▋| 2.51M/3.89M [00:11<00:02, 535kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  68%|▋| 2.63M/3.89M [00:11<00:01, 641kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  69%|▋| 2.70M/3.89M [00:12<00:01, 660kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  72%|▋| 2.78M/3.89M [00:12<00:01, 681kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  74%|▋| 2.88M/3.89M [00:12<00:01, 727kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  77%|▊| 2.98M/3.89M [00:12<00:01, 734kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  80%|▊| 3.10M/3.89M [00:12<00:00, 810kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  82%|▊| 3.18M/3.89M [00:12<00:00, 833kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  84%|▊| 3.28M/3.89M [00:12<00:00, 852kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  87%|▊| 3.38M/3.89M [00:12<00:00, 856kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  91%|▉| 3.53M/3.89M [00:12<00:00, 931kit/s        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy:  98%|▉| 3.80M/3.89M [00:13<00:00, 1.10Mit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- busy: 100%|▉| 3.89M/3.89M [00:13<00:00, 1.18Mit/        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- 3.89MB downloaded: 100%|█| 3.89M/3.89M [00:13<00        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- 3.89MB downloaded: 100%|█| 3.89M/3.89M [00:13<00        Downloading `LatestSpikeDB.xml.zip` from www.cs.tau.ac.il -- 3.89MB downloaded: : 4.03Mit [00:13, 306kit/s]                 
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `zip extracted data` of type dict of file objects. 
        :: Local file at `/Users/cthoyt/.pypath/cache/da5f2fa9bc0a975c375ed43448233ece-LatestSpikeDB.xml.zip`.
        :: Loading 'genesymbol' to 'uniprot' mapping table
        Downloading `` from www.uniprot.org -- 0.00B downloaded: : 277kit [00:10, 16.3kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/c4e5738ebca52db4a3ebc6b5b07757e9-`.
        :: Loading 'genesymbol-syn' to 'uniprot' mapping table
        Downloading `` from www.uniprot.org -- 0.00B downloaded: : 292kit [00:07, 32.8kit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/8927495f7a090077145f56f74d2842c4-`.
        Processing nodes -- finished: 100%|█████████████████████████████████████| 3.72k/3.72k [00:00<00:00, 623kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████| 3.72k/3.72k [00:00<00:00, 243kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████| 3.72k/3.72k [00:00<00:00, 4.19kit/s]
 > SignaLink3
        Reading file -- finished: 100%|████████████████████████████████████████| 16.3M/16.3M [00:00<00:00, 40.6Mit/s]
        :: Loading 'genesymbol' to 'swissprot' mapping table
        :: Loading data from cache previously downloaded from www.uniprot.org
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/c4e5738ebca52db4a3ebc6b5b07757e9-`.
        :: Loading 'genesymbol-syn' to 'swissprot' mapping table
        Processing nodes -- finished: 100%|█████████████████████████████████████| 6.94k/6.94k [00:00<00:00, 645kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████| 6.94k/6.94k [00:00<00:00, 175kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████| 6.94k/6.94k [00:01<00:00, 3.91kit/s]
 > Guide2Pharma
        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:   1%| | 53.8k/3.69M [00:00<00:33, 10        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  11%| | 411k/3.69M [00:00<00:21, 152        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  26%|▎| 947k/3.69M [00:00<00:12, 214        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  40%|▍| 1.49M/3.69M [00:00<00:07, 29        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  52%|▌| 1.90M/3.69M [00:00<00:04, 38        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  58%|▌| 2.14M/3.69M [00:00<00:02, 52        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  73%|▋| 2.69M/3.69M [00:01<00:01, 70        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  83%|▊| 3.08M/3.69M [00:01<00:00, 93        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy:  92%|▉| 3.39M/3.69M [00:01<00:00, 1.        Downloading `interactions.csv` from www.guidetopharmacology.org -- busy: : 3.73Mit [00:01, 1.46Mit/s]                Downloading `interactions.csv` from www.guidetopharmacology.org -- 3.69MB downloaded: 100%|█| 3.69M/3.69M [00        Downloading `interactions.csv` from www.guidetopharmacology.org -- 3.69MB downloaded: 100%|█| 3.69M/3.69M [00        Downloading `interactions.csv` from www.guidetopharmacology.org -- 3.69MB downloaded: : 4.00Mit [00:01, 2.85Mit/s]                
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/.pypath/cache/61ddc6eb0ff8ef877c52f5d1a81b9db2-interactions.csv`.
        Processing nodes -- finished: 100%|█████████████████████████████████████████| 291/291 [00:00<00:00, 335kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████████| 291/291 [00:00<00:00, 211kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████████| 291/291 [00:00<00:00, 2.36kit/s]
 > CA1
        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:   0%| | 0.00/509k [00:00<?,         Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:   3%| | 14.5k/509k [00:01<01        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:   8%| | 40.0k/509k [00:01<00        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:  18%|▏| 89.2k/509k [00:01<00        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:  29%|▎| 147k/509k [00:01<00:        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:  49%|▍| 249k/509k [00:01<00:        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy:  78%|▊| 396k/509k [00:01<00:        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- busy: : 523kit [00:01, 54.4kit/s]         Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- 508.71kB downloaded: 100%|█| 509k/        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- 508.71kB downloaded: 100%|█| 509k/        Downloading `Maayan_SOM_External_Files.zip` from science.sciencemag.org -- 508.71kB downloaded: : 613kit [00:01, 320kit/s]                
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `zip extracted data` of type dict of unicode strings. 
        :: Local file at `/Users/cthoyt/.pypath/cache/a221dcf8846ad398634f9997a1011b9e-Maayan_SOM_External_Files.zip`.
        Processing nodes -- finished: 100%|█████████████████████████████████████| 1.48k/1.48k [00:00<00:00, 581kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████| 1.48k/1.48k [00:00<00:00, 282kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████| 1.48k/1.48k [00:00<00:00, 4.87kit/s]
 > ARN
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/dev/pypath/src/pypath/data/arn_curated.csv`.
        Processing nodes -- finished: 100%|███████████████████████████████████████| 95.0/95.0 [00:00<00:00, 102kit/s]
        Processing edges -- finished: 100%|███████████████████████████████████████| 95.0/95.0 [00:00<00:00, 156kit/s]
        Processing attributes -- finished: 100%|█████████████████████████████████| 95.0/95.0 [00:00<00:00, 1.76kit/s]
 > NRF2ome
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/dev/pypath/src/pypath/data/nrf2ome.csv`.
        Processing nodes -- finished: 100%|█████████████████████████████████████████| 109/109 [00:00<00:00, 236kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████████| 109/109 [00:00<00:00, 121kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████████| 109/109 [00:00<00:00, 1.75kit/s]
 > Macrophage
Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com: initializing curl: 0.00it [00:00, ?it/s        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- busy: : 0.00it [00:00, ?it/s]        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- busy:  48%|▍| 588k/1.22M [00:        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- busy: : 1.74Mit [00:00, 708ki        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- 1.22MB downloaded: 100%|█| 1.        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- 1.22MB downloaded: 100%|█| 1.        Downloading `12918_2010_452_MOESM2_ESM.XLS` from static-content.springer.com -- 1.22MB downloaded: : 1.43Mit [00:00, 2.06Mit/s]               
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/.pypath/cache/e7b73bcce14b977a3e384518d40f3637-12918_2010_452_MOESM2_ESM.XLS`.
        Processing nodes -- finished: 100%|█████████████████████████████████████| 4.86k/4.86k [00:00<00:00, 739kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████| 4.86k/4.86k [00:00<00:00, 259kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████| 4.86k/4.86k [00:00<00:00, 12.4kit/s]
 > DeathDomain
        Downloading `show` from www.deathdomain.org -- busy:   0%|                        | 0.00/296 [00:01<?, ?it/s]
        :: Error in `pypath.dataio.deathdomain_interactions()`. Skipping to next resource.
        :: ("object of type 'NoneType' has no len()",)
  File "/Users/cthoyt/dev/pypath/src/pypath/main.py", line 2284, in read_data_file
    infile = inputFunc(**settings.inputArgs)
  File "/Users/cthoyt/dev/pypath/src/pypath/dataio.py", line 8355, in deathdomain_interactions
    soup = bs4.BeautifulSoup(html, 'lxml')
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/bs4/__init__.py", line 245, in __init__
    elif len(markup) <= 256 and (


        ### ERROR ###### deathdomain_interactions: No such file or dataio function! :(
 > PDZBase
        Downloading `allinteractions` from abc.med.cornell.edu -- 433.27kB downloaded: 100%|| 433k/433k [00:01<00:00        Downloading `allinteractions` from abc.med.cornell.edu -- 433.27kB downloaded: 100%|| 433k/433k [00:01<00:00        Downloading `allinteractions` from abc.med.cornell.edu -- 433.27kB downloaded: : 443kit [00:01, 339kit/s]                
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type unicode string. 
        :: Local file at `/Users/cthoyt/.pypath/cache/d16213901cd27de19ef825068fd8faa6-allinteractions`.
        Processing nodes -- finished: 100%|█████████████████████████████████████████| 125/125 [00:00<00:00, 278kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████████| 125/125 [00:00<00:00, 160kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████████| 125/125 [00:00<00:00, 1.39kit/s]
 > Signor
        Downloading `download_entity.php` from signor.uniroma2.it -- 0.00B downloaded: : 8.67Mit [00:03, 2.02Mit/s]
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/.pypath/cache/a357fe979f74a823bf4a42150a6dcf33-download_entity.php`.
        Processing nodes -- finished: 100%|█████████████████████████████████████| 10.1k/10.1k [00:00<00:00, 626kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████| 10.1k/10.1k [00:00<00:00, 167kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████| 10.1k/10.1k [00:03<00:00, 3.33kit/s]
 > HPMR
        Downloading HPMR data -- finished: 100%|████████████████████████████████| 1.27k/1.27k [26:15<00:00, 1.04s/it]
        Processing nodes -- finished: 100%|█████████████████████████████████████████| 579/579 [00:00<00:00, 491kit/s]
        Processing edges -- finished: 100%|█████████████████████████████████████████| 579/579 [00:00<00:00, 213kit/s]
        Processing attributes -- finished: 100%|███████████████████████████████████| 579/579 [00:00<00:00, 1.33kit/s]
 > CellPhoneDB
        Downloading `interactions_cellphonedb.csv` from www.cellphonedb.org -- 128.54kB downloaded: 100%|| 129k/129k        Downloading `interactions_cellphonedb.csv` from www.cellphonedb.org -- 128.54kB downloaded: 100%|| 129k/129k        Downloading `interactions_cellphonedb.csv` from www.cellphonedb.org -- 128.54kB downloaded: : 169kit [00:00, 335kit/s]               
                                                                                                                                                                                                                                                                                                                                                                       :: Ready. Resulted `plain text` of type file object. 
        :: Local file at `/Users/cthoyt/.pypath/cache/142eb923569634ee61ca1d56843de13a-interactions_cellphonedb.csv`.
Traceback (most recent call last):
  File "pypath/bel.py", line 307, in <module>
    main()
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 1134, in invoke
    Command.invoke(self, ctx)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/Users/cthoyt/.virtualenvs/hbp/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "pypath/bel.py", line 291, in _main
    resource = get_resource(resource_name)
  File "pypath/bel.py", line 282, in get_resource
    pa.init_network(data_formats.pathway)
  File "/Users/cthoyt/dev/pypath/src/pypath/main.py", line 1665, in init_network
    cache_files=cache_files)
  File "/Users/cthoyt/dev/pypath/src/pypath/main.py", line 5816, in load_resources
    reread=reread, redownload=redownload)
  File "/Users/cthoyt/dev/pypath/src/pypath/main.py", line 5884, in load_resource
    redownload=redownload)
  File "/Users/cthoyt/dev/pypath/src/pypath/main.py", line 2371, in read_data_file
    for line in infile: # XXX: here could be used enumerate for lnum
  File "/Users/cthoyt/dev/pypath/src/pypath/dataio.py", line 5265, in cellphonedb_interactions
    if uniprot1 in ligands and uniprot2 in receptors:
NameError: name 'ligands' is not defined

Problems with PyPath.export_ptms_tab()

There seems to be a problem when adding the references to the tab file rows, as it raises TypeError: sequence item 0: expected string, Reference found.
Also, as soon as the prompt comes back, another exception is raised (something internal to Python threads and sets) [!?]:

Exception in thread Thread-295:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/home/user/.local/lib/python2.7/site-packages/tqdm/_tqdm.py", line 144, in run
    for instance in self.tqdm_cls._instances:
  File "/usr/lib/python2.7/_weakrefset.py", line 60, in __iter__
    for itemref in self.data:
RuntimeError: Set changed size during iteration

Is this only me or?

sudo pip install git+git://github.com/saezlab/pypath.git failed in python 2 and 3

Following traceback while in installation process in python 2 and 3

Collecting git+git://github.com/saezlab/pypath.git
Cloning git://github.com/saezlab/pypath.git to /tmp/pip-9wm9jkkj-build
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-9wm9jkkj-build/setup.py", line 25, in
common = imp.load_source('common', os.path.join('src', 'pypath', 'common.py'))
File "/usr/lib/python3.5/imp.py", line 172, in load_source
module = _load(spec)
File "", line 693, in _load
File "", line 673, in _load_unlocked
File "", line 665, in exec_module
File "", line 222, in _call_with_frames_removed
File "src/pypath/common.py", line 18, in
from future.utils import iteritems
ImportError: No module named 'future'

pa.get_edge allways retuns NONE

Dear Denes,

now all the loading and creating of the graph is working for me :)
However now I am stuck with querying some things from your graph
Following your jupyter notebook: http://pypath.omnipathdb.org/notebooks/pypath_build_networks.html

In Step 6: Further attributes in the PyPath object
Accessing the edges per gene name or uniprot is not possible:

get_edge allways retuns NONE
pa.get_edge(pa.up('P42858'), pa.up('Q02447')) --> NONE
pa.get_edge(pa.gs('HTT'), pa.gs('SP3')) --> NONE

although this edge should exits, because:
pa.graph.es[0]["dirs"]

prints out:

Directions and signs of interaction between P42858 and Q02447
P42858 ==== Q02447 :: IntAct

Or did I missunderstood something in your tutorial ?

Best,
Ivo

New reader module

-- The pre-processing of network data should be organized in a separate module.
-- Here we should have classes which are responsible for processing an entire dataset, one line and one field in the line.
-- Just like until now, we should provide users to provide simple instructions for processing in simple cases and give highest flexibility in complicated cases.
-- We should keep in mind that one line might provide 0, 1 or more interactions for the network and one input source might provide different types of interactions and sometimes we might need only some of them, e.g. from Signor we can load only protein-protein but also small_molecule-protein, now we do it by reading the file twice.

Problem extracting gz files

I was trying some of the PyPath methods to load some data (eg: pa.sequences, pa.load_ptms,...) and there seems to be a problem when processing the data requested, seems to be on the extraction process. Here the last part of the traceback:

/home/nico/.local/lib/python2.7/site-packages/pypath/seq.pyc in get_isoforms(organism)
     82     result = {}
     83     url = urls.urls['unip_iso']['url']
---> 84     c = curl.Curl(url, silent=False)
     85     data = c.result
     86     data = read_fasta(data)

/home/nico/.local/lib/python2.7/site-packages/pypath/curl.pyc in __init__(self, url, silent, get, post, req_headers, cache, debug, outf, compr, encoding, files_needed, timeout, init_url, init_fun, init_use_cache, follow, large, override_post, init_headers, return_headers, compressed, binary_data, write_cache, force_quote, sftp_user, sftp_passwd, sftp_passwd_file, sftp_port, sftp_host, sftp_ask, setup, call, process, retries, cache_dir)
    766             sys.stdout.flush()
    767         if process and not self.download_failed and not DRYRUN:
--> 768             self.process_file()
    769 
    770         if DRYRUN:

/home/nico/.local/lib/python2.7/site-packages/pypath/curl.pyc in process_file(self)
   1208         self.copy_file()
   1209         self.open_file()
-> 1210         self.extract_file()
   1211         self.decode_result()
   1212         self.report_ready()

/home/nico/.local/lib/python2.7/site-packages/pypath/curl.pyc in extract_file(self)
   1230         if not self.silent:
   1231             self.print_status('Extracting %s data' % self.type)
-> 1232         self.extract()
   1233 
   1234     def decode_result(self):

/home/nico/.local/lib/python2.7/site-packages/pypath/curl.pyc in extract(self)
    560 
    561     def extract(self):
--> 562         getattr(self, 'open_%s' % self.type)()
    563 
    564     def open_tgz(self):

/home/nico/.local/lib/python2.7/site-packages/pypath/curl.pyc in open_gz(self)
    583 
    584     def open_gz(self):
--> 585         self.fileobj.seek(-4, 2)
    586         self.size = struct.unpack('I', self.fileobj.read(4))[0]
    587         self.fileobj.seek(0)

IOError: [Errno 22] Invalid argument

'Deacetylation' vs. 'deacetylation' in PTM data

Hi, thanks for this resource. Just letting you know that in the PTM data as retrieved by the web service, there is one inconsistent entry for a deacetylation event, where the modification type is capitalized as 'Deacetylation'

This API query

http://omnipathdb.org/ptms/Q96EB6?format=json

yields a list of modifications which includes

{"residue_type": "K", "modification": "Deacetylation", "substrate": "Q04206", "residue_offset": 310, "enzyme": "Q96EB6"}

Add Dockerfile

A Dockerfile would be really useful to provide so the entire database could be built from scratch (all dependencies, resources, etc.)

FTP servers down

Both UniProt and MINT servers seem to be down. UniProt page has not been working very well lately but I've checked the DOMINO/MINT resource and I think they may have changed the name/URL or something. Connection via http seems to work without problem (e.g.: here) but there's nothing mentioning DOMINO anywhere anymore.

Problem with import pypath

Hi,
I am trying to issue "import pypath" but got the following error message, however I checked that the cairo module has been already installed. Any suggestion how I can solve the problem? Many thanks.

:: Module cairo not available.
Some plotting functionalities won't be accessible.
:: Module pygraphviz not available.
You don't need it unless you want to export dot files.
:: No MySQL support.
:: No MySQL support.

:: Module `pysftp` not available. 
    Only downloading of a small number of resources 
    relies on this module.
    Please install by PIP if it is necessary for you.
	:: Module `fabric` not available.
:: Module `bioservices` not available.

No module cairo available.
Some plotting functionalities won't be accessible.
Traceback (most recent call last):
File "", line 1, in
File "/home/weijun/anaconda3/lib/python3.7/site-packages/pypath/init.py", line 27, in
import pypath.main as main
File "/home/weijun/anaconda3/lib/python3.7/site-packages/pypath/main.py", line 104, in
import pypath.plot as plot
File "/home/weijun/anaconda3/lib/python3.7/site-packages/pypath/plot.py", line 40, in
import cairo
ModuleNotFoundError: No module named 'cairo'

Prioritizing log messages

At the momet the log is too verbose. A verbosity level should be assigned to each log message, which is the second argument of the _log method, e.g. self._log('message', 1). The default log level is 0, if something is not important we should give a higher value, if something must be printed also to the console, I used to give -9.

CellPhoneDB and annot module

There seems to be some kind of bug when loading the annotation table. Seems to be only for the CellPhoneDB resource.

To reproduce:

from pypath import annot
a = annot.AnnotationTable(keep_annotators=True)
a.load()
a.to_dataframe()

Which raises:

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-19-100b4db749d6> in <module>()
----> 1 a.to_dataframe()

~/.local/lib/python3.6/site-packages/pypath/annot.py in to_dataframe(self)
   1012     def to_dataframe(self):
   1013 
-> 1014         colnames = ['__'.join(name) for name in self.names]
   1015 
   1016         df = pd.DataFrame(

~/.local/lib/python3.6/site-packages/pypath/annot.py in <listcomp>(.0)
   1012     def to_dataframe(self):
   1013 
-> 1014         colnames = ['__'.join(name) for name in self.names]
   1015 
   1016         df = pd.DataFrame(

TypeError: sequence item 2: expected str instance, bool found

Checking further, seems that a.names contains some unexpected elements for the last annotations from CellPhoneDB, some examples:

  • ('CellPhoneDB', 'https://www.ncbi.nlm.nih.gov/pubmed/22505611')
  • ('CellPhoneDB', 'Artipical_chemokine_receptor_add', False) <- raises TypeError from here
  • ('CellPhoneDB', 'Atipical_chemokine_receptor_add', False)
  • ('CellPhoneDB', 'Atipical_chemokine_receptor_add', True)

and so on so forth...

`go_dict` unable to download data

I'm following the Example 4 but when I try to run pa.go_dict() in order to map the GO IDs to their names, I get the following output:

        Downloading `GAnnotation` from www.ebi.ac.uk -- failed: : 0.00it [00:00, ?it/s]

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-5-15d97c1934f6> in <module>()
----> 1 pa.go_dict()

/home/nico/.local/lib/python2.7/site-packages/pypath/main.pyc in go_dict(self, organism)
   6536         if not hasattr(self, 'go'):
   6537             self.go = {}
-> 6538         self.go[organism] = go.GOAnnotation(organism)
   6539 
   6540     def go_enrichment(self,

/home/nico/.local/lib/python2.7/site-packages/pypath/go.pyc in __init__(self, organism)
     28 class GOAnnotation(object):
     29     def __init__(self, organism=9606):
---> 30         go = dataio.get_go_quick(organism=organism)
     31         self.c = go['terms']['C']
     32         self.f = go['terms']['F']

/home/nico/.local/lib/python2.7/site-packages/pypath/dataio.pyc in get_go_quick(organism, slim, names_only)
   3623     url = urls.urls['quickgo']['url'] % (goslim, termuse, organism)
   3624     c = curl.Curl(url, silent=False, large=True)
-> 3625     _ = c.result.readline()
   3626 
   3627     _ = \

AttributeError: 'NoneType' object has no attribute 'readline'

Not sure if the problem comes from PycURL or from the web source itself :/

AttributeError: 'module' object has no attribute 'POSTREDIR' when trying to load_all_pathways (py2.7)

Dear Denes,

thank you for processing and solving the issues so quickly the last time :)
The BufferedIO error somehow magically disappeared as well :D

Unfortunately I run today in one other error trying to load_all_pathways:
Downloading data from Signor: initializing: 0%| | 0.00/62.0 [00:00<?, ?it/s]
runs in the following error:

----> 6 pa.load_all_pathways() #load all resources

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in load_all_pathways(self, graph)
7406 def load_all_pathways(self, graph=None):
7407 self.kegg_pathways(graph=graph)
-> 7408 self.signor_pathways(graph=graph)
7409 self.pathway_attributes(graph=graph)
7410

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in signor_pathways(self, graph)
7457
7458 def signor_pathways(self, graph=None):
-> 7459 self.load_pathways('signor', graph=graph)
7460
7461 def kegg_pathways(self, graph=None):

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in load_pathways(self, source, graph)
7431 g = self.graph if graph is None else graph
7432 nodDct = dict(zip(g.vs['name'], xrange(g.vcount())))
-> 7433 proteins_pws, interactions_pws = self.get_pathways(source)
7434 g.vs[attrname] = [set([]) for _ in g.vs]
7435 g.es[attrname] = [set([]) for _ in g.es]

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in get_pathways(self, source)
7373 if hasattr(dataio, attrname):
7374 fun = getattr(dataio, attrname)
-> 7375 proteins_pws, interactions_pws = fun(mapper=self.mapper)
7376 return proteins_pws, interactions_pws
7377

/home/usr/.local/lib/python2.7/site-packages/pypath/dataio.pyc in signor_pathways(**kwargs)
5145 silent = True,
5146 large = True,
-> 5147 binary_data = binary_data
5148 )
5149

/home/usr/.local/lib/python2.7/site-packages/pypath/curl.pyc in init(self, url, silent, get, post, req_headers, cache, debug, outf, compr, encoding, files_needed, timeout, init_url, init_fun, init_use_cache, follow, large, override_post, init_headers, return_headers, compressed, binary_data, write_cache, force_quote, sftp_user, sftp_passwd, sftp_passwd_file, sftp_port, sftp_host, sftp_ask, setup, call, process, retries, cache_dir)
758 self.progress_setup()
759 if setup:
--> 760 self.curl_setup()
761 if call:
762 self.curl_call()

/home/usr/.local/lib/python2.7/site-packages/pypath/curl.pyc in curl_setup(self, url)
947 self.set_debug()
948 self.set_post()
--> 949 self.set_binary_data()
950 self.set_req_headers()
951 self.set_resp_headers()

/home/usr/.local/lib/python2.7/site-packages/pypath/curl.pyc in set_binary_data(self)
903 self.curl.setopt(pycurl.READFUNCTION, self.binary_data_file.read)
904 self.curl.setopt(pycurl.CUSTOMREQUEST, 'POST')
--> 905 self.curl.setopt(pycurl.POSTREDIR, 3)
906
907 def curl_init(self, url=False):

AttributeError: 'module' object has no attribute 'POSTREDIR'

Best,
Ivo

Installation problems in python 3

  1. made a "clean" python enviroment with
    mkvirtualenv -p /usr/bin/python3 pypath
    version check:
    src/pypath/__version__:0.7.17
  2. Install
    pip install git+git://github.com/saezlab/pypath.git
    traceback from install:
complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>                                                                                                                                                                                                                                     
      File "/tmp/pip-build-tip722io/fisher/setup.py", line 2, in <module>                                                                                                                                                                                                      
        import numpy as np                                                                                                                                                                                                                                                     
    ImportError: No module named 'numpy'
  1. Then I did a
    pip install numpy
  2. Again:
    pip install git+git://github.com/saezlab/pypath.git
    traceback:
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "/tmp/pip-build-pwnyxrtw/pycurl/setup.py", line 103, in configure_unix
        stdout=subprocess.PIPE, stderr=subprocess.PIPE)
      File "/usr/lib/python3.5/subprocess.py", line 947, in __init__
        restore_signals, start_new_session)
      File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg)
    FileNotFoundError: [Errno 2] No such file or directory: 'curl-config'
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-pwnyxrtw/pycurl/setup.py", line 823, in <module>
        ext = get_extension(sys.argv, split_extension_source=split_extension_source)
      File "/tmp/pip-build-pwnyxrtw/pycurl/setup.py", line 497, in get_extension
        ext_config = ExtensionConfiguration(argv)
      File "/tmp/pip-build-pwnyxrtw/pycurl/setup.py", line 71, in __init__
        self.configure()
      File "/tmp/pip-build-pwnyxrtw/pycurl/setup.py", line 107, in configure_unix
        raise ConfigurationError(msg)
    __main__.ConfigurationError: Could not run curl-config: [Errno 2] No such file or directory: 'curl-config'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-pwnyxrtw/pycurl/

Hope this helps

Problem with Cytoscape Plugin

Hi,
I installed the Cytoscape plugin for Omnipath but when I tried to confirm selections on the database search, it always came out error message saying that permission denied. Would please help advise?

Thank you.

AttributeError: 'generator' object has no attribute 'read' in load_all_pathways (py2.7)

Hi Denes,

here as promised the new issue ;D So far I have not reinitialised the network but restarted load_all_pathways in the same jupyter notebook I will let you know if that resolves that issue.

in the meanwhile that is my traceback:

AttributeError Traceback (most recent call last)
in ()
----> 1 pa.load_all_pathways()

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in load_all_pathways(self, graph)
7406 def load_all_pathways(self, graph=None):
7407 self.kegg_pathways(graph=graph)
-> 7408 self.signor_pathways(graph=graph)
7409 self.pathway_attributes(graph=graph)
7410

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in signor_pathways(self, graph)
7457
7458 def signor_pathways(self, graph=None):
-> 7459 self.load_pathways('signor', graph=graph)
7460
7461 def kegg_pathways(self, graph=None):

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in load_pathways(self, source, graph)
7431 g = self.graph if graph is None else graph
7432 nodDct = dict(zip(g.vs['name'], xrange(g.vcount())))
-> 7433 proteins_pws, interactions_pws = self.get_pathways(source)
7434 g.vs[attrname] = [set([]) for _ in g.vs]
7435 g.es[attrname] = [set([]) for _ in g.es]

/home/usr/.local/lib/python2.7/site-packages/pypath/main.pyc in get_pathways(self, source)
7373 if hasattr(dataio, attrname):
7374 fun = getattr(dataio, attrname)
-> 7375 proteins_pws, interactions_pws = fun(mapper=self.mapper)
7376 return proteins_pws, interactions_pws
7377

/home/usr/.local/lib/python2.7/site-packages/pypath/dataio.pyc in signor_pathways(**kwargs)
5150 sep = '@#@#@'
5151 lines = csv_sep_change(
-> 5152 c_pw.result.read().decode('utf-8'),
5153 '\t',
5154 sep

AttributeError: 'generator' object has no attribute 'read

Best,
Ivo

pa.get_edge still buggy (in py2.7)

Dear Denes,

I am sorry to bother you again but somehow the get_edge function is still buggy (in py2.7)

When I try to reproduce the change in your update of the jupyter notebook
it runs in the following error (does not matter if gene name or uniprot id)

TypeError Traceback (most recent call last)
in ()
----> 1 edge = pa.graph.es[pa.get_edge('EGF','EGFR')]

TypeError: igraph supports string attribute names only, got <type 'igraph.Edge'>

Further on the function still does not seem to support vertex objects:

gene1_vertexObj = list(signaling_graph.gs_stimulated_by("RHOA").vs())[0]
gene2_vertexObj = list(signaling_graph.gs_stimulated_by("RHOA").vs())[1]

TypeError Traceback (most recent call last)
in ()
----> 1 edge = pa.graph.es[pa.get_edge(gene1_vertexObj,gene2_vertexObj)]

TypeError: igraph supports string attribute names only, got <type 'NoneType'>

I Already double checked if I have the newest version of pypath:

New session started,
session ID: 'k84ar'
logfile: './log/k84ar.log'
pypath version: 0.7.98
:: Network loaded from cache/signaling_network.pickle. 14596 nodes, 118739 edges.
:: Loading 'genesymbol' to 'uniprot' mapping table

Best,
Ivo

Problem on ptm.PtmAggregator

I'm using PyPath v0.7.58 and when I tried to run the following command p = ptm.PtmAggregator(ncbi_tax_id=10090) and when downloading the data I got this error:

Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org: initializing curl: 0        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- busy: : 0.        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- busy: : 0.        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- busy: : 0.        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- busy:   0%        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- failed: 10        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- failed: 10        Downloading `Kinase_Substrate_Dataset.gz` from www.phosphosite.org -- failed: : 546it [00:00, 1.08Kit/s]

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')

	ERROR
	PycURL error: (1, 'Protocol "https" not supported or disabled in libcurl')
	ERROR: read_table() expects file like object (file opened for read, or StringIO buffer, etc)
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-10-8a6a2d62e20b> in <module>()
----> 1 p = ptm.PtmAggregator(ncbi_tax_id=10090)

/home/nico/.local/lib/python2.7/site-packages/pypath/ptm.pyc in __init__(self, input_methods, ncbi_tax_id, map_by_homology_from, trace, mapper, enzyme_id_type, substrate_id_type, homology_only_swissprot, ptm_homology_strict, nonhuman_direct_lookup, inputargs)
    553         self.map_by_homology_from.discard(self.ncbi_tax_id)
    554
--> 555         self.build_list()
    556         self.unique()
    557

/home/nico/.local/lib/python2.7/site-packages/pypath/ptm.pyc in build_list(self)
    614                                     enzyme_id_type = self.enzyme_id_type,
    615                                     substrate_id_type = self.substrate_id_type,
--> 616                                     **inputargs)
    617
    618                 extend_lists(proc.__iter__())

/home/nico/.local/lib/python2.7/site-packages/pypath/ptm.pyc in __init__(self, input_method, ncbi_tax_id, trace, mapper, enzyme_id_type, substrate_id_type, name, allow_mixed_organisms, **kwargs)
    118         self.set_inputargs(**kwargs)
    119         self.init_mapper()
--> 120         self.load()
    121
    122     def load(self):

/home/nico/.local/lib/python2.7/site-packages/pypath/ptm.pyc in load(self)
    123
    124         self._setup()
--> 125         self.load_data()
    126
    127     def reload(self):

/home/nico/.local/lib/python2.7/site-packages/pypath/ptm.pyc in load_data(self)
    177         """
    178
--> 179         self.data = self.inputm(**self.inputargs)
    180
    181     def init_mapper(self):

/home/nico/.local/lib/python2.7/site-packages/pypath/dataio.pyc in get_psite_phos(raw, organism, strict, mapper)
   1918         'motif': 11
   1919     }
-> 1920     data = read_table(cols=cols, fileObject=data, sep='\t', hdr=4)
   1921     result = []
   1922     non_digit = re.compile(r'[^\d.-]+')

/home/nico/.local/lib/python2.7/site-packages/pypath/dataio.pyc in read_table(cols, fileObject, data, sep, sep2, rem, hdr, encoding)
    166                 '\tERROR: %s() expects file like object (file opened for read'
    167                 ', or StringIO buffer, etc)\n' % funname)
--> 168         fileObject.seek(0)
    169         if hdr:
    170             for h in xrange(0, hdr):

AttributeError: 'NoneType' object has no attribute 'seek'

Apparently the data from phosphosite.org could not be retrieved and this made the function to crash.

dbptm_interactions

There's a pycurl error when loading this resource. Not sure if the service is down, they changed the url or what. You might want to give it a look.

 > dbPTM
Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw: initializing curl: 0.00it        Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- busy: : 0.00it         Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- failed: : 0.00i        Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- failed: : 0.00i        Downloading `N-linked.tgz` from dbptm.mbc.nctu.edu.tw -- failed: : 0.00it [00:15, ?it/s]

	ERROR
	PycURL error: (6, 'Could not resolve host: dbptm.mbc.nctu.edu.tw')

	ERROR
	PycURL error: (6, 'Could not resolve host: dbptm.mbc.nctu.edu.tw')

	ERROR
	PycURL error: (6, 'Could not resolve host: dbptm.mbc.nctu.edu.tw')

	:: Error in `pypath.dataio.dbptm_interactions()`. Skipping to next resource.
	:: ("'NoneType' object has no attribute 'items'",)
	:: Failed handling exception.
	("'exceptions.AttributeError' object has no attribute '__traceback__'",)

	### ERROR ###### dbptm_interactions: No such file or dataio function! :(

Converting UniProt IDs to Entrez IDs

How do I convert uniprot IDs to Entrez ID using mapping.py? It seems Entrez IDs can be converted to UniProt IDs using this tool, but not the other way round. I tried UniProt's ID mapping for such conversion, but a subset of UniProt ID nodes do not have Entrez ID mapped (reason was obsolete uniprot ID, etc.). Is there a lossless way of doing this conversion directly using PyPath?

Difference between pa.load_omnipath() and pa.init_network(pypath.data_formats.pathway)?

These commands are presented in the first sections of the pypath tutorial:

http://pypath.omnipathdb.org/notebooks/pypath_build_networks.html

and I'm just wondering what the difference between these two commands are. I'm asking between I noticed the graphs they produce are different sizes. The first command creates a larger graph with roughly twice the number of nodes, but they both seem to be querying the entire OmniPath database:

Graph 1: IGRAPH UN-T 8947 34074 -- unnamed
Graph 2: IGRAPH UN-T 4788 14703 -- unnamed

Therefore I'm a bit confused at what the difference between them is. Could someone please clarify this for me? Thanks!

TypeError: invalid arguments to setopt (in Python 2.7)

Hi,

I installed the latest pypath version (0.7.93) via pip install git+git://github.com/saezlab/pypath.git
My python version is Python 2.7.5 (default, Nov 20 2015, 02:00:19)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2

I found 2 relatively easy fixable bugs in your application which I reckon only happen in python2.7
so I did not wanted to do a pull request.

1.import igraph runs into:

import igraph
Traceback (most recent call last):
File "", line 1, in
File "/usr/lib/python2.7/site-packages/igraph/init.py", line 42, in
import gzip
File "/usr/lib/python2.7/gzip.py", line 36, in
class GzipFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

-->Bug fix:
renamed the io.py file into io_test.py [*] (I hope this does not break other things in your code ?)
and rebuild your application using python setup.py sdist
*see: https://stackoverflow.com/questions/6315440/how-to-solve-attributeerror-when-importing-igraph

2.Executing pa.load_omnipath() runs into..

...
--> 909 self.curl.setopt(self.curl.URL, url or self.url)
910
911 def set_target(self)

-->Bug fix:
added in curl.py an if statement to check if the url is unicode and if so encode it to ascii
*see: https://bugs.launchpad.net/gwibber/+bug/542501

if isinstance(self.url, unicode):
            self.curl.setopt(self.curl.URL, url or self.url.encode("ascii"))

I'll let you know if I run in some other bugs using python2.7

Best,
Ivo

DOMINO not working anymore

It's been a while now, but DOMINO data is not downloading anymore, I think they changed the name/URL. I can try to take a look when I have time, but maybe you're faster :)

0 interactions between 0 nodes

Hello,

I am new to pypath so I am trying to run Quick start 1 and 2.
I installed pypath successfully.
I tried running :

import pypath
pa = pypath.PyPath()
pa.load_resources({'signor': pypath.data_formats.pathway['signor']})

But I obtain :

0 interactions between 0 nodes
 from 0 resources have been loaded,
 for details see the log: ./log/6o011.log

The log is like :

[2018-07-09 10:54:02] ### INFO ### Logger initialized, logging to log/6o011.log
[2018-07-09 10:54:02] ### INFO ### PyPath has been initialized
[2018-07-09 10:54:02] ### INFO ### Beginning session '6o011'
[2018-07-09 10:54:04] ### INFO ###### Retrieving data by dataio.signor_interactions() ...
[2018-07-09 10:54:12] ### INFO ### Loading mapping tables...
[2018-07-09 10:54:12] ### INFO ###### Loading table ('uniprot-sec', 'uniprot-pri') ...
[2018-07-09 10:54:13] ### INFO ###### Table ('uniprot-sec', 'uniprot-pri') loaded from FileMapping.
[2018-07-09 10:54:13] ### INFO ### Loading mapping tables...
[2018-07-09 10:54:13] ### INFO ###### Loading table ('genesymbol', 'trembl') ...
[2018-07-09 10:54:14] ### INFO ###### Table ('genesymbol', 'trembl') loaded from UniprotMapping.
[2018-07-09 10:54:14] ### INFO ### Loading mapping tables...
[2018-07-09 10:54:14] ### INFO ###### Loading table ('genesymbol', 'swissprot') ...
[2018-07-09 10:54:14] ### INFO ###### Table ('genesymbol', 'swissprot') loaded from UniprotMapping.
[2018-07-09 10:54:14] ### INFO ### Loading mapping tables...
[2018-07-09 10:54:14] ### INFO ###### Loading table ('genesymbol-syn', 'swissprot') ...
[2018-07-09 10:54:15] ### INFO ###### Table ('genesymbol-syn', 'swissprot') loaded from UniprotMapping.
[2018-07-09 10:54:15] ### INFO ###### 19910 lines have been read from signor_interactions,10098 links after mapping;
3912 lines filtered by filters;
692 lines filtered because lack of references;
3062 lines filtered by taxon filters.
[2018-07-09 10:54:15] ### INFO ###### New nodes have been created
[2018-07-09 10:54:15] ### INFO ###### New edges have been created
[2018-07-09 10:54:15] ### INFO ###### Introducing new node and edge attributes...
[2018-07-09 10:54:19] ### WARNING ###### Vertex attribute exp has only None values
[2018-07-09 10:54:19] ### WARNING ###### Edge attribute negative has only None values
[2018-07-09 10:54:19] ### WARNING ###### Edge attribute negative_refs has only None values
[2018-07-09 10:54:19] ### INFO ### Removing duplicate edges...
[2018-07-09 10:54:19] ### INFO ### Loading mapping tables...
[2018-07-09 10:54:19] ### INFO ###### Loading table ('genesymbol', 'uniprot') ...
[2018-07-09 10:54:19] ### INFO ###### Table ('genesymbol', 'uniprot') loaded from UniprotMapping.

What am I doing wrong ?

Marie

Can't find direction/sign between two nodes

Hello,
I am trying to extract direction and sign from a network.

import pypath
from pypath import curl
from pypath import data_formats

pa = pypath.PyPath()
with curl.cache_off():
   pa.load_resources(data_formats.pathway)
list(pa.gs_inhibited_by('MYC').gs())
# One of the result is STAT1
# I want to verify the direction and sign between MYC and STAT1
pa.graph.es[pa.get_edge(pa.gs('MYC'), pa.gs('STAT1'))]['dirs']

The last command render me:
TypeError: igraph supports string attribute names only, got <type 'NoneType'>
It seems like there is no edge between MYC and STAT1 despite STAT1 was listed as a node inhibited by MYC.

Is there something I did wrong ?

Best,
@marie

Bug in pypath.PyPath.export_tab

I ran the export_tab function to save the pypath network to a table but got this error:

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-9-ab960315c620> in <module>()
----> 1 pa.export_tab('pypath.csv')

/home/nico/.local/lib/python2.7/site-packages/pypath/main.pyc in export_tab(self, extraNodeAttrs, extraEdgeAttrs, outfile)
   3788         ]
   3789         header += extraEdgeAttrs.keys()
-> 3790         header += [x + '_A' for x in extraNodeAttrs.keys()]
   3791         header += [x + '_B' for x in extraNodeAttrs.keys()]
   3792         stripJson = re.compile(r'[\[\]{}\"]')

AttributeError: 'str' object has no attribute 'keys'

AttributeError: 'str' object has no attribute 'items' in go_enrichment (py2.7)

Dear Denes,

following your documentation on http://pypath.omnipathdb.org/index.html#example-3-pathways-annotations my code crashes again in example 4:

notch = pa.pathway_members('Notch', 'signalink')
notch.up()
enr = pa.go_enrichment(list(notch.up()))

runs into:

AttributeError Traceback (most recent call last)
in ()
5 notch = pa.pathway_members('Notch', 'signalink')
6 notch.up()
----> 7 enr =pa.go_enrichment(list(notch.up()))

/home/user/.local/lib/python2.7/site-packages/pypath/main.pyc in go_enrichment(self, proteins, aspect, alpha, correction_method, all_proteins)
6870 annotation = dict([(up, g)
6871 for up, g in getattr(self.go[self.ncbi_tax_id],
-> 6872 iteritems(aspect.lower()))
6873 if up in all_proteins])
6874 enr = go.GOEnrichmentSet(

/home/user/.local/lib/python2.7/site-packages/future/utils/init.pyc in iteritems(obj, **kwargs)
304 func = getattr(obj, "iteritems", None)
305 if not func:
--> 306 func = obj.items
307 return func(**kwargs)
308

AttributeError: 'str' object has no attribute 'items'

What i tried so far:

  • checked for newest version of future/utils
-bash-4.2$ pip freeze | grep "future"
future==0.16.0
futures==3.2.0
  • tried hardcoding it
    pa.go_enrichment ('Q8NES3','Q9NYJ7') --> AttributeError: 'str' object has no attribute 'items'
    pa.go_enrichment (u'Q8NES3',u'Q9NYJ7') --> AttributeError: 'unicode' object has no attribute 'items'

I guess it is once again a python2.7 specific error ?

Best,
Ivo

User level cache directory by default

Currently by default pypath creates and uses a directory named cache in the current working directory. This is not the best practice:
-- Default cache should be in /home/user/.pypath/cache
-- Outside of this the directory should be called by default pypath-cache
(of course users always can give custom path for cache)

Issue with Signor in load_all_pathways

Hi,

Looks like there's a problem with Signor when running load_all_pathways().
I got the traceback below. Looks like in the signor_urls() function, an empty reference is passed to BS4.

/usr/local/lib/python2.7/dist-packages/pypath/main.pyc in load_all_pathways(self, graph)
   6942     def load_all_pathways(self, graph=None):
   6943         self.kegg_pathways(graph=graph)
-> 6944         self.signor_pathways(graph=graph)
   6945         self.pathway_attributes(graph=graph)
   6946 

/usr/local/lib/python2.7/dist-packages/pypath/main.pyc in signor_pathways(self, graph)
   6975 
   6976     def signor_pathways(self, graph=None):
-> 6977         self.load_pathways('signor', graph=graph)
   6978 
   6979     def kegg_pathways(self, graph=None):

/usr/local/lib/python2.7/dist-packages/pypath/main.pyc in load_pathways(self, source, graph)
   6949         g = self.graph if graph is None else graph
   6950         nodDct = dict(zip(g.vs['name'], xrange(g.vcount())))
-> 6951         proteins_pws, interactions_pws = self.get_pathways(source)
   6952         g.vs[attrname] = [set([]) for _ in g.vs]
   6953         g.es[attrname] = [set([]) for _ in g.es]

/usr/local/lib/python2.7/dist-packages/pypath/main.pyc in get_pathways(self, source)
   6928         if hasattr(dataio, attrname):
   6929             fun = getattr(dataio, attrname)
-> 6930             proteins_pws, interactions_pws = fun(mapper=self.mapper)
   6931         return proteins_pws, interactions_pws
   6932 

/usr/local/lib/python2.7/dist-packages/pypath/dataio.pyc in signor_pathways(**kwargs)
   4573 
   4574 def signor_pathways(**kwargs):
-> 4575     urls = signor_urls()
   4576     proteins_pathways = {}
   4577     interactions_pathways = {}

/usr/local/lib/python2.7/dist-packages/pypath/dataio.pyc in signor_urls()
   4564     c = curl.Curl(url, silent=True)
   4565     html = c.result
-> 4566     soup = bs4.BeautifulSoup(html, 'html.parser')
   4567     for td in soup.find_all('td', style=lambda x: x.startswith('border')):
   4568         pw = td.text.strip().split(':')[0]

/home/nico/.local/lib/python2.7/site-packages/bs4/__init__.pyc in __init__(self, markup, features, builder, parse_only, from_encoding, exclude_encodings, **kwargs)
    190         if hasattr(markup, 'read'):        # It's a file-type object.
    191             markup = markup.read()
--> 192         elif len(markup) <= 256 and (
    193                 (isinstance(markup, bytes) and not b'<' in markup)
    194                 or (isinstance(markup, unicode) and not u'<' in markup)

TypeError: object of type 'NoneType' has no len()

Unable to create a network

Hello,

I am new to OmniPath. After installation, I tried to extract a network using the sample code provided on OmniPath website.

import pypath
pa = pypath.PyPath()
pa.load_resources({'signor': pypath.data_formats.pathway['signor']})

However, I was unable to obtain any interaction or node.

image

I wonder if I can get some suggestions for trouble shooting? Thank you

neighborhood methods: TypeError: argument 2 to map() must support iteration (in py2.7)

Hello again :D,

going back and forth through your tutorial
http://pypath.omnipathdb.org/notebooks/pypath_build_networks.html
I found in "In [40]" another issue:
print list(pa.gs_neighborhood("EGFR").gs())
runs into the following error:


TypeError Traceback (most recent call last)
in ()
1 #The direct neighbors, without being aware of the directions are retrieved by neighbors methods:
----> 2 print list(pa.gs_neighborhood("EGFR").gs())

/home/user/.local/lib/python2.7/site-packages/pypath/main.pyc in gs_neighborhood(self, genesymbols, order, mode)
4994 genesymbols = [genesymbols]
4995 vs = self.genesymbols(genesymbols)
-> 4996 return self._neighborhood(vs, order=order, mode=mode)
4997
4998 def neighborhood(self, identifiers, order=1, mode='ALL'):

/home/user/.local/lib/python2.7/site-packages/pypath/main.pyc in _neighborhood(self, vs, order, mode)
4980 lambda a, b: a.extend(b),
4981 self.graph.neighborhood(
-> 4982 vs, order=order, mode=mode), [])),
4983 self.nodNam,
4984 self.nodLab)

TypeError: argument 2 to map() must support iteration

*Note since I do not really need that feature for my web app
treat this issue with a low priority

Best,
Ivo

PyPath.degree_dists() not writing any files

I tried the function PyPath.degree_dists() and even though there was no error, no files were written in the results/ folder (I checked and PyPath.outdir points there) 😟

ValueError: readline of closed file in read_mapping_file

Hi

I installed the latest pypath version within a new conda environment on a Ubuntu 18.04 machine:

# Name                    Version                   Build    Channel
asn1crypto                0.24.0                    <pip>
beautifulsoup4            4.6.3                     <pip>
ca-certificates           2018.03.07                    0    anaconda
cairo                     1.14.12              h8948797_3    anaconda
certifi                   2018.8.24                py36_1    anaconda
cffi                      1.11.5                    <pip>
chardet                   3.0.4                     <pip>
chembl-webresource-client 0.9.31                    <pip>
configparser              3.5.0                     <pip>
cryptography              2.3.1                     <pip>
cycler                    0.10.0                    <pip>
easydict                  1.8                       <pip>
expat                     2.2.6                he6710b0_0    anaconda
fisher                    0.1.5                     <pip>
fontconfig                2.13.0               h9420a91_0    anaconda
freetype                  2.9.1                h8a8886c_1    anaconda
fribidi                   1.0.5                h7b6447c_0    anaconda
future                    0.16.0                    <pip>
gevent                    1.3.6                     <pip>
gevent-openssl            1.2                       <pip>
glib                      2.56.2               hd408876_0    anaconda
gmp                       6.1.2                hfc679d8_0    conda-forge
graphite2                 1.3.12               h23475e2_2    anaconda
graphviz                  2.40.1               h21bd128_2    anaconda
greenlet                  0.4.15                    <pip>
grequests                 0.2.0                     <pip>
harfbuzz                  1.8.8                hffaf4a1_0    anaconda
httplib2                  0.11.3                    <pip>
icu                       58.2                 h211956c_0    anaconda
idna                      2.7                       <pip>
igraph                    0.7.1                hcc8e21d_5    conda-forge
jpeg                      9b                   habf39ab_1    anaconda
kiwisolver                1.0.1                     <pip>
libcurl                   7.61.1               heec0ca6_0    anaconda
libffi                    3.2.1                h4deb6c0_3    anaconda
libgcc-ng                 8.2.0                hdf63c60_1    anaconda
libgfortran-ng            7.2.0                hdf63c60_3    conda-forge
libiconv                  1.15                 h470a237_3    conda-forge
libpng                    1.6.34               hb9fc6fc_0    anaconda
libssh2                   1.8.0                h9cfc8f7_4    anaconda
libstdcxx-ng              8.2.0                hdf63c60_1    anaconda
libtiff                   4.0.9                he85c1e1_2    anaconda
libuuid                   1.0.3                h1bed415_2    anaconda
libxcb                    1.13                 h1bed415_1    anaconda
libxml2                   2.9.8                h26e45fe_1    anaconda
lxml                      4.2.5                     <pip>
matplotlib                3.0.0                     <pip>
ndg-httpsclient           0.5.1                     <pip>
openssl                   1.0.2p               h14c3975_0    anaconda
pandas                    0.23.4                    <pip>
pango                     1.42.4               h049681c_0    anaconda
patsy                     0.5.0                     <pip>
pcre                      8.42                 h439df22_0    anaconda
pip                       10.0.1                   py36_0    anaconda
pixman                    0.34.0               ha72d70b_1    anaconda
pyasn1                    0.4.4                     <pip>
pycairo                   1.17.1           py36h2a1e443_0    anaconda
pycparser                 2.19                      <pip>
pycurl                    7.43.0.2         py36hb7f436b_0    anaconda
pygraphviz                1.3              py36h14c3975_1    anaconda
pyOpenSSL                 18.0.0                    <pip>
pyparsing                 2.2.2                     <pip>
pypath                    0.7.90                    <pip>
python                    3.6.0                         0    anaconda
python-dateutil           2.7.3                     <pip>
python-igraph             0.7.1.post6      py36h470a237_5    conda-forge
pytz                      2018.5                    <pip>
readline                  6.2                           2    anaconda
requests                  2.19.1                    <pip>
requests-cache            0.4.13                    <pip>
scipy                     1.1.0                     <pip>
setuptools                40.2.0                   py36_0    anaconda
sqlite                    3.13.0                        0    anaconda
statsmodels               0.9.0                     <pip>
tk                        8.5.18                        0    anaconda
tqdm                      4.26.0                    <pip>
unittest2py3k             0.5.1                     <pip>
unittest2six              0.0.0                     <pip>
urllib3                   1.23                      <pip>
wheel                     0.31.1                   py36_0    anaconda
xlrd                      1.1.0                     <pip>
xz                        5.2.4                h14c3975_4    anaconda
zlib                      1.2.11               hfbfcf68_1    anaconda

Then I tried running the following code:

>>> import pypath
	:: No MySQL support.
	:: No MySQL support.

	:: Module `pyfstp` not available. 
        Only downloading of a small number of resources 
        relies on this module.
        Please install by PIP if it is necessary for you.
    No `fabric` available.
	:: No `bioservices` available.
	:: Module `hcluster` not available.
>>> pa = pypath.PyPath()

	=== d i s c l a i m e r ===

	All data coming with this module
	either as redistributed copy or downloaded using the
	programmatic interfaces included in the present module
	are available under public domain, are free to use at
	least for academic research or education purposes.
	Please be aware of the licences of all the datasets
	you use in your analysis, and please give appropriate
	credits for the original sources when you publish your
	results. To find out more about data sources please
	look at `pypath.descriptions` and
	`pypath.data_formats.urls`.

	> New session started,
	session ID: 'gz3n7'
	logfile: './log/gz3n7.log'
	pypath version: 0.7.90
>>> pa.load_omnipath()
	:: Loading data from cache previously downloaded from www.uniprot.org
        :: Ready. Resulted `plain text` of type unicode string.                                                                                       
	:: Local file at `/home/jonas/pypath/cache/784f0a43e5831454b1d10db1b9480df7-`.
 > TRIP
	:: Loading 'uniprot-sec' to 'uniprot-pri' mapping table
	:: Loading data from cache previously downloaded from www.uniprot.org
        :: Ready. Resulted `plain text` of type unicode string.                                                                                       
	:: Local file at `/home/jonas/pypath/cache/c87b574b25efc888967e7ab939302989-`.
        Downloading `sec_ac.txt` from ftp.uniprot.org -- 24.42MB downloaded: 100%|███████████████████████████████| 24.4M/24.4M [00:26<00:00, 859kit/s]
        :: Ready. Resulted `plain text` of type file object.                                                                                          
	:: Local file at `/home/jonas/pypath/cache/49314fe217bf0f2a5544a2c4314b4adf-sec_ac.txt`.
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 7725, in load_omnipath
    self.load_resources(omnipath, exclude = exclude)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 3401, in load_resources
    redownload=redownload)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 3440, in load_resource
    redownload=redownload)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 1368, in read_data_file
    edgeListMapped = self.map_list(edgeList)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 1630, in map_list
    listMapped += self.map_edge(edge)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/main.py", line 1653, in map_edge
    ncbi_tax_id = edge['taxA'])
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 689, in map_name
    mappedNames = self.primary_uniprot(mappedNames)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 768, in primary_uniprot
    pr = self.map_name(u, 'uniprot-sec', 'uniprot-pri', ncbi_tax_id = 0)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 652, in map_name
    ncbi_tax_id)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 753, in _map_name
    ncbi_tax_id = ncbi_tax_id)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 530, in which_table
    ncbi_tax_id=ncbi_tax_id)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 887, in load_mappings
    cachedir=self.cachedir
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 116, in __init__
    self.read_mapping_file(param, ncbi_tax_id)
  File "/home/jonas/.conda/envs/pypath/lib/python3.6/site-packages/pypath/mapping.py", line 160, in read_mapping_file
    infile = list(toCall(**inputArgs))
ValueError: readline of closed file

I also tried

  • using pypath 0.7.93 (latest version on GitHub),
  • re-downloading the data by deleting all local pypath data directories and
  • re-running the script in a new shell.

I'd appreciate any help in getting pypath to work!

Bug on main.PyPath.all_between()

Got a TypeError when calling all_between function.
I think that in line 2356 (src/pypath/main.py of v0.7.3), when calling self.edge_exists(), self should not be passed as an argument since it is a function of the same instance.
eid = self.edge_exists(self, nameA, nameB)
should be:
eid = self.edge_exists(nameA, nameB)

settings module

pypath should have one settings module where various global settings could be set and checked by users. E.g. settings.set('verbose', 1)
All other modules should get the settings from here.

Example 2 does not work

Hi,

When I try to run your example 2

from bioigraph import mapping
m = mapping.Mapper((None, 'mysql_gelati'))
m.load_mappings()
result = {}
gene_list = ['EGFR', 'AKT1', 'GABARAPL1', 'TP53']
for g in gene_list:
    result[g] = m.map_name(g, 'genesymbol', 'uniprot')

I get the following error:

AttributeError: 'MysqlRunner' object has no attribute 'result'

Is there anything I need to set up with MySQL prior to running the examples?

Problems loading GO

Hi Dénes,
I was trying to load both the intercell and annotations data but both raised an error.

For the intercellular, when running annot.AnnotationTable(keep_annotators=True) I get problems with the JSON decoder. Traceback is:

---------------------------------------------------------------------------
JSONDecodeError                           Traceback (most recent call last)
<ipython-input-17-473ebc168951> in <module>
----> 1 a = annot.AnnotationTable(keep_annotators=True)

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, uniprots, use_sources, use_fields, ncbi_tax_id, swissprot_only, keep_annotators, load)
   1242         if load:
   1243 
-> 1244             self.load()
   1245 
   1246 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in load(self)
   1266 
   1267             annot = getattr(self._module, cls)(
-> 1268                 ncbi_tax_id = self.ncbi_tax_id
   1269             )
   1270 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, categories, go_annot, ncbi_tax_id)
    970             self,
    971             name = 'GO_Intercell',
--> 972             ncbi_tax_id = ncbi_tax_id,
    973         )
    974 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, name, ncbi_tax_id, input_method, input_args, **kwargs)
    317         )
    318 
--> 319         self.load()
    320 
    321 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in load(self)
    984             categories = self.categories,
    985             go_annot = self.go_annot,
--> 986             ncbi_tax_id = self.ncbi_tax_id,
    987         )
    988 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, categories, go_annot, ncbi_tax_id)
    946             categories = categories,
    947             go_annot = go_annot,
--> 948             ncbi_tax_id = ncbi_tax_id,
    949         )
    950 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in __init__(self, categories, go_annot, ncbi_tax_id)
    847         session_mod.Logger.__init__(self, name = 'go')
    848 
--> 849         self.go_annot = go_annot or get_db() # TODO: consider ncbi_tax_id at
    850                                              # selection DB
    851 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in get_db()
    999     if 'db' not in globals():
   1000 
-> 1001         init_db()
   1002 
   1003     return globals()['db']

/usr/local/lib/python3.7/dist-packages/pypath/go.py in init_db()
    984     """
    985 
--> 986     globals()['db'] = GOAnnotation()
    987 
    988 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in __init__(self, organism, ontology)
    345         session_mod.Logger.__init__(self, name = 'go')
    346 
--> 347         self.ontology = ontology or GeneOntology()
    348 
    349         annot = dataio.go_annotations_goa(organism = organism)

/usr/local/lib/python3.7/dist-packages/pypath/go.py in __init__(self)
     62         session_mod.Logger.__init__(self, name = 'go')
     63 
---> 64         self._load()
     65 
     66 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in _load(self)
     77     def _load(self):
     78 
---> 79         self._load_terms()
     80         self._load_tree()
     81         self._set_aspect()

/usr/local/lib/python3.7/dist-packages/pypath/go.py in _load_terms(self)
     88     def _load_terms(self):
     89 
---> 90         self._terms = dataio.go_terms_quickgo()
     91 
     92 

/usr/local/lib/python3.7/dist-packages/pypath/dataio.py in go_terms_quickgo(aspects)
   4217         c = curl.Curl(page_url, silent = True)
   4218 
-> 4219         this_result = json.loads(c.result)
   4220         last_page = this_result['pageInfo']['total']
   4221 

/usr/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    346             parse_int is None and parse_float is None and
    347             parse_constant is None and object_pairs_hook is None and not kw):
--> 348         return _default_decoder.decode(s)
    349     if cls is None:
    350         cls = JSONDecoder

/usr/lib/python3.7/json/decoder.py in decode(self, s, _w)
    335 
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()
    339         if end != len(s):

/usr/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)
    351         """
    352         try:
--> 353             obj, end = self.scan_once(s, idx)
    354         except StopIteration as err:
    355             raise JSONDecodeError("Expecting value", s, err.value) from None

JSONDecodeError: Unterminated string starting at: line 1 column 97945 (char 97944)

When loading the annotations with intercell.IntercellAnnotation():

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-27-1b0e9044a0e5> in <module>
----> 1 i = intercell.IntercellAnnotation()

/usr/local/lib/python3.7/dist-packages/pypath/intercell.py in __init__(self, class_definitions)
     48         annot.CustomAnnotation.__init__(
     49             self,
---> 50             class_definitions = class_definitions,
     51         )
     52 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, class_definitions)
     87         session_mod.Logger.__init__(self, name = 'annot')
     88 
---> 89         self.annotdb = get_db()
     90 
     91         self._class_definitions = {}

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in get_db(keep_annotators)
   1474     if 'db' not in globals():
   1475 
-> 1476         init_db(keep_annotators = keep_annotators)
   1477 
   1478     return globals()['db']

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in init_db(keep_annotators)
   1463     """
   1464 
-> 1465     globals()['db'] = AnnotationTable(keep_annotators = keep_annotators)
   1466 
   1467 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, uniprots, use_sources, use_fields, ncbi_tax_id, swissprot_only, keep_annotators, load)
   1242         if load:
   1243 
-> 1244             self.load()
   1245 
   1246 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in load(self)
   1266 
   1267             annot = getattr(self._module, cls)(
-> 1268                 ncbi_tax_id = self.ncbi_tax_id
   1269             )
   1270 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, categories, go_annot, ncbi_tax_id)
    970             self,
    971             name = 'GO_Intercell',
--> 972             ncbi_tax_id = ncbi_tax_id,
    973         )
    974 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in __init__(self, name, ncbi_tax_id, input_method, input_args, **kwargs)
    317         )
    318 
--> 319         self.load()
    320 
    321 

/usr/local/lib/python3.7/dist-packages/pypath/annot.py in load(self)
    987         )
    988 
--> 989         annot_uniprots = annot.get_annotations()
    990 
    991         _annot = collections.defaultdict(set)

/usr/local/lib/python3.7/dist-packages/pypath/go.py in get_annotations(self, uniprots)
    937                 self.get_annotation(category, uniprots = uniprots)
    938             )
--> 939             for category in self.categories.keys()
    940         )
    941 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in <genexpr>(.0)
    937                 self.get_annotation(category, uniprots = uniprots)
    938             )
--> 939             for category in self.categories.keys()
    940         )
    941 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in get_annotation(self, category, uniprots)
    919             self.categories[category],
    920             uniprots = uniprots,
--> 921             return_uniprots = True,
    922         )
    923 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in select(self, terms, uniprots, return_uniprots)
    781         if isinstance(terms, common.basestring) and len(terms) > 10:
    782 
--> 783             result = self.select_by_expr(terms, uniprots = uniprots)
    784 
    785         # either one term or a set of terms

/usr/local/lib/python3.7/dist-packages/pypath/go.py in select_by_expr(self, expr, uniprots, return_uniprots)
    630             expr = expr,
    631             uniprots = uniprots,
--> 632             return_uniprots = return_uniprots,
    633         )
    634 

/usr/local/lib/python3.7/dist-packages/pypath/go.py in select_by_expr_terms(self, expr, uniprots, return_uniprots)
    705 
    706             # we do actual processing of the expression
--> 707             elif it.lower() == 'not':
    708 
    709                 # token is negation

AttributeError: 'NoneType' object has no attribute 'lower'

Do you also get this or am I missing something?

Thanks for your help

Option to turn off progressbar

-- Add an option to progress module to not to show progress bars
-- Add some global option to make entire pypath run without any console output, including log and console messages
-- Add context handler to progress to temporarily turn off the progressbar (e.g. with progress.noprogress():)

Problems with interpreting Signor interactions

Following the intro from here: http://pypath.omnipathdb.org/notebooks/intro.html

After downloading Signor interactions, I get warnings saying "Line x has less than 22 fields, skipping".
When I check the cached file, the file does have more than 22 fields.

Going into Main.py and printing the lines in the if statement at line 1220 (if len(line) < maxCol), the lines have \t as delimiter, but settings.separator is None. I assume this is the issue.
Tried to find where settings.separator is set, but did not find where this was done.

This was run on a fresh download from GitHub of latest version downloaded 17th of January, with Anaconda on Ubuntu 16.10.

I've attached my log file and my test script
test.txt
2788j.log

Improve logging

We have a logger module but it is rarely used, it only logs a few messages at loading network resources.
-- All modules should use the logger instead of sys.stdout.write.
-- Messages should have a verbosity level assigned and directed to logfile or stdout depending on parameters set by the user
-- This way all the junk now thrown in the console an uncontrolled way should disappear
-- Also the log directory should be called pypath-log instead of log

TypeError: a class that defines __slots__ without defining __getstate__ cannot be pickled in save_network (py2.7)

Dear Denes,

thank you for fixing the last bug again so quickly! :)

Here is another one ;D This error arises when calling pa.save_network()

TypeError Traceback (most recent call last)
in ()
----> 1 pa.save_network()

/home/user/.local/lib/python2.7/site-packages/pypath/main.pyc in save_network(self, pfile)
837 pfile = pfile if pfile is not None
838 else os.path.join('cache', 'default_network.pickle')
--> 839 pickle.dump(self.graph, open(pfile, 'wb'))
840 ###
841 # functions to read networks from text files or mysql

/usr/lib64/python2.7/copy_reg.pyc in _reduce_ex(self, proto)
75 except AttributeError:
76 if getattr(self, "slots", None):
---> 77 raise TypeError("a class that defines slots without "
78 "defining getstate cannot be pickled")
79 try:

TypeError: a class that defines slots without defining getstate cannot be pickled

Best,
Ivo

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.