02基因差异表达分析

R包安装

使用R3.6.0,进行

if (!requireNamespace("BiocManager", quietly = TRUE))
    install.packages("BiocManager")
BiocManager::install("ballgown")
##也可以直接使用library加载
library(ballgown)

报错

BiocManager在安装过程中没有权限

https://stackoverflow.com/questions/41839214/installation-path-not-writable-r-unable-to-update-packages 还是没有解决

# Installation path not writeable
installed.packages()[, c("Package", "LibPath")]
#查看这些包的安装路径,直接改变权限

1.加载表达文件

当stringtie生成的*.ctab文件都在同一个目录下的时候,直接使用样本所在的父目录作为参数。samplePattern样本的前缀,这个例子中包含有20个样本的数据

# make the ballgown object:
#根据目录来提取表达
bg = ballgown(dataDir=data_directory, samplePattern='sample', meas='all')
bg
#直接指定样本文件夹所在路径
ballgown(samples=c(文件目录),meas='all')
## ballgown instance with 100 transcripts and 20 samples

2.使用插槽访问里面的各种数据

差异表达分析

Ballgown provides a wide selection of simple, fast statistical methods for testing whether transcripts are differentially expressed between experimental conditions or across a continuous covariate (such as time).

总共15个分类,每类里有两个重复

也可以得到matrix用于到其他模型中,例如DEseq2等。

分析两个重复间的重复性和差异表达基因

使用DESeq2进行差异表达分析

htseq统计比对到gene的read数目

进行差异表达分析

绘制火山图

火山图

比较分类

  • 1、3 和J在不同发育阶段比较

  • 6、7和J在不同发育阶段比较

  • 1、2和6、7在不同发育阶段比较

  • 1、3在三个时期进行轨迹的比较

  • 6、7在三个时期进行轨迹的比较

  • J在三个时间进行轨迹的比较

参考

  1. 转录组差异表达分析 https://github.com/alyssafrazee/ballgown

Last updated

Was this helpful?