Skip to content

Commit 4990df7

Browse files
authored
v0.3.0 (#238)
* Update to v0.3.0 (#237)
1 parent b9fd92d commit 4990df7

File tree

98 files changed

+15923
-4290
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+15923
-4290
lines changed

.dockerignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
**/.git
2+
.github
3+
examples
4+
docs
5+
wdl
6+
dist
7+
cellbender.egg-info
8+
.pytest_cache
9+
*.h5
10+
*.tar.gz

.dockstore.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 1.2
2+
3+
workflows:
4+
- subclass: WDL
5+
primaryDescriptorPath: /wdl/cellbender_remove_background.wdl
6+
name: cellbender_remove_background

.github/workflows/miniwdl_check.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: 'validate WDL'
2+
on: [pull_request]
3+
env:
4+
MINIWDL_VERSION: 1.8.0
5+
jobs:
6+
miniwdl-check:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- uses: actions/setup-python@v4
11+
with:
12+
python-version: '3.7'
13+
- name: 'Install miniwdl and Run Validation Test'
14+
run: |
15+
pip install miniwdl==$MINIWDL_VERSION;
16+
./cellbender/remove_background/tests/miniwdl_check_wdl.sh;
17+
shell: bash
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
# Package for PyPI
2+
3+
name: 'packaging'
4+
5+
on: pull_request
6+
7+
jobs:
8+
build:
9+
10+
runs-on: 'ubuntu-latest'
11+
strategy:
12+
matrix:
13+
python-version: ['3.7']
14+
15+
steps:
16+
- name: 'Checkout repo'
17+
uses: actions/checkout@v3
18+
19+
- name: 'Set up Python ${{ matrix.python-version }}'
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: 'pip'
24+
25+
- name: 'Install packaging software'
26+
run: pip install --upgrade setuptools build twine
27+
28+
- name: 'Print package versions'
29+
run: pip list
30+
31+
- name: 'Package code using build'
32+
run: python -m build
33+
34+
- name: 'Check package using twine'
35+
run: python -m twine check dist/*
36+
37+
- name: 'Extract branch name'
38+
shell: bash
39+
run: echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >>$GITHUB_OUTPUT
40+
id: extract_branch
41+
42+
- name: 'Install from github branch and run a test'
43+
run: |
44+
pip install pytest git+https://github.com/broadinstitute/CellBender@${{ steps.extract_branch.outputs.branch }}
45+
cellbender -v

.github/workflows/run_pytest.yml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Run cellbender's tests
2+
3+
name: 'pytest'
4+
5+
on: pull_request
6+
7+
jobs:
8+
build:
9+
10+
runs-on: 'ubuntu-latest'
11+
strategy:
12+
matrix:
13+
python-version: ['3.7']
14+
15+
steps:
16+
- name: 'Checkout repo'
17+
uses: actions/checkout@v3
18+
19+
- name: 'Set up Python ${{ matrix.python-version }}'
20+
uses: actions/setup-python@v4
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
cache: 'pip'
24+
25+
- name: 'Install package including pytest'
26+
run: pip install .[dev]
27+
28+
- name: 'Print package versions'
29+
run: pip list
30+
31+
- name: 'Test with pytest'
32+
run: pytest -v

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,9 @@ dist/
1212
.eggs/
1313
.idea/
1414
*.iml
15+
*.h5
16+
*.h5ad
17+
*.tsv
18+
*.csv
19+
*.npz
20+
*.tar.gz

MANIFEST.in

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
1-
include README.rst
1+
include README.rst
2+
include LICENSE
3+
include requirements.txt
4+
include requirements-rtd.txt

README.rst

Lines changed: 105 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
11
CellBender
22
==========
33

4+
.. image:: https://img.shields.io/github/license/broadinstitute/CellBender?color=white
5+
:target: LICENSE
6+
:alt: License
7+
48
.. image:: https://readthedocs.org/projects/cellbender/badge/?version=latest
59
:target: https://cellbender.readthedocs.io/en/latest/?badge=latest
610
:alt: Documentation Status
711

8-
.. image:: https://github.com/broadinstitute/CellBender/blob/master/docs/source/_static/design/logo_250_185.png
12+
.. image:: https://img.shields.io/pypi/v/CellBender.svg
13+
:target: https://pypi.org/project/CellBender
14+
:alt: PyPI
15+
16+
.. image:: https://static.pepy.tech/personalized-badge/cellbender?period=total&units=international_system&left_color=grey&right_color=blue&left_text=pypi%20downloads
17+
:target: https://pepy.tech/project/CellBender
18+
:alt: Downloads
19+
20+
.. image:: https://img.shields.io/github/stars/broadinstitute/CellBender?color=yellow&logoColor=yellow)
21+
:target: https://github.com/broadinstitute/CellBender/stargazers
22+
:alt: Stars
23+
24+
.. image:: docs/source/_static/design/logo_250_185.png
925
:alt: CellBender Logo
1026

1127
CellBender is a software package for eliminating technical artifacts from
@@ -16,67 +32,123 @@ The current release contains the following modules. More modules will be added i
1632
* ``remove-background``:
1733

1834
This module removes counts due to ambient RNA molecules and random barcode swapping from (raw)
19-
UMI-based scRNA-seq count matrices. At the moment, only the count matrices produced by the
20-
CellRanger ``count`` pipeline is supported. Support for additional tools and protocols will be
21-
added in the future. A quick start tutorial can be found
22-
`here <https://cellbender.readthedocs.io/en/latest/getting_started/remove_background/index.html>`_.
35+
UMI-based scRNA-seq count matrices. Also works for snRNA-seq and CITE-seq.
2336

24-
Please refer to the `documentation <https://cellbender.readthedocs.io/en/latest/>`_ for a quick start tutorial on using CellBender.
37+
Please refer to `the documentation <https://cellbender.readthedocs.io/en/latest/>`_ for a quick start tutorial.
2538

2639
Installation and Usage
2740
----------------------
2841

29-
Manual installation
30-
~~~~~~~~~~~~~~~~~~~
42+
CellBender can be installed via
43+
44+
.. code-block:: console
45+
46+
$ pip install cellbender
47+
48+
(and we recommend installing in its own ``conda`` environment to prevent
49+
conflicts with other software).
50+
51+
CellBender is run as a command-line tool, as in
52+
53+
.. code-block:: console
54+
55+
(cellbender) $ cellbender remove-background \
56+
--cuda \
57+
--input my_raw_count_matrix_file.h5 \
58+
--output my_cellbender_output_file.h5
59+
60+
See `the usage documentation <https://cellbender.readthedocs.io/en/latest/usage/index.html>`_
61+
for details.
62+
63+
64+
Using The Official Docker Image
65+
-------------------------------
66+
67+
A GPU-enabled docker image is available from the Google Container Registry (GCR) as:
68+
69+
``us.gcr.io/broad-dsde-methods/cellbender:latest``
70+
71+
Available image tags track release tags in GitHub, and include ``latest``,
72+
``0.1.0``, ``0.2.0``, ``0.2.1``, ``0.2.2``, and ``0.3.0``.
73+
74+
75+
WDL Users
76+
---------
77+
78+
A workflow written in the
79+
`workflow description language (WDL) <https://github.com/openwdl/wdl>`_
80+
is available for CellBender remove-background.
81+
82+
For `Terra <https://app.terra.bio>`_ users, a workflow called
83+
``cellbender/remove-background`` is
84+
`available from the Broad Methods repository
85+
<https://portal.firecloud.org/#methods/cellbender/remove-background/>`_.
86+
87+
There is also a `version available on Dockstore
88+
<https://dockstore.org/workflows/github.com/broadinstitute/CellBender>`_.
3189

32-
The recommended installation is as follows. Create a conda environment and activate it:
3390

34-
.. code-block:: bash
91+
Advanced installation
92+
---------------------
3593

36-
$ conda create -n cellbender python=3.7
37-
$ source activate cellbender
94+
From source for development
95+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
96+
97+
Create a conda environment and activate it:
98+
99+
.. code-block:: console
100+
101+
$ conda create -n cellbender python=3.7
102+
$ conda activate cellbender
38103
39104
Install the `pytables <https://www.pytables.org>`_ module:
40105

41-
.. code-block:: bash
106+
.. code-block:: console
107+
108+
(cellbender) $ conda install -c anaconda pytables
42109
43-
(cellbender) $ conda install -c anaconda pytables
110+
Install `pytorch <https://pytorch.org>`_ via
111+
`these instructions <https://pytorch.org/get-started/locally/>`_, for example:
44112

45-
Install `pytorch <https://pytorch.org>`_ (shown below for CPU; if you have a CUDA-ready GPU, please skip
46-
this part and follow `these <https://pytorch.org/get-started/locally/>`_ instructions instead):
113+
.. code-block:: console
47114
48-
.. code-block:: bash
115+
(cellbender) $ pip install torch
49116
50-
(cellbender) $ conda install pytorch torchvision -c pytorch
117+
and ensure that your installation is appropriate for your hardware (i.e. that
118+
the relevant CUDA drivers get installed and that ``torch.cuda.is_available()``
119+
returns ``True`` if you have a GPU available.
51120

52-
Clone this repository and install CellBender:
121+
Clone this repository and install CellBender (in editable ``-e`` mode):
53122

54-
.. code-block:: bash
123+
.. code-block:: console
55124
125+
(cellbender) $ git clone https://github.com/broadinstitute/CellBender.git
56126
(cellbender) $ pip install -e CellBender
57127
58-
Using The Official Docker Image
59-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60128
61-
A GPU-enabled docker image is available from the Google Container Registry (GCR) as:
129+
From a specific commit
130+
~~~~~~~~~~~~~~~~~~~~~~
62131

63-
``us.gcr.io/broad-dsde-methods/cellbender:latest``
132+
This can be achieved via
64133

65-
Terra Users
66-
~~~~~~~~~~~
134+
.. code-block:: console
67135
68-
For `Terra <https://app.terra.bio>`_ users, a `workflow <https://portal.firecloud.org/#methods/cellbender/remove-background/>`_
69-
is available as:
136+
(cellbender) $ pip install --no-cache-dir -U git+https://github.com/broadinstitute/CellBender.git@<SHA>
70137
71-
``cellbender/remove-background``
138+
where ``<SHA>`` must be replaced by any reference to a particular git commit,
139+
such as a tag, a branch name, or a commit sha.
72140

73141

74142
Citing CellBender
75143
-----------------
76144

77145
If you use CellBender in your research (and we hope you will), please consider
78-
citing `our paper on bioRxiv <https://doi.org/10.1101/791699>`_.
146+
citing our paper in Nature Methods:
147+
148+
Stephen J Fleming, Mark D Chaffin, Alessandro Arduini, Amer-Denis Akkad,
149+
Eric Banks, John C Marioni, Anthony A Phillipakis, Patrick T Ellinor,
150+
and Mehrtash Babadi. Unsupervised removal of systematic background noise from
151+
droplet-based single-cell experiments using CellBender.
152+
`Nature Methods`, 2023. https://doi.org/10.1038/s41592-023-01943-7
79153

80-
Stephen J Fleming, John C Marioni, and Mehrtash Babadi. CellBender remove-background:
81-
a deep generative model for unsupervised removal of background noise from scRNA-seq
82-
datasets. bioRxiv 791699; doi: `https://doi.org/10.1101/791699 <https://doi.org/10.1101/791699>`_
154+
See also `our preprint on bioRxiv <https://doi.org/10.1101/791699>`_.

REQUIREMENTS-DOCKER.txt

Lines changed: 0 additions & 9 deletions
This file was deleted.

REQUIREMENTS.txt

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)