Skip to content

Commit

Permalink
Merge pull request #407 from lilab-bcb/yiming
Browse files Browse the repository at this point in the history
Fix workflow issue with cellranger-arc
  • Loading branch information
yihming authored Jun 19, 2024
2 parents 875f888 + 35c049c commit 0af73ba
Show file tree
Hide file tree
Showing 7 changed files with 76 additions and 7 deletions.
31 changes: 31 additions & 0 deletions docker/cellranger-arc/2.0.2.strato/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM debian:bullseye-slim
SHELL ["/bin/bash", "-c"]

RUN apt-get update && \
apt-get install --no-install-recommends -y unzip rsync build-essential dpkg-dev curl gnupg procps python3 python3-pip && \
echo "deb [signed-by=/usr/share/keyrings/cloud.google.gpg] http://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list && \
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyring /usr/share/keyrings/cloud.google.gpg add - && \
apt-get update -y && apt-get install -y google-cloud-cli=392.0.0-0

RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.7.11.zip" -o "awscliv2.zip" && \
unzip awscliv2.zip && \
./aws/install && \
rm awscliv2.zip

RUN pip3 install --upgrade pip && \
pip3 install pandas==1.4.3 && \
pip3 install packaging==21.3 && \
pip3 install stratocumulus==0.2.4

RUN mkdir /software
ADD https://raw.githubusercontent.com/lilab-bcb/cumulus/master/docker/monitor_script.sh /software
ADD cellranger-arc-2.0.2.tar.gz /software

RUN apt-get -qq -y autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /var/log/dpkg.log && \
rm -f /usr/bin/python && ln -s /usr/bin/python3 /usr/bin/python

RUN chmod a+rx /software/monitor_script.sh
ENV PATH=/software:/software/cellranger-arc-2.0.2:/usr/local/aws-cli/v2/current/bin:$PATH
ENV TMPDIR=/tmp
2 changes: 1 addition & 1 deletion docker/cellranger-arc/2.0.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64-2.7.11.zip" -o "a
RUN pip3 install --upgrade pip && \
pip3 install pandas==1.4.3 && \
pip3 install packaging==21.3 && \
pip3 install stratocumulus==0.2.4
pip3 install stratocumulus==0.1.7

RUN mkdir /software
ADD https://raw.githubusercontent.com/lilab-bcb/cumulus/master/docker/monitor_script.sh /software
Expand Down
6 changes: 3 additions & 3 deletions docs/cellranger/sc_multiomics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ For single-cell multiomics data, ``cellranger_workflow`` takes Illumina outputs
- "8.0.1"
- "8.0.1"
* - cellranger_arc_version
- cellranger-arc version, could be 2.0.2, 2.0.1, 2.0.0, 1.0.1, 1.0.0
- "2.0.2"
- "2.0.2"
- cellranger-arc version, could be: ``2.0.2.strato`` (compatible with workflow v2.6.1+), ``2.0.2.custom-max-cell`` (with max_cell threshold set to 80,000), ``2.0.2`` (compatible with workflow v2.6.0 or earlier), ``2.0.1``, ``2.0.0``, ``1.0.1``, ``1.0.0``
- "2.0.2.strato"
- "2.0.2.strato"
* - docker_registry
- Docker registry to use for cellranger_workflow. Options:

Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# The short X.Y version
version = '2.6'
# The full version, including alpha/beta/rc tags
release = '2.6.1'
release = '2.6.2'


# -- General configuration ---------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions docs/release_notes/version_2_6.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
2.6.2 :small:`June 19, 2024`
^^^^^^^^^^^^^^^^^^^^^^^^^^^^

* Solve the issue of Cellranger workflow with cellranger-arc. ``cellranger_arc_version`` default is now "2.0.2.strato" which is compatible with workflow v2.6.1 or later.

2.6.1 :small:`May 8, 2024`
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
33 changes: 33 additions & 0 deletions workflows/cellbender/frp_utils.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import pandas as pd
import pegasusio as io

from pegasusio import MultimodalData, UnimodalData
from typing import Union, Optional


def filter_included_genes(
data: Union[MultimodalData, UnimodalData],
filt_features_tsv: pd.DataFrame,
output_file: Optional[str] = None,
) -> None:
df_var = pd.read_csv(filt_features_tsv, sep='\t', header=None)
assert df_var[0].nunique() == 18082, "Filtered genes inconsistent!"

data._inplace_subset_var(data.var['featureid'].isin(df_var[0].values))
correct_gene_names(data)
if output_file:
io.write_output(data, output_file)

def correct_gene_names(data):
rename_dict = {
"ENSG00000285053": "GGPS1-TBCE",
"ENSG00000284770": "TBCE",
"ENSG00000187522": "HSPA14",
"ENSG00000284024": "MSANTD7",
"ENSG00000269226": "TMSB15C",
"ENSG00000158427": "TMSB15B",
}
df_var = data.var.reset_index()
for gene_id, gene_name in rename_dict.items():
df_var.loc[df_var['featureid']==gene_id, 'featurekey'] = gene_name
data.var = df_var.set_index('featurekey')
4 changes: 2 additions & 2 deletions workflows/cellranger/cellranger_workflow.wdl
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ workflow cellranger_workflow {
String cumulus_feature_barcoding_version = "0.11.3"
# 2.1.0, 2.0.0, 1.2.0, 1.1.0
String cellranger_atac_version = "2.1.0"
# 2.0.2, 2.0.1, 2.0.0, 1.0.1, 1.0.0
String cellranger_arc_version = "2.0.2"
# 2.0.2.strato, 2.0.2.custom-max-cell, 2.0.2, 2.0.1, 2.0.0, 1.0.1, 1.0.0
String cellranger_arc_version = "2.0.2.strato"
# config version
String config_version = "0.3"

Expand Down

0 comments on commit 0af73ba

Please sign in to comment.