r
library(Biostrings)
library(clusterProfiler)
library(devtools)
## https://github.com/mohuangx/SAVER
library(SAVER)
## If install_github get something wrong like "tar: This does not look like a tar archive", you can run the next code to set curl.
#options("download.file.method"="libcurl")
install_github("bm2-lab/MUSIC")
library(MUSIC)
## TutorialFor illustration purpose, we took the dataset crop_stimulated as an example. You can load the three files in "crop_stimulated" to R environment. ```r expression_profile<-read.table("./crop_stimulated/expression_profile.txt",head=T,row.names=1,sep="\t") perturb_information_df<-read.table("./crop_stimulated/perturb_information.txt",head=T,row.names=1,sep="\t") perturb_information<-as.character(perturb_information_df[,1]) names(perturb_information)<-row.names(perturb_information_df) # If you don't consider off-target effect, this file is not needed. #sgRNA_information_df<-read.table("./crop_stimulated/sgRNA_information.txt",head=T,row.names=1,sep="\t") #sgRNA_information<-as.character(sgRNA_information_df[,1]) #names(sgRNA_information)<-row.names(sgRNA_information_df)
dim(expression_profile)
r
expression_profile[1:3,1:3]
r
length(perturb_information)
* The first step: data preprocessing.
r
crop_seq_list<-Input_preprocess(expression_profile,perturb_information)
```
```r
crop_seq_qc<-Cell_qc(crop_seq_list$expression_profile,crop_seq_list$perturb_information,species="Hs",plot=F)
crop_seq_imputation<-Data_imputation(crop_seq_qc$expression_profile,crop_seq_qc$perturb_information,cpu_num=15)
r
crop_seq_filtered<-Cell_filtering(crop_seq_imputation$expression_profile,crop_seq_imputation$perturb_information,cpu_num=10) ```
crop_seq_vargene<-Get_high_varGenes(crop_seq_filtered$expression_profile,crop_seq_filtered$perturb_information,plot=T) ```
```r
topic_model_list<-Get_topics(crop_seq_vargene$expression_profile,crop_seq_vargene$perturb_information,topic_number=c(4:6))
topic_1<-Get_topics(crop_seq_vargene$expression_profile,crop_seq_vargene$perturb_information,topic_number=4) topic_2<-Get_topics(crop_seq_vargene$expression_profile,crop_seq_vargene$perturb_information,topic_number=5) topic_3<-Get_topics(crop_seq_vargene$expression_profile,crop_seq_vargene$perturb_information,topic_number=6) topic_model_list<-list() topic_model_list$models<-list() topic_model_list$perturb_information<-topic_1$perturb_information topic_model_list$models[[1]]<-topic_1$models[[1]] topic_model_list$models[[2]]<-topic_2$models[[1]] topic_model_list$models[[3]]<-topic_3$models[[1]]
r
optimalModel<-Select_topic_number(topic_model_list$models,plot=T)
optimalModel<-topic_model_list$models[[1]] ```
```r
topic_func<-Topic_func_anno(optimalModel,species="Hs",plot=T) ```
distri_diff<-Diff_topic_distri(optimalModel,topic_model_list$perturb_information,plot=T) ```
```r
rank_overall_result<-Rank_overall(distri_diff)
rank_topic_specific_result<-Rank_specific(distri_diff)
perturb_cor<-Correlation_perturbation(distri_diff,plot=T) ```
``` ## Citation Duan, B., et al., Model-based understanding of single-cell CRISPR screening. Nat Commun, 2019. 10(1): p. 2233.
## Contact bioinfo_db@163.com or qiliu@tongji.edu.cn
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.