cd ~/APP
wget -O cellranger-7.1.0.tar.xz "https://cf.10xgenomics.com/releases/cell-exp/cellranger-7.1.0.tar.xz?Expires=1674686023&Policy=eyJTdGF0ZW1lbnQiOlt7IlJlc291cmNlIjoiaHR0cHM6Ly9jZi4xMHhnZW5vbWljcy5jb20vcmVsZWFzZXMvY2VsbC1leHAvY2VsbHJhbmdlci03LjEuMC50YXIueHoiLCJDb25kaXRpb24iOnsiRGF0ZUxlc3NUaGFuIjp7IkFXUzpFcG9jaFRpbWUiOjE2NzQ2ODYwMjN9fX1dfQ__&Signature=kBEWDvHNogaTb-bmHzd7kHIBIfs8LQmePXusMXNKYpuqbgNHX5Ai0mhB-wv6ig1X5QFZytrl4gYXd8DyNXVo85hRp6Iw9k1UHtuuictpnyNe-5JNocePNKou89k9AOEGoatr6xa9z1VPkOj33FTpG25OpfQowpBrwvNhFF27qoSqw7EcjSWm53zB4QsYqMR~Bi-5MXTEplAxusXnE5A1HtVOo31lsL7cavd88ez9yFcSDIf65~KJR6KqDzqYS3NAcm3MKBWWSeIVAwOWAuHaQONeAew8X4fMb3ql85CpeaCWrQdB-vlUVkQbM0gJY2S7MQ9SJ0B5qUc7qo9UWLXATw__&Key-Pair-Id=APKAI7S6A5RYOXBWRPDA"
tar -xf cellranger-7.1.0.tar.xz
ln -s ~/APP/cellranger-7.1.0/bin/cellranger ~/APP/bin/cellranger
export PATH=$HOME/APP/bin:$PATH
10X提供人和鼠的基因组参考index,其他物种可以是用cellranger自行构建
#>>>down10Xref.sh
# Human reference (GRCh38) md5sum: dfd654de39bff23917471e7fcc7a00cd
wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-GRCh38-2020-A.tar.gz
md5sum refdata-gex-GRCh38-2020-A.tar.gz
# Mouse reference md5sum: 886eeddde8731ffb58552d0bb81f533d
wget https://cf.10xgenomics.com/supp/cell-exp/refdata-gex-mm10-2020-A.tar.gz
md5sum refdata-gex-mm10-2020-A.tar.gz
#<<<down10Xref.sh
nohup sh down10Xref.sh &> down10Xref.sh.log &
https://www.ebi.ac.uk/ena/browser/view/PRJNA510251
mkdir -p ~/Project/LC/data/rawdata
cd ~/Project/LC/data/rawdata
cut -f 11 filereport_read_run_PRJNA510251_tsv.txt | tr ';' '\n' | grep '_[12].fastq.gz' > fq.txt
#>>>downloadFQ.sh
cat fq.txt |while read i
do
ascp -QT -l 300m -P33001 \
-i ~/micromamba/envs/RNA/etc/asperaweb_id_dsa.openssh \
era-fasp@$i \
.
done
#<<<downloadFQ.sh
nohup sh downloadFQ.sh &> downloadFQ.log &
#制作了check.md5文件
cut -f 9 filereport_read_run_PRJNA510251_tsv.txt | sed '1d' | awk -F ';' '{print $(NF-1)"\n"$NF}' > md5.txt
cut -f 7 -d '/' fq.txt | paste md5.txt - > check.md5
rm md5.txt
#检查md5值是否一样,文件是否下载完整
md5sum -c check.md5 &> check.md5.res
10X官网给指出来了文件名规则:
[Sample Name]_S1_L00[Lane Number][Read Type]_001.fastq.gz
Where Read Type
is one of:
I1
: Sample index read (optional)I2
: Sample index read (optional)R1
: Read 1R2
: Read 2用python制作重命名脚本
from collections import Counter
import numpy as np
import pandas as pd
df=pd.read_csv('filereport_read_run_PRJNA510251_tsv.txt',sep='\t')
# Read Type
r=[1,2] * df.shape[0]
# Sample Name
s=np.repeat(df.experiment_alias.values,2)
# Sample Number; Lane Number
s,l = [],[]
for x,y in enumerate(Counter(sn).values()):
l += list(range(1,int(y/2)+1))
s += [x+1] * y
l=np.repeat(l,2)
# new file name
new=[f'{a}_S{b}_L00{c}_R{d}_001.fastq.gz' for a,b,c,d in zip(sn,s,l,r)]
# old file name
fq=[]
for i in df.fastq_aspera:
fq+=i.split(';')
old=[i.split('/')[-1] for i in fq]
#shell script
df2=pd.DataFrame({1:old,2:new})
df2.insert(0,column=0,value='mv')
df2.to_csv('rename.sh',index=False,header=False,sep=' ')
#sh
bash rename.sh
rename.sh前几行
mv SRR8325947_1.fastq.gz GSM3516662_S1_L001_R1_001.fastq.gz
mv SRR8325947_2.fastq.gz GSM3516662_S1_L001_R2_001.fastq.gz
mv SRR8325948_1.fastq.gz GSM3516662_S1_L002_R1_001.fastq.gz
mv SRR8325948_2.fastq.gz GSM3516662_S1_L002_R2_001.fastq.gz
...
因为资源有限,这里只对GSM3516662和GSM3516663两个样本定量。
cd ~/Project/SC10X/rawdata/
mv GSM3516662* fastqs
mv GSM3516663* fastqs
#>>>quantify.sh
fastqs_dir=~/Project/SC10X/rawdata/fastqs
index_dir=~/DataHub/Genomics/10X/refdata-gex-GRCh38-2020-A
output_dir=~/Project/SC10X/quantify
cd ${output_dir}
ls ${fastqs_dir} | cut -d '_' -f 1 | uniq | while read i
do
cellranger count \
--id $i \
--transcriptome ${index_dir} \
--fastqs ${fastqs_dir} \
--sample $i \
--localcores 12 \
--localmem 128
done
#<<<quantify.sh
nohup sh quantify.sh &> quantify.sh.log &
RuntimeError: ~/Project/SC10X/GSM3516662 is not a pipestance directory
[Sample Name]
可以参考生信技能树[https://mp.weixin.qq.com/s/VWUmJZnzT7m_7QDjxkbrJw]
需要查看的文件
已经得到表达量矩阵下一步走scanpy分析流程。
https://mp.weixin.qq.com/s/cu7r7iY2AEKLBdHALzYaCQ
https://mp.weixin.qq.com/s/VWUmJZnzT7m_7QDjxkbrJw
https://mp.weixin.qq.com/s/Fxd9-P79SzvyxwcjUGNL0Q
https://mp.weixin.qq.com/s/6rSMzj8CE-Zw2-EeXyxBYg
https://mp.weixin.qq.com/s/CtQdWfclesbXBVOIPtdzrw
https://blog.csdn.net/herokoking/article/details/103632115
手机扫一扫
移动阅读更方便
你可能感兴趣的文章