Skip to content

Commit

Permalink
Merge pull request #1 from dstrib/master
Browse files Browse the repository at this point in the history
Version 0.1.8, Publish to PyPi/pip
  • Loading branch information
dstrib committed Mar 10, 2020
2 parents 81353b6 + f562044 commit e058208
Show file tree
Hide file tree
Showing 18 changed files with 101 additions and 158,388 deletions.
14 changes: 12 additions & 2 deletions README.rst
Expand Up @@ -2,9 +2,15 @@
hybkit
==================================

.. image:: https://img.shields.io/github/v/release/RenneLab/hybkit
:alt: GitHub release (latest by date)
.. image:: https://badge.fury.io/py/hybkit.svg
:target: https://badge.fury.io/py/hybkit
.. image:: https://readthedocs.org/projects/hybkit/badge/?version=latest
:target: https://hybkit.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
:target: https://hybkit.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://img.shields.io/pypi/pyversions/hybkit
:alt: PyPI - Python Version


| Welcome to *hybkit*, a toolkit for analysis of ".hyb" format genomic sequence data
Expand Down Expand Up @@ -131,3 +137,7 @@ Followed by installation using python's setuptools::
$ python setup.py install



.. |hybkit Toolkit| replace:: *hybkit Toolkit*
.. |Example Pipelines| replace:: *Example Pipelines*
.. |hybkit API| replace:: *hybkit API*
79,166 changes: 0 additions & 79,166 deletions databases/Human_mRNAs.csv

This file was deleted.

4 changes: 0 additions & 4 deletions databases/Human_mRNAs.notes.txt

This file was deleted.

79,166 changes: 0 additions & 79,166 deletions databases/Human_mRNAs_mod.csv

This file was deleted.

1 change: 1 addition & 0 deletions docs/requirements.txt
@@ -1 +1,2 @@
matplotlib
importlib_resources
11 changes: 0 additions & 11 deletions docs/run_apidoc.sh

This file was deleted.

46 changes: 36 additions & 10 deletions hybkit/__about__.py
Expand Up @@ -8,22 +8,48 @@
'''

import os
import sys
if sys.version_info.major >= 3 and sys.version_info.minor >= 7:
from importlib import resources as importlib_resources
else:
import importlib_resources

# Set package directory and code directory
package_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
code_dir = os.path.join(package_dir, 'hybkit')
data_dir = os.path.join(package_dir, 'databases')

# Preparation for initial PIP release, not yet completed.
project_name = 'hybkit'
description = 'Toolkit for analysis of .hyb format genomic sequence data.'
version = "0.1.8"
description = 'Toolkit for analysis of .hyb format genomic '
description += 'sequence data from ribonomics experiments.'
project_url = 'https://github.com/RenneLab/hybkit'
project_download_url = 'https://github.com/RenneLab/hybkit' + '/tarball/' + version
keywords = 'genetics genomics ribonomics bioinformatics hyb CLASH qCLASH miRNA '
keywords += 'RNA DNA vienna viennad unafold'
name_and_version = project_name + '-' + version

module_dir = importlib_resources.files('hybkit')
prefix_data_dir = os.path.join(sys.prefix, name_and_version)
#Putting in try block to allow use with exec()
try:
local_data_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
except NameError:
local_data_dir = 'using_with_exec'

if os.path.isdir(os.path.join(prefix_data_dir, 'databases')):
hybkit_data_dir = prefix_data_dir
elif os.path.isdir(os.path.join(local_data_dir, 'databases')):
hybkit_data_dir = local_data_dir
else:
print('WARNING: hybkit_data_dir variable cannot be set.')
hybkit_data_dir = ''

databases_dir = os.path.join(hybkit_data_dir, 'databases')
reference_data_dir = os.path.join(hybkit_data_dir, 'reference_data')
docs_dir = os.path.join(hybkit_data_dir, 'docs')
scripts_extra_dir = os.path.join(hybkit_data_dir, 'scripts_extra')

default_string_match_params = os.path.join(module_dir, 'string_match_params.csv')

# For a list of valid classifiers, see https://pypi.org/classifiers/
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Development Status :: 4 - Beta',
'Natural Language :: English',
'Intended Audience :: Science/Research',
'Intended Audience :: Developers',
Expand All @@ -48,11 +74,11 @@
__author__ = "Daniel Stribling"
__contact__ = "ds@ufl.edu"
__credits__ = ["Daniel B. Stribling", "Rolf Renne"]
__date__ = "YYYY/MM/DD"
__date__ = "2020/03/10"
__deprecated__ = False
__email__ = "ds@ufl.edu"
__license__ = "GPLv3"
__maintainer__ = "Renne Group, University of Florida"
__status__ = "Development"
__version__ = "0.1.0"
__version__ = version
spec_version = __version__ # Define separate specification version.
2 changes: 1 addition & 1 deletion hybkit/__init__.py
Expand Up @@ -1510,7 +1510,7 @@ def find_seg_type_string_match(seg_info, find_type_params={}, check_complete=Fal
# HybRecord : Public Staticmethods : find_seg_type
@staticmethod
def make_string_match_parameters(
legend_file=os.path.join(hybkit.__about__.code_dir, 'find_type_string_match.csv')
legend_file=hybkit.__about__.default_string_match_params
):
"""Read csv and return a dict of search parameters for :func:`find_seg_type_string_match`.
Expand Down
4 changes: 0 additions & 4 deletions sample_01_summary_analysis/analysis_python.py
Expand Up @@ -13,10 +13,6 @@

import os
import sys

# Ensure hybkit is accessible
analysis_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(analysis_dir, '..'))
import hybkit

# Set count_mode:
Expand Down
4 changes: 0 additions & 4 deletions sample_02_target_analysis/analysis_python.py
Expand Up @@ -13,10 +13,6 @@

import os
import sys

# Ensure hybkit is accessible
analysis_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(analysis_dir, '..'))
import hybkit

# Set count_mode:
Expand Down
4 changes: 0 additions & 4 deletions sample_03_grouped_target_analysis/analysis_python.py
Expand Up @@ -13,10 +13,6 @@

import os
import sys

# Ensure hybkit is accessible
analysis_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(analysis_dir, '..'))
import hybkit

# Set count_mode:
Expand Down
4 changes: 0 additions & 4 deletions sample_04_fold_analysis/analysis_python.py
Expand Up @@ -13,10 +13,6 @@

import os
import sys

# Ensure hybkit is accessible
analysis_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(analysis_dir, '..'))
import hybkit

# Set count_mode:
Expand Down
4 changes: 2 additions & 2 deletions sample_04_fold_analysis/prepare_data.sh
Expand Up @@ -8,8 +8,8 @@
echo -e "\nPreparing data for sample fold analysis."

echo -e "\nCopying data to analysis directory."
cp -v ../databases/WT_BR1_comp_hOH7_KSHV_hybrids_ua.hyb.gz \
../databases/WT_BR1_comp_hOH7_KSHV_hybrids_ua.viennad.gz \
cp -v ../reference_data/WT_BR1_comp_hOH7_KSHV_hybrids_ua.hyb.gz \
../reference_data/WT_BR1_comp_hOH7_KSHV_hybrids_ua.viennad.gz \
./


Expand Down
4 changes: 0 additions & 4 deletions sample_05_fold_target_region_analysis/analysis_python.py
Expand Up @@ -13,10 +13,6 @@

import os
import sys

# Ensure hybkit is accessible
analysis_dir = os.path.abspath(os.path.dirname(__file__))
sys.path.append(os.path.join(analysis_dir, '..'))
import hybkit

# Set count_mode:
Expand Down
4 changes: 2 additions & 2 deletions sample_05_fold_target_region_analysis/prepare_data.sh
Expand Up @@ -8,8 +8,8 @@
echo -e "\nPreparing data for sample fold analysis."

echo -e "\nCopying data to analysis directory."
cp -v ../databases/WT_BR1_comp_hOH7_KSHV_hybrids_ua.hyb.gz \
../databases/WT_BR1_comp_hOH7_KSHV_hybrids_ua.viennad.gz \
cp -v ../reference_data/WT_BR1_comp_hOH7_KSHV_hybrids_ua.hyb.gz \
../reference_data/WT_BR1_comp_hOH7_KSHV_hybrids_ua.viennad.gz \
./


Expand Down
51 changes: 47 additions & 4 deletions setup.py
Expand Up @@ -9,35 +9,78 @@

import setuptools
import os
import hybkit
import glob

# Set project directory
proj_dir = os.path.abspath(os.path.dirname(__file__))

# Get the long description from the README file
with open(os.path.join(proj_dir, 'README.md'), encoding='utf-8') as f:
with open(os.path.join(proj_dir, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()

# Get the remaining project details variables from the "__about__.py" file.
about_vars = {}
with open(os.path.join(proj_dir, 'hybkit', '__about__.py')) as f:
exec(f.read(), about_vars)

# Dynamically generate reference data file tuples:
data_files = []
data_file_dirs = ['scripts', 'scripts_extra', 'databases', 'reference_data', 'hybkit']
sample_directory_dirs = glob.glob('sample_0*')
data_file_dirs += sample_directory_dirs
for item in glob.glob('docs/**', recursive=True):
if os.path.isdir(item) and not item.startswith(os.path.join('docs','_')):
data_file_dirs.append(item)

for dir_name in data_file_dirs:
file_list = [f for f in glob.glob(os.path.join(dir_name, '*'))
if not (
(os.path.isdir(f))
or ('/output' in f)
or (f.endswith('.hyb'))
or (f.endswith('.viennad'))
or (f.endswith('.vienna'))
or (f.endswith('.ct'))
or (f.endswith('__'))
or (f.endswith('.pyc'))

)]
target_dir_name = os.path.join(about_vars['name_and_version'], dir_name)
data_files.append((target_dir_name, file_list))

setuptools.setup(
name='hybkit',
version=about_vars['__version__'],
description=about_vars['description'],
long_description=long_description,
long_description_content_type='text/markdown',
long_description_content_type='text/x-rst',
url=about_vars['project_url'],
download_url=about_vars['project_download_url'],
author=about_vars['__author__'],
author_email=about_vars['__contact__'],
classifiers=about_vars['classifiers'],
keywords='genetics genomics ribonomics bioinformatics CLASH qCLASH miRNA',
packages=setuptools.find_packages(where='src'),
packages=['hybkit'],
package_dir={'hybkit': 'hybkit'},
package_data={
'hybkit': [os.path.basename(f) for f in glob.glob('hybkit/*')
if not (os.path.basename(f).endswith('.py')
or os.path.basename(f).endswith('__'))]
},
python_requires='>=3.6',
project_urls=about_vars['info_urls'],
data_files=data_files,
#[
# ('databases', glob.glob('databases/*')),
# ('reference_data', glob.glob('reference_data/*')),
#],


install_requires=['matplotlib'], # Optional
install_requires=[
'matplotlib',
'importlib_resources',
], # Optional

# To provide executable scripts, use entry points in preference to the
# "scripts" keyword. Entry points provide cross-platform support and allow
Expand Down

0 comments on commit e058208

Please sign in to comment.