数据下载与整理:
wget -c https://ftp.ncbi.nlm.nih.gov/geo/series/GSE139nnn/GSE139555/suppl/GSE139555%5Fall%5Fmetadata.txt.gz
wget -c "https://www.ncbi.nlm.nih.gov/geo/download/?acc=GSE139555&format=file" -O GSE139555_RAW.tar
tar xvf GSE139555_RAW.tar
cat map.txt|while read g s p;do
mkdir $p
cd $p
ln -s ../${g}_$s-$p.matrix.mtx.gz matrix.mtx.gz
ln -s ../${g}_$s-$p.barcodes.tsv.gz barcodes.tsv.gz
ln -s ../${g}_$s-$p.genes.tsv.gz features.tsv.gz
cd ..
#逗号换成tab键,并提取相应metadata文件
zcat GSE139555_all_metadata.txt.gz |sed 's#,#\t#g' |awk 'BEGIN{IGNORECASE=1}NR==1 || $1~"'$p'" '|sed -r 's/^\S+_//'|gzip - >$p.metadata.tsv.gz
done
准备map.txt文件:
GSM4143655 SAM24345862 lt1 GSM4143666 SAM24363329 ln6 GSM4143677 SAM24358050 cn2 GSM4143656 SAM24345863 ln1 GSM4143667 SAM24363331 lb6 GSM4143678 SAM24360638 rt1 GSM4143657 SAM24348188 lt2 GSM4143668 SAM24350754 et1 GSM4143679 SAM24360640 rn1 GSM4143658 SAM24348189 ln2 GSM4143669 SAM24350755 en1 GSM4143680 SAM24360639 rb1 GSM4143659 SAM24349905 lt3 GSM4143670 SAM24350752 et2 GSM4143681 SAM24361563 rt2 GSM4143660 SAM24349906 ln3 GSM4143671 SAM24350753 en2 GSM4143682 SAM24361562 rn2 GSM4143661 SAM24353440 lt4 GSM4143672 SAM24352255 et3 GSM4143683 SAM24361564 rb2 GSM4143662 SAM24353441 ln4 GSM4143673 SAM24352256 en3 GSM4143684 SAM24363036 rt3 GSM4143663 SAM24360809 lt5 GSM4143674 SAM24356595 ct1 GSM4143685 SAM24363037 rn3 GSM4143664 SAM24360810 ln5 GSM4143675 SAM24356596 cn1 GSM4143686 SAM24363038 rb3 GSM4143665 SAM24363330 lt6 GSM4143676 SAM24358049 ct2
数据读入:
project=GSE139555
mkdir $project
cat data/$project/map.txt |while read g s p;do
Rscript $scripts/seurat_sc_qc.r --data.dir $p --project $project \
--metadata.col.name project Capture.Method Sample Tissue\
--metadata.value $project 10X3 $p NA\
--nUMI.min 500 \
--nUMI.max 40000 \
--nGene.min 250 \
--mito.gene.pattern "^MT.*-" \
--percent_mito 20 \
--log10GenesPerUMI 0.7 \
-o $project/ -p $p --metadata $p.metadata.tsv.gz
done
#合并数据
Rscript $scripts/merge_seurat_obj.r -i `ls $project/*.afterQC.rds` \
-o $project/01.qc -p lung
如果觉得我的文章对您有用,请随意打赏。你的支持将鼓励我继续创作!