Skip to content

Commit

Permalink
resources.network: wrapper around original module adds license info…
Browse files Browse the repository at this point in the history
…rmation to input definitions from controller - saezlab/OmnipathR#87
  • Loading branch information
deeenes committed Apr 9, 2024
1 parent b59e23c commit 33d0795
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions pypath/resources/network.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-

#
# This file is part of the `pypath` python module
#
# Copyright 2014-2024
# EMBL, EMBL-EBI, Uniklinik RWTH Aachen, Heidelberg University
#
# Authors: see the file `README.rst`
# Contact: Dénes Türei ([email protected])
#
# Distributed under the GPLv3 License.
# See accompanying file LICENSE.txt or copy at
# https://www.gnu.org/licenses/gpl-3.0.html
#
# Website: https://pypath.omnipathdb.org/
#

import pypath.resources._network as _netres
import pypath.resources as _resources
import pypath.internals.resource as _resfmt
from pypath.resources._network import choose_dataset, dorothea_expand_levels

_co = _resources.get_controller()

for _dataset_label in dir(_netres):

_dataset = getattr(_netres, _dataset_label)

if not isinstance(_dataset, _resfmt.NetworkDataset):

continue

for _label, _resource in _dataset.items():

_resource.resource_attrs['license'] = _co.license(_resource.name)

globals()[_dataset_label] = _dataset

0 comments on commit 33d0795

Please sign in to comment.