Commit d64ebcc6 authored by Lukas Jelonek's avatar Lukas Jelonek
Browse files

Refactor project such that it can be build and deployed via pip

parent 8e6a7f70
*.pyc
docs/build/
build/
dist/
*.egg-info/
*.egg
*.py[cod]
__pycache__/
*.so
*~
docs/_build/
The MIT License (MIT)
Copyright (c) 2017 SOaAS
Copyright (c) 2017 Lukas Jelonek
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
......
# DB XREF resolver and retriever tool
A tool that resolves db_xrefs into URLs and that retrieves the data as json documents.
A tool that resolves database cross references (dbxrefs). It can return a list of
locations where the cross reference points to in different formats, like HTML,
XML, flat file or json. It can also retrieve the data for some of the supported
databases and convert it into json.
# Getting started (Setup)
The intended audience for this tool are bioinformatician that need to collect
data for dbxrefs and postprocess it. By returning everything in json format the
need for normalization and special parsing of the data is reduced.
# Getting started for development (Setup)
Prerequisites:
......@@ -11,10 +18,24 @@ Prerequisites:
Supported bioinformatic databases:
* None yet
* Ontologies
* Gene Ontology
Checkout the repository:
~~~~
git clone git@git.computational.bio.uni-giessen.de:SOaAS/dbxref.git
~~~~
Setup a virtualenv for development and install it in editable mode:
~~~~
virtualenv --python=python3 venv; source venv/bin/activate;
pip install -e .
~~~~
Use the application:
~~~~
dbxref resolve GO:0097281
~~~~
#!/usr/bin/env python3
import os
import sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from dbxref.main import main
main()
def get_install_location():
"""Finds the location directory of the tool"""
import os
script_path = os.path.realpath(__file__)
script_dir = os.path.dirname(script_path)
install_dir = os.path.dirname(script_dir)
return install_dir
def get_providers_path():
import pkg_resources
return pkg_resources.resource_filename('dbxref', 'providers.yaml')
def load_providers():
import yaml
data = []
with open(get_install_location() + '/providers.yaml') as data_file:
with open(get_providers_path()) as data_file:
data = yaml.load(data_file)
return index_providers(data)
......
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
# Get the long description from the README file
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='dbxref',
version='0.1.0',
description='A library for resolving database cross references',
long_description=long_description,
url='https://git.computational.bio.uni-giessen.de/SOaAS/dbxref',
author='Lukas Jelonek',
author_email='Lukas.Jelonek@computational.bio.uni-giessen.de',
keywords='dbxref',
packages=find_packages(exclude=['contrib', 'docs', 'tests']),
package_data={'dbxref':['*.yaml']},
install_requires=[
'requests',
'cachecontrol',
'pyyaml',
'lockfile'
],
entry_points={
'console_scripts': [
'dbxref=dbxref.main:main',
],
},
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment