构建STAR
的索引
# 使用10X的参考数据构建star索引
STAR \
--runMode genomeGenerate \
-- runThreadN 28 \
--genomeDir ~/bioreference/index/10x-star \
--genomeFastaFiles ~/bioreference/10x/grch38_10x/fasta/genome.fa \
--sjdbGTFfile ~/bioreference/10x/grch38_10x/genes/genes.gtf
进行STAR
流程
将以下代码写入scSTAR.sh
脚本中
# Global variable
#########################################################
source activate rna
#########################################################
start=$(date +%s) #脚本启始时间
echo "脚本开始执行"
echo "开始时间:"`date`
#########################################################
# Main program
SraPath=/mnt/d/datasets/GSE108383/GSE108383
GenomeRef=~/bioreference/index/10x-star
fa=/mnt/d/datasets/GSE108383/GSE108383
OutPath=~/GSE108383
# STAR workflow
ls $SraPath |while read id
do
x=$(echo $id | cut -b1-10)
echo $x
STAR --runThreadN 20 --genomeDir $GenomeRef \
--readFilesCommand zcat \
--readFilesIn ${fa}/$x.fastq.gz \
--outSAMtype BAM SortedByCoordinate \
--outFileNamePrefix ${OutPath}/${x}_star
done
conda deactivate
#########################################################
end=$(date +%s) #脚本终止时间
take=$(( end - start ))
h=$(( take / 3600 ))
m=$((( take - 3600 * h ) / 60 ))
s=$((( take - 3600 * h - 60 * m )))
echo 脚本运行完毕,用时 ${h} 小时 ${m} 分钟 ${s} 秒
echo "结束时间:"`date`
say "The program has finished running"
#########################################################
然后走stringtie
流程
将以下代码写入stringtie.sh
脚本中
注意,改代码要在上个文件的输出文件夹中运行
# Global variable
#########################################################
#########################################################
start=$(date +%s) #脚本启始时间
echo "脚本开始执行"
echo "开始时间:"`date`
#########################################################
# Main program
stringtie=~/biosoft/stringtie-2.1.4.Linux_x86_64/stringtie
GTF=~/bioreference/10x/grch38_10x/genes/genes.gtf
OutPath=IsoformQuantification
bam=/home/yuansh/GSE108383
# stringtie workflow
ls $bam | grep 'bam' | while read id
do
x=$(echo $id | cut -b1-10)
echo $x
$stringtie -eB -G $GTF -o $OutPath/long_reads.out.gtf ${x}_starAligned.sortedByCoord.out.bam
done
#########################################################
end=$(date +%s) #脚本终止时间
take=$(( end - start ))
h=$(( take / 3600 ))
m=$((( take - 3600 * h ) / 60 ))
s=$((( take - 3600 * h - 60 * m )))
echo 脚本运行完毕,用时 ${h} 小时 ${m} 分钟 ${s} 秒
echo "结束时间:"`date`
say "The program has finished running"
#########################################################
然后生成csv文件
# 然后生成csv文件
python ~/biosoft/stringtie-2.1.4.Linux_x86_64/prepDE.py
如果您觉得我的教程对您有帮助的话,点个赞或者打个赏请我喝杯星巴克(~ ̄(OO) ̄)ブ
Best Regards,
Yuan.SH
---------------------------------------
School of Basic Medical Sciences,
Fujian Medical University,
Fuzhou, Fujian, China.
please contact with me via the following ways:
(a) e-mail :yuansh3354@163.com