美文网首页生物信息学R语言源码
RNA-seq分析完整实例(Salmon定量)

RNA-seq分析完整实例(Salmon定量)

作者: 小明的数据分析笔记本 | 来源:发表于2020-01-06 18:09 被阅读0次

2019年8月24号

参考文献

1、Salmon: Fast, accurate and bias-aware transcript quantification from RNA-seq data
2、RNAseq expression analysis
3、Introduction to R Data analysis and visualization for researchers


数据下载

参考基因组
wget http://downloads.yeastgenome.org/sequence/S288C_reference/orf_dna/orf_coding.fasta.gz

酵母单端测序数据
### 突变型(3个重复)
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458500/ERR458500.fastq.gz
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458501/ERR458501.fastq.gz
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458502/ERR458502.fastq.gz
### 野生型(3个重复)
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458493/ERR458493.fastq.gz
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458494/ERR458494.fastq.gz
wget ftp://ftp.sra.ebi.ac.uk/vol1/fastq/ERR458/ERR458495/ERR458495.fastq.gz

量化转录本水平的表达量软件 salmon
wget https://github.com/COMBINE-lab/salmon/releases/download/v0.14.1/salmon-0.14.1_linux_x86_64.tar.gz

数据目录结构
./
├── mutant
│   ├── ERR458500.fastq.gz
│   ├── ERR458501.fastq.gz
│   └── ERR458502.fastq.gz
├── Reference_genome
│   └── orf_coding.fasta
├── Salmon
│   └── salmon-0.14.1_linux_x86_64.tar.gz
├── salmon_linux
│   ├── bin
│   │   └── salmon
│   ├── lib
│   │   ├── libgcc_s.so.1
│   │   ├── libgomp.so.1
│   │   ├── liblzma.so.0
│   │   ├── libm.so.6
│   │   ├── libtbbmalloc_proxy.so
│   │   ├── libtbbmalloc_proxy.so.2
│   │   ├── libtbbmalloc.so
│   │   ├── libtbbmalloc.so.2
│   │   ├── libtbb.so
│   │   └── libtbb.so.2
│   └── sample_data.tgz
└── wild_type
    ├── ERR458493.fastq.gz
    ├── ERR458494.fastq.gz
    └── ERR458495.fastq.gz

计算表达量

### 构建索引
./salmon_linux/bin/salmon index --index Reference_genome/yeast_orfs --type quasi --transcripts Reference_genome/orf_coding.fasta
### 计算表达量
##突变型
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r mutant/ERR458500.fastq.gz -o mutant/ERR458500.fastq.gz.quant --seqBias --gcBias
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r mutant/ERR458501.fastq.gz -o mutant/ERR458501.fastq.gz.quant --seqBias --gcBias
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r mutant/ERR458502.fastq.gz -o mutant/ERR458502.fastq.gz.quant --seqBias --gcBias
##野生型
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r wild_type/ERR458493.fastq.gz -o wild_type/ERR458493.fastq.gz.quant --seqBias --gcBias
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r wild_type/ERR458494.fastq.gz -o wild_type/ERR458494.fastq.gz.quant --seqBias --gcBias
./salmon_linux/bin/salmon quant -i Reference_genome/yeast_orfs --libType U -r wild_type/ERR458495.fastq.gz -o wild_type/ERR458495.fastq.gz.quant --seqBias --gcBias

下载将表达量矩阵整合在一起的python脚本
### 原文脚本链接已经不能够使用,需要换成

https://github.com/ngs-docs/angus/blob/2019/scripts/gather-counts.py

### 这个脚本自己需要仔细看一下

edgeR 分析脚本
https://github.com/ngs-docs/angus/blob/2019/scripts/yeast.salmon.R

根据最终计算结果画火山图
library(ggplot2)
library(dplyr)
results<-read.csv("yeast-edgeR.csv")
head(results)
dim(results)
results<-mutate(results,significance=ifelse(results$FDR<0.05,"FDR<0.05","FDR>0.05"))
head(results)
p<-ggplot(results,aes(logFC,-log10(PValue)))+
  geom_point(aes(col=significance))+
  scale_color_manual(values=c("red","black"))+
  theme_bw()
p

image.png

p+geom_text(data=filter(results,FDR<1e-200),aes(label=X))

image.png

df1<-filter(results,FDR<1e-200)
dim(df1)
library(ggrepel)
p+geom_text_repel(data=df1,aes(label=X))

image.png

差异表达基因的热图
df<-as.data.frame(t(dge$counts))
dim(df)
df<-select(df,df1$X)
dim(df)
df_exp_count<-t(as.matrix(df))
dim(df_exp_count)
df_exp_count
heatmap(df_exp_count,
        labCol = c(rep("WT",3),rep("MUT",3)),
        scale="row")
image.png

欢迎大家关注我的公众号
小明的数据分析笔记本

公众号二维码.jpg

相关文章

网友评论

    本文标题:RNA-seq分析完整实例(Salmon定量)

    本文链接:https://www.haomeiwen.com/subject/qpjxectx.html