From 4578ac47f805817d5235ff6844a1cd0aa678a79e Mon Sep 17 00:00:00 2001 From: jfsanchezherrero Date: Sun, 28 Feb 2021 08:32:38 +0100 Subject: [PATCH] refurbishment --- code/.project | 17 ------- code/.pydevproject | 18 ------- code/.setup.py.swp | Bin 0 -> 1024 bytes code/BacDup/__init__.py | 14 ++++++ code/{ => BacDup/modules}/dup_annot.py | 0 code/{ => BacDup/modules}/dup_searcher.py | 0 code/{ => BacDup/modules}/input_parser.py | 0 code/{ => BacDup/other_tools}/dup_biocircos.R | 0 code/{ => BacDup/scripts}/blast_caller.py | 0 code/{ => BacDup/scripts}/output.py | 0 code/{ => BacDup/scripts}/protein_gbf.py | 0 code/{ => BacDup/scripts}/protein_gff.py | 0 code/LICENSE | 21 +++++++++ code/VERSION | 0 code/devel/clean_devel.sh | 9 ++++ code/devel/create_distro.sh | 4 ++ code/devel/developer_guidelines.txt | 24 ++++++++++ code/devel/requirements.txt | 3 ++ code/devel/test_module.sh | 1 + code/devel/upload_pypi.sh | 1 + code/{ => main}/parser.py | 0 code/setup.py | 44 ++++++++++++++++++ 22 files changed, 121 insertions(+), 35 deletions(-) delete mode 100644 code/.project delete mode 100644 code/.pydevproject create mode 100644 code/.setup.py.swp create mode 100644 code/BacDup/__init__.py rename code/{ => BacDup/modules}/dup_annot.py (100%) rename code/{ => BacDup/modules}/dup_searcher.py (100%) rename code/{ => BacDup/modules}/input_parser.py (100%) rename code/{ => BacDup/other_tools}/dup_biocircos.R (100%) rename code/{ => BacDup/scripts}/blast_caller.py (100%) rename code/{ => BacDup/scripts}/output.py (100%) rename code/{ => BacDup/scripts}/protein_gbf.py (100%) rename code/{ => BacDup/scripts}/protein_gff.py (100%) create mode 100644 code/LICENSE create mode 100644 code/VERSION create mode 100644 code/devel/clean_devel.sh create mode 100644 code/devel/create_distro.sh create mode 100644 code/devel/developer_guidelines.txt create mode 100644 code/devel/requirements.txt create mode 100644 code/devel/test_module.sh create mode 100644 code/devel/upload_pypi.sh rename code/{ => main}/parser.py (100%) create mode 100644 code/setup.py diff --git a/code/.project b/code/.project deleted file mode 100644 index 08df766..0000000 --- a/code/.project +++ /dev/null @@ -1,17 +0,0 @@ - - - ejercicios - - - - - - org.python.pydev.PyDevBuilder - - - - - - org.python.pydev.pythonNature - - diff --git a/code/.pydevproject b/code/.pydevproject deleted file mode 100644 index a4e53a6..0000000 --- a/code/.pydevproject +++ /dev/null @@ -1,18 +0,0 @@ - - - - - /${PROJECT_DIR_NAME} - - - python interpreter - - Default - - - - /home/alba/environments/TFM - - - - diff --git a/code/.setup.py.swp b/code/.setup.py.swp new file mode 100644 index 0000000000000000000000000000000000000000..d54682024cbaa3c01d30e99564244d1c1c36916b GIT binary patch literal 1024 zcmYc?$V<%2S1{HyVn6|F}4=lMN*R literal 0 HcmV?d00001 diff --git a/code/BacDup/__init__.py b/code/BacDup/__init__.py new file mode 100644 index 0000000..43e21e4 --- /dev/null +++ b/code/BacDup/__init__.py @@ -0,0 +1,14 @@ +from pkg_resources import get_distribution +try: + __version__ = get_distribution('BacDup').version +except: + __version__ = 'local' + +__all__ = [ + 'modules', + 'scripts', + 'config' +] + +from BacDup import * + diff --git a/code/dup_annot.py b/code/BacDup/modules/dup_annot.py similarity index 100% rename from code/dup_annot.py rename to code/BacDup/modules/dup_annot.py diff --git a/code/dup_searcher.py b/code/BacDup/modules/dup_searcher.py similarity index 100% rename from code/dup_searcher.py rename to code/BacDup/modules/dup_searcher.py diff --git a/code/input_parser.py b/code/BacDup/modules/input_parser.py similarity index 100% rename from code/input_parser.py rename to code/BacDup/modules/input_parser.py diff --git a/code/dup_biocircos.R b/code/BacDup/other_tools/dup_biocircos.R similarity index 100% rename from code/dup_biocircos.R rename to code/BacDup/other_tools/dup_biocircos.R diff --git a/code/blast_caller.py b/code/BacDup/scripts/blast_caller.py similarity index 100% rename from code/blast_caller.py rename to code/BacDup/scripts/blast_caller.py diff --git a/code/output.py b/code/BacDup/scripts/output.py similarity index 100% rename from code/output.py rename to code/BacDup/scripts/output.py diff --git a/code/protein_gbf.py b/code/BacDup/scripts/protein_gbf.py similarity index 100% rename from code/protein_gbf.py rename to code/BacDup/scripts/protein_gbf.py diff --git a/code/protein_gff.py b/code/BacDup/scripts/protein_gff.py similarity index 100% rename from code/protein_gff.py rename to code/BacDup/scripts/protein_gff.py diff --git a/code/LICENSE b/code/LICENSE new file mode 100644 index 0000000..c6e44e9 --- /dev/null +++ b/code/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2021 JF Sanchez-Herrero and Alba Moya + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/code/VERSION b/code/VERSION new file mode 100644 index 0000000..e69de29 diff --git a/code/devel/clean_devel.sh b/code/devel/clean_devel.sh new file mode 100644 index 0000000..86079ae --- /dev/null +++ b/code/devel/clean_devel.sh @@ -0,0 +1,9 @@ +echo "######################################" +echo "## Clean old folders" +echo "rm -r build" +rm -r build +echo "rm -r dist" +rm -r dist +echo "rm -r BacDup.egg-info" +rm -r BacDup.egg-info +echo "" diff --git a/code/devel/create_distro.sh b/code/devel/create_distro.sh new file mode 100644 index 0000000..4fbb61b --- /dev/null +++ b/code/devel/create_distro.sh @@ -0,0 +1,4 @@ +echo "######################################" +echo "## Create new distribution" +python setup.py sdist bdist_wheel +echo "" diff --git a/code/devel/developer_guidelines.txt b/code/devel/developer_guidelines.txt new file mode 100644 index 0000000..04412f0 --- /dev/null +++ b/code/devel/developer_guidelines.txt @@ -0,0 +1,24 @@ +## clean distribution packages +sh devel/clean_devel.sh + +## create distribution files +sh devel/create_distro.sh + +## create .pypirc file + +$ nano .pypirc + +[distutils] +index-servers=pypi +[pypi] +repository = https://upload.pypi.org/legacy/ +username =jfsanchezherrero + +## Upload using twine +sh devel/upload_pypi.sh + + + +## references +https://dzone.com/articles/executable-package-pip-install +https://packaging.python.org/tutorials/packaging-projects/ \ No newline at end of file diff --git a/code/devel/requirements.txt b/code/devel/requirements.txt new file mode 100644 index 0000000..053c5a5 --- /dev/null +++ b/code/devel/requirements.txt @@ -0,0 +1,3 @@ +wheel +twine +setuptools diff --git a/code/devel/test_module.sh b/code/devel/test_module.sh new file mode 100644 index 0000000..cebbba9 --- /dev/null +++ b/code/devel/test_module.sh @@ -0,0 +1 @@ +sh devel/clean_devel.sh; sh devel/create_distro.sh; pip install -e ./ diff --git a/code/devel/upload_pypi.sh b/code/devel/upload_pypi.sh new file mode 100644 index 0000000..24ad55a --- /dev/null +++ b/code/devel/upload_pypi.sh @@ -0,0 +1 @@ +python -m twine upload dist/* diff --git a/code/parser.py b/code/main/parser.py similarity index 100% rename from code/parser.py rename to code/main/parser.py diff --git a/code/setup.py b/code/setup.py new file mode 100644 index 0000000..95ff1e5 --- /dev/null +++ b/code/setup.py @@ -0,0 +1,44 @@ +import setuptools +import glob + +long_description_text = "" +with open("README.md", "r") as fh: + long_description_text = fh.read() + +setuptools.setup( + name="BacDup", + version="0.1", + + scripts=glob.glob('main/*'), + ## TODO: check add several authors + author="Jose F. Sanchez-Herrero and Alba Moya Garces", + + author_email="jfbioinformatics@gmail.com", + description="Bacterial gene duplication analysis pipeline", + + long_description_content_type="text/markdown", + long_description=long_description_text, + url="https://github.com/JFsanchezherrero/BacDup", + packages=setuptools.find_packages(), + license='MIT License', + + classifiers=[ + "Programming Language :: Python :: 3", + "License :: OSI Approved :: MIT License", + "Operating System :: OS Independent", + ], + include_package_data=True, + + ## TODO: check + install_requires=[ + 'pandas', 'patool', 'termcolor', + #'pysam', 'pybedtools', 'multiqc', + 'bcbio-gff', + 'biopython', 'HCGB', + 'ftputil', 'numpy', 'python-dateutil', 'pytz', 'six', 'wget' + ], +) + + + +