数据下载
wget -c "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE145370&format=file" -O GSE145370_RAW.tar
#解压
tar xvf GSE145370_RAW.tar
准备map.txt 文件:
#accession SampleID gender age pathological_stage tissue_type patient GSM4317409 S133A Male 60 IIIB T S133 GSM4317410 S134A Female 53 IIIA T S134 GSM4317411 S135A Male 71 IIA T S135 GSM4317412 S149A Male 81 IIA T S149 GSM4317413 S150A Male 73 IIIB T S150 GSM4317414 S158A Male 55 IIB T S158 GSM4317415 S159A Male 54 IIIB T S159 GSM4317416 S133B Male 60 IIIB N S133 GSM4317417 S134B Female 53 IIIA N S134 GSM4317418 S135B Male 71 IIA N S135 GSM4317419 S149B Male 81 IIA N S149 GSM4317420 S150B Male 73 IIIB N S150 GSM4317421 S158B Male 55 IIB N S158 GSM4317422 S159B Male 54 IIIB N S159
批量解压:
cat map.txt |grep -v "#"|while read a b c ;do mkdir $b;tar zxvf ${a}_${b}_filtered_feature_bc_matrix.tar.gz -C $b;done
结果目录:
循环读入数据做质控:
cat map.txt|grep -v "#"|while read a b c d e f g;do Rscript $scripts/seurat_sc_qc.r --data.dir $b/filtered_feature_bc_matrix --project GSE145370 \ --nUMI.min 500 \ --nUMI.max 50000 \ --nGene.min 250 \ --mito.gene.pattern "^MT.*-" \ --percent_mito 25 \ --log10GenesPerUMI 0.7 \ -p $b \ --metadata.col.name accession SampleID gender age pathological_stage tissue_type patient \
--metadata.value $a $b $c $d $e $f $g done #合并数据 Rscript $scripts/merge_seurat_obj.r -i $(ls *.afterQC.rds) \ -o 02.merge -p GSE145370
#分群聚类 Rscript $scripts/seurat_sc_cluster.r --rds 02.merge/GSE145370.rds \
-p GSE145370 --resolution 0.5 -d 30 -o 03.cluster \
--vars.to.regress nUMI percent_mito --high.variable.genes 2000
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!