summaryrefslogtreecommitdiff
path: root/python-pydbsnp.spec
diff options
context:
space:
mode:
Diffstat (limited to 'python-pydbsnp.spec')
-rw-r--r--python-pydbsnp.spec346
1 files changed, 346 insertions, 0 deletions
diff --git a/python-pydbsnp.spec b/python-pydbsnp.spec
new file mode 100644
index 0000000..1a1836b
--- /dev/null
+++ b/python-pydbsnp.spec
@@ -0,0 +1,346 @@
+%global _empty_manifest_terminate_build 0
+Name: python-pydbsnp
+Version: 2.0.2
+Release: 1
+Summary: Interface with dbSNP VCF data
+License: MIT License
+URL: https://gitlab.com/aaylward/pydbsnp
+Source0: https://mirrors.nju.edu.cn/pypi/web/packages/43/64/ce2bc4b12d024b96f391b8eb677a733f8512ce68461afcfe31c66b010c60/pydbsnp-2.0.2.tar.gz
+BuildArch: noarch
+
+Requires: python3-pysam
+
+%description
+# pydbsnp
+
+Interface with dbSNP VCF data
+
+## Installation
+
+**Step 0 (optional):** If you don't want to bother with environment variables
+and don't care about how `pydbsnp` works under the hood, skip this step.
+
+If you wish, you can determine the location where `pydbsnp` looks for relevant
+data using four environment variables: `PYDBSNP_VCF_GRCH37`,
+`PYDBSNP_RSID_GRCH37`, `PYDBSNP_VCF_GRCH38`, `PYDBSNP_RSID_GRCH38`. The `VCF`
+variables determine the location of the VCF data, the `RSID` variables
+determine the location of the rsid indices. For example, you could add this
+to your `.bash_profile`:
+
+```bash
+export PYDBSNP_VCF_GRCH37=<path of your choice>
+export PYDBSNP_RSID_GRCH37=<path of your choice>
+export PYDBSNP_VCF_GRCH38=<path of your choice>
+export PYDBSNP_RSID_GRCH38=<path of your choice>
+```
+
+If you set these variables before continuing to the next step, `pydbsnp` will
+use them to determine where it places downloaded VCF files and RSID indices.
+
+**Step 1:** install the python package via `pip3`
+
+```sh
+pip install pydbsnp
+```
+or
+```sh
+pip install --user pydbsnp
+```
+
+**Step 2:** Once the python package is installed, download and index the dbSBP
+VCF data:
+
+```sh
+pydbsnp-download
+pydbsnp-index
+```
+
+For hg19/GRCh37 coordinates:
+
+```sh
+pydbsnp-download --reference-build GRCh37
+pydbsnp-index
+```
+
+## Command line usage
+
+```sh
+pydbsnp-query -h
+```
+
+```sh
+pydbsnp-query rs231361
+pydbsnp-query chr8:118184783
+pydbsnp-query --reference-build GRCh37 rs231361
+pydbsnp-query rs231361 chr8:118184783 rs7903146
+```
+
+## API
+
+Two classes are provided: `Variant` and `GeneralizedVariant`.
+
+An object of the `Variant` class has an attribute for each relevant field
+of the VCF.
+```python
+from pydbsnp import Variant
+v = Variant(id='rs8056814')
+print(v.chrom, v.pos, v.id, v.ref, v.alt)
+print(v.info)
+w = Variant(id='rs8056814', reference_build='GRCh37')
+print(w.chrom, w.pos)
+x = Variant('chr16', 75218429)
+print(x)
+help(Variant)
+```
+
+An object of the `GeneralizedVariant` class is similar, but each attribute
+is a tuple which may have multiple items. For example, one RSID may map
+to two sets of coordinates.
+```python
+gv = GeneralizedVariant(id='rs8056814')
+print(gv.chrom, gv.pos, gv.id, gv.ref, gv.alt)
+```
+
+
+
+
+%package -n python3-pydbsnp
+Summary: Interface with dbSNP VCF data
+Provides: python-pydbsnp
+BuildRequires: python3-devel
+BuildRequires: python3-setuptools
+BuildRequires: python3-pip
+%description -n python3-pydbsnp
+# pydbsnp
+
+Interface with dbSNP VCF data
+
+## Installation
+
+**Step 0 (optional):** If you don't want to bother with environment variables
+and don't care about how `pydbsnp` works under the hood, skip this step.
+
+If you wish, you can determine the location where `pydbsnp` looks for relevant
+data using four environment variables: `PYDBSNP_VCF_GRCH37`,
+`PYDBSNP_RSID_GRCH37`, `PYDBSNP_VCF_GRCH38`, `PYDBSNP_RSID_GRCH38`. The `VCF`
+variables determine the location of the VCF data, the `RSID` variables
+determine the location of the rsid indices. For example, you could add this
+to your `.bash_profile`:
+
+```bash
+export PYDBSNP_VCF_GRCH37=<path of your choice>
+export PYDBSNP_RSID_GRCH37=<path of your choice>
+export PYDBSNP_VCF_GRCH38=<path of your choice>
+export PYDBSNP_RSID_GRCH38=<path of your choice>
+```
+
+If you set these variables before continuing to the next step, `pydbsnp` will
+use them to determine where it places downloaded VCF files and RSID indices.
+
+**Step 1:** install the python package via `pip3`
+
+```sh
+pip install pydbsnp
+```
+or
+```sh
+pip install --user pydbsnp
+```
+
+**Step 2:** Once the python package is installed, download and index the dbSBP
+VCF data:
+
+```sh
+pydbsnp-download
+pydbsnp-index
+```
+
+For hg19/GRCh37 coordinates:
+
+```sh
+pydbsnp-download --reference-build GRCh37
+pydbsnp-index
+```
+
+## Command line usage
+
+```sh
+pydbsnp-query -h
+```
+
+```sh
+pydbsnp-query rs231361
+pydbsnp-query chr8:118184783
+pydbsnp-query --reference-build GRCh37 rs231361
+pydbsnp-query rs231361 chr8:118184783 rs7903146
+```
+
+## API
+
+Two classes are provided: `Variant` and `GeneralizedVariant`.
+
+An object of the `Variant` class has an attribute for each relevant field
+of the VCF.
+```python
+from pydbsnp import Variant
+v = Variant(id='rs8056814')
+print(v.chrom, v.pos, v.id, v.ref, v.alt)
+print(v.info)
+w = Variant(id='rs8056814', reference_build='GRCh37')
+print(w.chrom, w.pos)
+x = Variant('chr16', 75218429)
+print(x)
+help(Variant)
+```
+
+An object of the `GeneralizedVariant` class is similar, but each attribute
+is a tuple which may have multiple items. For example, one RSID may map
+to two sets of coordinates.
+```python
+gv = GeneralizedVariant(id='rs8056814')
+print(gv.chrom, gv.pos, gv.id, gv.ref, gv.alt)
+```
+
+
+
+
+%package help
+Summary: Development documents and examples for pydbsnp
+Provides: python3-pydbsnp-doc
+%description help
+# pydbsnp
+
+Interface with dbSNP VCF data
+
+## Installation
+
+**Step 0 (optional):** If you don't want to bother with environment variables
+and don't care about how `pydbsnp` works under the hood, skip this step.
+
+If you wish, you can determine the location where `pydbsnp` looks for relevant
+data using four environment variables: `PYDBSNP_VCF_GRCH37`,
+`PYDBSNP_RSID_GRCH37`, `PYDBSNP_VCF_GRCH38`, `PYDBSNP_RSID_GRCH38`. The `VCF`
+variables determine the location of the VCF data, the `RSID` variables
+determine the location of the rsid indices. For example, you could add this
+to your `.bash_profile`:
+
+```bash
+export PYDBSNP_VCF_GRCH37=<path of your choice>
+export PYDBSNP_RSID_GRCH37=<path of your choice>
+export PYDBSNP_VCF_GRCH38=<path of your choice>
+export PYDBSNP_RSID_GRCH38=<path of your choice>
+```
+
+If you set these variables before continuing to the next step, `pydbsnp` will
+use them to determine where it places downloaded VCF files and RSID indices.
+
+**Step 1:** install the python package via `pip3`
+
+```sh
+pip install pydbsnp
+```
+or
+```sh
+pip install --user pydbsnp
+```
+
+**Step 2:** Once the python package is installed, download and index the dbSBP
+VCF data:
+
+```sh
+pydbsnp-download
+pydbsnp-index
+```
+
+For hg19/GRCh37 coordinates:
+
+```sh
+pydbsnp-download --reference-build GRCh37
+pydbsnp-index
+```
+
+## Command line usage
+
+```sh
+pydbsnp-query -h
+```
+
+```sh
+pydbsnp-query rs231361
+pydbsnp-query chr8:118184783
+pydbsnp-query --reference-build GRCh37 rs231361
+pydbsnp-query rs231361 chr8:118184783 rs7903146
+```
+
+## API
+
+Two classes are provided: `Variant` and `GeneralizedVariant`.
+
+An object of the `Variant` class has an attribute for each relevant field
+of the VCF.
+```python
+from pydbsnp import Variant
+v = Variant(id='rs8056814')
+print(v.chrom, v.pos, v.id, v.ref, v.alt)
+print(v.info)
+w = Variant(id='rs8056814', reference_build='GRCh37')
+print(w.chrom, w.pos)
+x = Variant('chr16', 75218429)
+print(x)
+help(Variant)
+```
+
+An object of the `GeneralizedVariant` class is similar, but each attribute
+is a tuple which may have multiple items. For example, one RSID may map
+to two sets of coordinates.
+```python
+gv = GeneralizedVariant(id='rs8056814')
+print(gv.chrom, gv.pos, gv.id, gv.ref, gv.alt)
+```
+
+
+
+
+%prep
+%autosetup -n pydbsnp-2.0.2
+
+%build
+%py3_build
+
+%install
+%py3_install
+install -d -m755 %{buildroot}/%{_pkgdocdir}
+if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
+if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
+if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
+if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
+pushd %{buildroot}
+if [ -d usr/lib ]; then
+ find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/lib64 ]; then
+ find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/bin ]; then
+ find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+if [ -d usr/sbin ]; then
+ find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
+fi
+touch doclist.lst
+if [ -d usr/share/man ]; then
+ find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
+fi
+popd
+mv %{buildroot}/filelist.lst .
+mv %{buildroot}/doclist.lst .
+
+%files -n python3-pydbsnp -f filelist.lst
+%dir %{python3_sitelib}/*
+
+%files help -f doclist.lst
+%{_docdir}/*
+
+%changelog
+* Wed May 31 2023 Python_Bot <Python_Bot@openeuler.org> - 2.0.2-1
+- Package Spec generated