Skip to content

Commit

Permalink
Add conda package
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeff1995 committed Sep 14, 2021
1 parent 0c4ef7a commit e84cb64
Show file tree
Hide file tree
Showing 9 changed files with 201 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
python-version: '3.8'
- name: Install dependencies
run:
pip install --upgrade pip flit
Expand Down
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![license-badge](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![pypi-badge](https://img.shields.io/pypi/v/scglue)](https://pypi.org/project/scglue)
[![conda-badge](https://anaconda.org/scglue/scglue/badges/version.svg)](https://anaconda.org/scglue/scglue)
[![docs-badge](https://readthedocs.org/projects/scglue/badge/?version=latest)](https://scglue.readthedocs.io/en/latest/?badge=latest)
[![build-badge](https://github.com/gao-lab/GLUE/actions/workflows/build.yml/badge.svg)](https://github.com/gao-lab/GLUE/actions/workflows/build.yml)
[![coverage-badge](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/Jeff1995/e704b2f886ff6a37477311b90fdf7efa/raw/coverage.json)](https://github.com/gao-lab/GLUE/actions/workflows/build.yml)
Expand Down Expand Up @@ -32,32 +33,34 @@ For more details, please check out our [preprint](https://www.biorxiv.org/conten

## Package installation

It is recommended to install `scglue` within a
[conda](https://docs.conda.io/en/latest/miniconda.html) environment.

First, initialize an empty conda environment (here named "scglue"):
The `scglue` package can be installed either via conda:

```sh
conda env create -n scglue "python>=3.6" && conda activate scglue
conda install -c defaults -c pytorch -c bioconda -c conda-forge -c scglue scglue
```

Then, install scglue via:
Or via pip:

```sh
pip install scglue
```

> Installing within a
> [conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html)
> is recommended.
## Package usage

Please checkout the documentations and tutorials at
[scglue.readthedocs.io](https://scglue.readthedocs.io).

## Package development

Install scglue in editable form via flit:
Install scglue in editable form via flit (first install flit via conda or pip
if not installed already):

```sh
pip install flit && flit install -s
flit install -s
```

Run unit tests:
Expand Down
8 changes: 8 additions & 0 deletions conda-build/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Building the conda package

After updating the recipe, run:

```sh
conda build -c defaults -c pytorch -c bioconda -c conda-forge scglue
anaconda upload -u scglue path_to_the_built_package.tar.bz2
```
21 changes: 21 additions & 0 deletions conda-build/scglue/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2021, Gao Lab

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.
81 changes: 81 additions & 0 deletions conda-build/scglue/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
{% set name = "scglue" %}
{% set version = "0.1.1" %} # Update

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

source:
url: "https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz"
sha256: 9e69628800e842c1afd74cc71a0067412404da1cb4f4de063915d2375b81223a # Update

build:
noarch: python
number: 0
script: "{{ PYTHON }} -m pip install . -vv"

requirements:
host: # Might need update
- anndata >=0.7
- dill >=0.2.3
- flit >=3.2,<4
- ignite >=0.4.1
- matplotlib >=3.1.2
- networkx >=2
- numpy >=1.19
- pandas >=1.1
- parse >=1.3.2
- pip
- pybedtools >=0.8.1
- pynvml >=8.0.1
- python >=3.6
- pytorch >=1.7
- scanpy >=1.5
- scikit-learn >=0.21.2
- scipy >=1.3
- seaborn >=0.9
- statsmodels >=0.10
- tensorboardx >=1.4
- tqdm >=4.27
run: # Might need update
- anndata >=0.7
- dill >=0.2.3
- ignite >=0.4.1
- matplotlib >=3.1.2
- networkx >=2
- numpy >=1.19
- pandas >=1.1
- parse >=1.3.2
- pybedtools >=0.8.1
- pynvml >=8.0.1
- python >=3.6
- pytorch >=1.7
- scanpy >=1.5
- scikit-learn >=0.21.2
- scipy >=1.3
- seaborn >=0.9
- statsmodels >=0.10
- tensorboardx >=1.4
- tqdm >=4.27

test:
imports:
- scglue
- scglue.models

about:
home: https://github.com/gao-lab/GLUE
license: MIT
license_family: MIT
license_file: LICENSE
summary: "Graph-linked unified embedding for unpaired single-cell multi-omics data integration"
description: |
GLUE is a flexible framework that utilizes prior knowledge about feature
relations to bridge the gap between different feature spaces during unpaired
multi-modal data integration.
doc_url: https://scglue.readthedocs.io
dev_url: https://github.com/gao-lab/GLUE

extra:
recipe-maintainers:
- Jeff1995
25 changes: 7 additions & 18 deletions docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,34 +5,23 @@ Installation guide
Main package
************

It is recommended to install ``scglue`` in a `conda <https://docs.conda.io/en/latest/miniconda.html>`_ environment, to avoid potential dependency conflicts.

First create a new conda environment (here named "scglue", but you may name it whatever you like), and activate it:
The ``scglue`` package can be installed either via conda:

.. code-block:: bash
:linenos:
conda create -n scglue "python>=3.6"
conda activate scglue
conda install -c defaults -c pytorch -c bioconda -c conda-forge -c scglue scglue
Then install ``scglue`` via:
Or via pip:

.. code-block:: bash
:linenos:
pip install scglue
*********************
Optional dependencies
*********************

In order to use some of the genomics-related functions, it is necessary to have `bedtools <https://bedtools.readthedocs.io/en/latest/index.html>`_ installed (at least v2.29.2). You may also install it from conda:

.. code-block:: bash
:linenos:
conda install -c bioconda "bedtools>=2.29.2"
.. note:: A conda package is also being prepared, which would be more convenient. Stay tuned.
.. note::
To avoid potential dependency conflicts, installing within a
`conda environment <https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_
is recommended.

Now you are all set. Proceed to `tutorials <tutorials.rst>`_ for how to use the ``scglue`` package.
23 changes: 22 additions & 1 deletion env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ dependencies:
- aiohttp=3.7.4
- alabaster=0.7.12
- amply=0.1.4
- anaconda-client=1.8.0
- anndata=0.7.6
- anyio=2.2.0
- appdirs=1.4.4
Expand Down Expand Up @@ -49,6 +50,7 @@ dependencies:
- blosc=1.21.0
- bokeh=2.3.3
- boltons=20.2.1
- boolean.py=3.7
- boto3=1.17.27
- botocore=1.20.28
- brotlipy=0.7.0
Expand All @@ -66,13 +68,16 @@ dependencies:
- click=7.1.2
- clikit=0.6.2
- cloudpickle=1.6.0
- clyent=1.2.2
- coincbc=2.10.5
- colorama=0.4.3
- colorlog=5.0.1
- commonmark=0.9.1
- conda=4.10.3
- conda-build=3.21.4
- conda-forge-pinning=2021.09.05.11.13.08
- conda-package-handling=1.7.3
- conda-smithy=3.12
- configargparse=1.4
- connection_pool=0.0.3
- cooler=0.8.11
Expand All @@ -91,6 +96,7 @@ dependencies:
- debugpy=1.4.1
- decorator=4.4.2
- defusedxml=0.7.1
- deprecated=1.2.12
- dill=0.3.3
- distlib=0.3.2
- distributed=2021.4.1
Expand Down Expand Up @@ -130,6 +136,7 @@ dependencies:
- gffutils=0.10.1
- ghostscript=9.53.3
- giflib=5.2.1
- git=2.32.0
- gitdb=4.0.5
- gitpython=3.1.14
- glib=2.66.7
Expand Down Expand Up @@ -185,6 +192,7 @@ dependencies:
- ipython=7.21.0
- ipython_genutils=0.2.0
- ipywidgets=7.6.3
- isodate=0.6.0
- isort=5.7.0
- itsdangerous=2.0.1
- jbig=2.1
Expand All @@ -195,6 +203,7 @@ dependencies:
- jmespath=0.10.0
- joblib=1.0.1
- jpeg=9d
- jq=1.6
- json5=0.9.5
- jsonschema=3.2.0
- jupyter-packaging=0.7.12
Expand Down Expand Up @@ -254,6 +263,7 @@ dependencies:
- libxcb=1.14
- libxml2=2.9.10
- libxslt=1.1.33
- license-expression=1.2
- llvm-openmp=12.0.1
- llvmlite=0.36.0
- locket=0.2.1
Expand Down Expand Up @@ -281,6 +291,7 @@ dependencies:
- more-itertools=8.7.0
- mpi=1.0
- msgpack-python=1.0.2
- msrest=0.6.21
- multidict=5.1.0
- multiprocess=0.70.12.2
- mysql-connector-c=6.1.11
Expand Down Expand Up @@ -308,11 +319,12 @@ dependencies:
- oauth2client=4.1.3
- oauthlib=3.1.0
- olefile=0.46
- oniguruma=6.9.7.1
- openblas=0.3.13
- openjpeg=2.4.0
- openmpi=4.1.0
- openpyxl=3.0.7
- openssl=1.1.1k
- openssl=1.1.1l
- opt_einsum=3.3.0
- packaging=20.9
- pairix=0.3.7
Expand All @@ -328,6 +340,7 @@ dependencies:
- patchelf=0.12
- patsy=0.5.1
- pcre=8.44
- pcre2=10.35
- peppy=0.31.1
- perl=5.26.2
- perl-app-cpanminus=1.7044
Expand Down Expand Up @@ -391,11 +404,13 @@ dependencies:
- pycairo=1.19.1
- pycosat=0.6.3
- pycparser=2.20
- pycrypto=2.6.1
- pydeprecate=0.3.1
- pydocstyle=5.1.1
- pydot=1.4.1
- pyfaidx=0.6.1
- pygenometracks=3.6
- pygithub=1.44
- pygments=2.8.1
- pygraphviz=1.7
- pyjwt=1.7.1
Expand Down Expand Up @@ -446,13 +461,16 @@ dependencies:
- ripgrep=12.1.1
- rope=0.18.0
- rsa=4.7.2
- ruamel.yaml=0.16.12
- ruamel.yaml.clib=0.2.2
- ruamel_yaml=0.15.100
- s3transfer=0.3.4
- samtools=1.12
- scanpy=1.8.1
- scikit-learn=0.24.1
- scikit-misc=0.1.3
- scipy=1.6.1
- scrypt=0.8.18
- scvi-tools=0.9.1
- seaborn=0.11.1
- secretstorage=3.3.1
Expand Down Expand Up @@ -521,6 +539,7 @@ dependencies:
- urllib3=1.26.4
- veracitools=0.1.3
- virtualenv=20.4.6
- vsts-python-api=0.1.22
- wcwidth=0.2.5
- webencodings=0.5.1
- werkzeug=1.0.1
Expand All @@ -531,6 +550,7 @@ dependencies:
- xeus-python=0.12.3
- xlsxwriter=3.0.1
- xmlrunner=1.7.7
- xmltodict=0.12.0
- xorg-kbproto=1.0.7
- xorg-libice=1.0.10
- xorg-libsm=1.2.3
Expand All @@ -547,6 +567,7 @@ dependencies:
- yaml=0.2.5
- yapf=0.31.0
- yarl=1.5.1
- yq=2.12.0
- zeromq=4.3.3
- zict=2.0.0
- zipp=3.4.1
Expand Down
Loading

0 comments on commit e84cb64

Please sign in to comment.