Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Dockerfile, add github action, simplify dependencies, #24

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/build_and_publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# from https://docs.github.com/en/actions/publishing-packages/publishing-docker-images
name: Create and publish a Docker image

on:
push:
branches: ['main']

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Container registry
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=tag
type=raw,value={{sha}}
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
flavor: |
latest=auto

- name: Build and push Docker image
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
with:
context: .
file: Dockerfile-base
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
FROM ghcr.io/nickp60/shunpyker:latest
16 changes: 16 additions & 0 deletions Dockerfile-base
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM jupyter/base-notebook
add envs/shunPykeR.yml ./shunPykeR.yml
add notebooks/shunPykeR_guide.ipynb shunPykeR_guide.ipynb
# dependency annoy needs to be built, and base-notebook does not have GCC
USER root
RUN apt-get update --yes && apt-get install g++ --yes --no-install-recommends && rm -rf /var/lib/apt/lists/*
USER ${NB_UID}
RUN mamba env create -f shunPykeR.yml
# inspired by https://medium.com/@nrk25693/how-to-add-your-conda-environment-to-your-jupyter-notebook-in-just-4-steps-abeab8b8d084
# This adds this env as a dropdown option in jupyter
RUN mamba install -n shunPykeR -c anaconda ipykernel && mamba install -n base nb_conda_kernels && mamba clean -afy
# do we need dpeerlab's fork? If not, use pip install magic-impute
# RUN wget https://github.com/dpeerlab/magic/archive/refs/tags/v0.1.1.tar.gz && \
# tar xzf v0.1.1.tar.gz && \
# ls && cd magic-0.1.1/ && \
# /opt/conda/envs/shunPykeR/bin/pip install .
42 changes: 26 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![DOI](https://zenodo.org/badge/402799957.svg)](https://zenodo.org/badge/latestdoi/402799957)
[![DOI](https://zenodo.org/badge/402799957.svg)](https://zenodo.org/badge/latestdoi/402799957)[![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gh/nickp60/shunPykeR/HEAD?labpath=notebooks/shunPykeR_guide.ipynb/)
# The shunPykeR's guide to single cell analysis
*Anastasia Kousa and Andri Lemarquis*

Expand All @@ -12,13 +12,13 @@
<br/>

<p float="left">
<img width="550" src="infographics/shunPykeR_infographic.png">
<img width="550" src="infographics/shunPykeR_infographic.png">

**GRAPHICAL OVERVIEW**

**Step 1** guides you through the quality control and necessary clean-up tread that scRNA-seq data require. **Steps 2** and **3** are optional and can be skipped if initial inspection of the samples does not reveal any obvious technical artifacts that can bias results interpretation. **Step 4** introduces a plethora of common visualization options. **Step 5** provides again an optional practise to impute gene expression. This can be beneficial when interrogating in a correlative way the expression of lowly expressed genes, such as transcription factors, due to the high dropout rate that single cell data suffer from. **Step 6** walks you through differential expression analysis for your comparisons of interest, advices on pathway and network enrichment analysis options and provides complementary visualization for the specific output files. **Step 7** introduces ways of integrating your scRNA-seq data with (a) loom files to perform RNA velocity analysis, (b) visium files to probe the localization of the expressional data and (c) human/mouse orthologue to associate and inform the analysis from cross-species comparisons.

<sup> * *Magenta denotes optional analysis modules*</sup>
<sup> * *Magenta denotes optional analysis modules*</sup>

<br/>

Expand All @@ -27,7 +27,7 @@
## This guide in a nutshell


This is a complete guide for the analysis of scRNA-seq data interlaced with sections of common and complementary practises. This guide introduces all code in one notebook in a coherent order and it has been "seeded" -where necessary- to make it fully reproducible. These two main qualities make it simple and intuitive enough allowing non computational scientists to perform a robust and thorough analysis of their scRNA-seq datasets with (relative) peace of mind. Nonetheless, it can be used by bioinformaticians that may want to adjust and reuse it in their own way.
This is a complete guide for the analysis of scRNA-seq data interlaced with sections of common and complementary practises. This guide introduces all code in one notebook in a coherent order and it has been "seeded" -where necessary- to make it fully reproducible. These two main qualities make it simple and intuitive enough allowing non computational scientists to perform a robust and thorough analysis of their scRNA-seq datasets with (relative) peace of mind. Nonetheless, it can be used by bioinformaticians that may want to adjust and reuse it in their own way.

Within this guide we have brought together a combination of already established single cell analysis tools that we introduced in a logical order to simplify running your analysis. The main code is in python but it is interpolated with snippets of R code to take advantage of both worlds when using single cell developed algorithms.

Expand All @@ -45,10 +45,10 @@ Here is the list of tools that we implement across this guide:
- **mousipy** integrates human with mouse datasets (https://github.com/stefanpeidli/mousipy)

<br/>

## Emojis to guide your way


This icon (🕹️) helps you move directly to specific sections of this pipeline

This icon (💡) gives you hints to assist with issues when running this pipeline
Expand All @@ -58,15 +58,15 @@ This icon (✍️) let's you know that manual input is required
This icon (❗) asks you to pay attention

This icon (⏳) let's you know that the process may take a long time to run

<br/>

See the **complete notebook** [here](notebooks/shunPykeR_guide.ipynb).

<br/>



## How-to guide to open a Jupyter notebook

- For **Linux**, **Mac** and **Windows** environments
Expand All @@ -75,7 +75,7 @@ See the **complete notebook** [here](notebooks/shunPykeR_guide.ipynb).
2. Open the Anaconda-Navigator
3. Go to `Environments` -> select an environment [default will be ` base(root)`] by clicking on the ▶️ button; select `shunPykeR` instead once you install it below
4. Go to `Home` again -> on the Jupyter notebook box click on the `Install` button; once installed click on the `Launch` button
5. Finally navigate through the browser that will pop up to the directory where your jupyter notebook exists and click on the file
5. Finally navigate through the browser that will pop up to the directory where your jupyter notebook exists and click on the file


## How-to guide to install the shunPykeR environment
Expand All @@ -85,7 +85,7 @@ See the **complete notebook** [here](notebooks/shunPykeR_guide.ipynb).
1. Install conda for your environment (https://docs.conda.io/projects/conda/en/latest/user-guide/install/windows.html)
2. Use the search button to find and open a `terminal` window
3. Type the command below

```
conda env create -f shunPykeR.yml
```
Expand All @@ -95,19 +95,29 @@ See the **complete notebook** [here](notebooks/shunPykeR_guide.ipynb).

- Alternatively, in a **Windows** environment or if you prefer a **graphical interface** to facilitate the installation (even though this can end up more tricky and slow)

1. Open Anaconda-Navigator
1. Open Anaconda-Navigator
2. Go to Environments -> click on `Import`
3. Select the `shunPykeR.yml` file and click `Import` again in the new window

<br/>

❗*Full environment installation has only been tested in a Mac environment via the terminal.*


<br/>



## Using the ShunPykeR docker image
Using Docker allows you to run ShunPykeR without having to manage any dependencies yourself other than installing Docker.

1. [Install Docker](https://docs.docker.com/get-docker/)
2. Run the following command in your terminal to download and start the Docker image:
```
docker run -it --rm -p 8888:8888 -v "${PWD}":/home/jovyan/work kousaa/shunpyker
```

3. navigate to the link shown in the console; it start with something like http://127.0.0.1:8888
4. **change your default kernal.** Once you open the notebook, change the kernal using the dropdown in the top right from `Python [conda_env: root]` to `Python [conda_env:shunPykeR]`

## Citations
<sup>**1.** F. A. Wolf, P. Angerer, F. J. Theis, SCANPY: large-scale single-cell gene expression data analysis. Genome Biol. 19, 15 (2018).
**2.** S. L. Wolock, R. Lopez, A. M. Klein, Scrublet: Computational Identification of Cell Doublets in Single-Cell Transcriptomic Data. Cell Syst. 8, 281-291.e9 (2019).
Expand Down
Loading