Skip to content

Commit

Permalink
1.0.7.0
Browse files Browse the repository at this point in the history
- Now GenMine parses clone information
  • Loading branch information
Changwanseo committed Nov 18, 2022
1 parent 055ccfc commit 95830f5
Show file tree
Hide file tree
Showing 4 changed files with 89 additions and 9 deletions.
23 changes: 21 additions & 2 deletions GenMine/GenMine.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,9 @@ def filter_acc(acc_list, email) -> list:
if len(return_acc_list) > 0:
handle = Entrez.esearch(
db="Nucleotide",
term=" OR ".join([f"{acc}[Nucleotide Accession]" for acc in return_acc_list]),
term=" OR ".join(
[f"{acc}[Nucleotide Accession]" for acc in return_acc_list]
),
retmax=len(return_acc_list),
idtype="acc",
)
Expand Down Expand Up @@ -619,7 +621,7 @@ def Get_note(record):

return format_list(input_list=obj_list, filter_list=[], add=" = ", default="")

# Get note from given record json
# Get isolate from given record json
def Get_isolate(record):

obj_list = retrieve_parallel(
Expand All @@ -631,6 +633,18 @@ def Get_isolate(record):

return format_list(input_list=obj_list, filter_list=[], add=" = ", default="")

# Get clone from given record json
def Get_clone(record):

obj_list = retrieve_parallel(
input_dict=record,
label="GBQualifier_name",
label_value="clone",
obj="GBQualifier_value",
)

return format_list(input_list=obj_list, filter_list=[], add=" = ", default="")

def Get_author(record):

author_list = []
Expand Down Expand Up @@ -763,6 +777,7 @@ def Get_author(record):
# Transform to output format
for record in json_data:

"""
dict_temp = {
"acc": "",
"length": "",
Expand All @@ -780,6 +795,8 @@ def Get_author(record):
"upload_date": "",
"seq": "",
}
"""
dict_temp = {}

if (
"GBSeq_sequence" in record or "GBSeq_feature-table" in record
Expand All @@ -799,6 +816,7 @@ def Get_author(record):
dict_temp["culture_collection"] = Get_culture_collection(record)
dict_temp["note"] = Get_note(record)
dict_temp["isolate"] = Get_isolate(record)
dict_temp["clone"] = Get_clone(record)

dict_temp["primer"] = classification(record["GBSeq_definition"])
json_temp.append(dict_temp)
Expand Down Expand Up @@ -1107,6 +1125,7 @@ def classifier(json_in, out):

return new_keys


# get list of acc in transformed json
def get_acc(json_file):

Expand Down
9 changes: 5 additions & 4 deletions build_manual.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
# test build
```
pip uninstall GenMine
python setup.py clean --all
python setup.py install

```
# pypi build

In new conda environment
```
conda install pip
Expand All @@ -12,11 +14,10 @@ python setup.py sdist
twine upload dist/GenMine-{YOUR_VERSION}* // use current build number
```
# conda build

In new conda environment
```
conda install -c conda-forge grayskull
conda install -c packaging
conda install -c conda-forge packaging
conda install conda-build
conda install conda-verify
conda install anaconda-client
Expand Down
51 changes: 51 additions & 0 deletions conda/GenMine/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{% set name = "GenMine" %}
{% set version = "1.0.7.0" %}

package:
name: {{ name|lower }}
version: {{ version }}

source:
url: https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/GenMine-{{ version }}.tar.gz
sha256: ae4c5a04bd3465bcc1ab4a98d9f725bf391f6e3dad5f2dec4d9390f7eadc74f3

build:
entry_points:
- GenMine = GenMine.main:main
noarch: python
script: {{ PYTHON }} -m pip install . -vv
number: 0

requirements:
host:
- python >=3.8
- pip
run:
- python >=3.8
- biopython
- pandas
- openpyxl
- xlrd
- numpy
- xmltodict
- pytz
- python-dateutil

test:
imports:
- GenMine
commands:
- pip check
- GenMine --help
requires:
- pip

about:
home: https://github.com/Changwanseo/GenMine
summary: GenBank data miner for fungal taxonomists
license: GPL-3.0
license_file: LICENSE

extra:
recipe-maintainers:
- Changwanseo
15 changes: 12 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
# hey-insutance/setup.py
# GenMine/setup.py
from setuptools import setup, find_packages

setup(
name="GenMine",
version="1.0.6.3",
version="1.0.7.0",
description="GenBank data miner for fungal taxonomists",
author="Changwan Seo",
author_email="wan101010@snu.ac.kr",
url="https://github.com/Changwanseo/GenMine",
python_requires=">= 3.8",
packages=find_packages(include=["GenMine"]),
install_requires=["biopython", "pandas", "openpyxl", "xlrd", "numpy", "xmltodict", "pytz", "python-dateutil"],
install_requires=[
"biopython",
"pandas",
"openpyxl",
"xlrd",
"numpy",
"xmltodict",
"pytz",
"python-dateutil",
],
zip_safe=False,
# important part
entry_points={"console_scripts": ["GenMine = GenMine.main:main"]},
Expand Down

0 comments on commit 95830f5

Please sign in to comment.