This tutorial describes how to run alternative differential expression (DE) methods on CD8+ T Cell CROP-seq data. All analyses are limited to the stimulated group only. All file paths here are relative to this working directory: /project2/xinhe/yifan/Factor_analysis/Stimulated_T_Cells/.

0.1 DESeq2

0.1.1 R script

Location: run_deseq.all_by_stim.R;

Command line usage example:

Rscript run_deseq.all_by_stim.R --out_folder=processed_data/DESeq2/all_by_stim_negctrl/ --marker=ARID1A --NTC_only=TRUE --permute=FALSE

marker: the gRNA perturbation condition to test the differential effects,
NTC_only: whether to compare with only nontargeting control cells or all cells in other conditions.

0.1.2 Run jobs at scale

Edit the Python script submit_DE_jobs_in_batches.py, which can submit sbatch jobs for all gRNA targets.

Make sure to modify the sbatch script defined in make_DEG_sbatch() and loop over all conditions.

To submit jobs, run the edited script: ./submit_DE_jobs_in_batches.py.

0.1.3 Output

Each gRNA condition vs negative control: processed_data/DESeq2/all_by_stim_negctrl/;

Each gRNA condition vs the rest of cells: processed_data/DESeq2/all_by_stim_dev_6k/;

0.2 MAST

Location: run_MASTcpmDetRate.all_by_stim.R;

Command line usage example:

Rscript run_MASTcpmDetRate.all_by_stim.R --out_folder=processed_data/MAST/all_by_stim_negctrl/ --marker=ARID1A --NTC_only=TRUE --permute=FALSE

marker: the gRNA perturbation condition to test the differential effects,
NTC_only: whether to compare with only nontargeting control cells or all cells in other conditions.

0.2.1 Run jobs at scale

Edit the Python script submit_DE_jobs_in_batches.py, which can submit sbatch jobs for all gRNA targets.

Make sure to modify the sbatch script defined in make_DEG_sbatch() and loop over all conditions.

To submit jobs, run the edited script: ./submit_DE_jobs_in_batches.py.

0.2.2 Output

Each gRNA condition vs negative control: processed_data/MAST/all_by_stim_negctrl/;

Each gRNA condition vs the rest of cells: processed_data/MAST/all_by_stim_dev_6k/;

0.3 scMAGeCK

0.3.1 R script

Location: scmageck/run_scmageck.R;

Command line usage example (works on all gRNA conditions at once):

Rscript scmageck/run_scmageck.R --permute=FALSE

0.3.2 Output

Each gRNA condition vs negative control among stimulated cells: scmageck/scmageck_lr.TCells_stim.dev_res_top_6k.rds.

Each gRNA condition vs negative control among unstimulated cells:scmageck_lr.TCells_unstim.dev_res_top_6k.rds.