Cellbender - MattHuff/scRNASeq_011224 GitHub Wiki

Cellbender removes ambient RNA from the raw output of Cell Ranger. This step is, overall, similar to previous documentation, so this will be a brief overview of the steps.

Create New Directory

In the analysis directory...

mkdir 4_cellbender
cd 4_cellbender

Get Symbolic Links

We want to analyze the raw output of Cell Ranger, which is in the individual output directories we produced in the previous step. However, the output file names are the same, which can create issues downstream. I like to create a symbolic link to the files with new names to differentiate them:

ln -s ../3_cellranger/run_Jordan_1/outs/multi/count/raw_feature_bc_matrix.h5 LVF002-Pap_raw_feature_bc_matrix.h5
ln -s ../3_cellranger/run_Jordan_2/outs/multi/count/raw_feature_bc_matrix.h5 LVF002-Septum_raw_feature_bc_matrix.h5
ln -s ../3_cellranger/run_Jordan_3/outs/multi/count/raw_feature_bc_matrix.h5 LVF006-Pap_raw_feature_bc_matrix.h5
ln -s ../3_cellranger/run_Jordan_4/outs/multi/count/raw_feature_bc_matrix.h5 LVF006-Septum_raw_feature_bc_matrix.h5

Run Cellbender

Save the following as run_cellbender.qsh and submit it:

#!/bin/bash

#PBS -N 4_cellbender
#PBS -l select=1:ncpus=16:ngpus=2:mem=200gb
#PBS -l walltime=01:20:00
#PBS -q musc3_gpu
#PBS -j oe

#source ~/.bashrc
#mamba activate cellbender
#module load cuda/12.1.1-gcc/9.5.0
cd $PBS_O_WORKDIR

for h5 in /zfs/musc3/huffmat/Jordan_scRNASeq_011024/analysis/4_cellbender/*.h5
do
	BASE=$( basename $h5 | sed 's/_raw_feature_bc_matrix.h5//g' )

	singularity exec --nv -B /zfs/musc3:/zfs/musc3 --pwd /zfs/musc3/huffmat/Jordan_scRNASeq_011024/analysis/4_cellbender /zfs/musc3/singularity_images/biocm-cellbender_1.0.2.sif cellbender remove-background \
		--cuda \
		--input $h5 \
		--output ${BASE}_cellbinder_feature_bc_matrix.h5 \
		--fpr 0.01 \
		--epochs 150
done

Note that we have added options for GPU usage - Cellbender has options for GPU usage, which improves runtime.

Copy Files to Personal Computer

From this point forward, we will be analyzing the H5 files in R, which I normally run on desktop. In a separate window, where you are not logged into the cluster, copy the files to your desktop:

rsync -avzh -e ssh <user_name>@hpcdtn01.rcd.clemson.edu:"/zfs/musc3/huffmat/ATAC-Seq/analysis/5_call_peaks/5e_mergePeaks/*_UCSC.bw" Downloads/scRNASeq_011224/5_Seurat/
⚠️ **GitHub.com Fallback** ⚠️