Skip to content

Ballgown #
Find similar titles

Tools for statistical analysis of assembled transcriptomes, including flexible differential expression analysis, visualization of transcript structures, and matching of assembled transcripts to annotation.

Tips #

일반설치

source("https://bioconductor.org/biocLite.R")
biocLite("ballgown")
browseVignettes("ballgown")

Bioconda로 설치

conda install bioconductor-ballgown r-dplyr r-devtools

기본 사용법

library(ballgown)
library(RSkittleBrewer)
library(genefilter)
library(dplyr)
library(devtools)

# load phenotype
pheno_data = read.csv("geuvadis_phenodata.csv")

# load from StringTie
bg_chrX = ballgown(dataDir = "ballgown", samplePattern = "ERR", pData=pheno_data

# Filter to remove low-abundance genes
bg_chrX_filt = subset(bg_chrX,"rowVars(texpr(bg_chrX)) >1", genomesubset=TRUE)

# Identify transcripts that show statistically significant differences between groups
results_transcripts = stattest(bg_chrX_filt, feature="transcript",covariate="sex",adjustvars = c("population"), getFC=TRUE, meas="FPKM")

# Identify genes that show statistically significant differences between groups
results_genes = stattest(bg_chrX_filt, feature="gene", covariate="sex", adjustvars = c("population"), getFC=TRUE, meas="FPKM")

# Add gene names and gene IDs to the results_transcripts data frame
results_transcripts = data.frame(geneNames=ballgown::geneNames(bg_chrX_filt), geneIDs=ballgown::geneIDs(bg_chrX_filt), results_transcripts)

# Sort the results from the smallest P value to the largest:
results_transcripts = arrange(results_transcripts,pval)
results_genes = arrange(results_genes,pval)

# Write the results to a csv file that can be shared and distributed
write.csv(results_transcripts, "chrX_transcript_results.csv", row.names=FALSE)
write.csv(results_genes, "chrX_gene_results.csv", row.names=FALSE)

# Identify transcripts and genes with a q value <0.05
subset(results_transcripts,results_transcripts$qval<0.05)
subset(results_genes,results_genes$qval<0.05)

# Make the plots pretty
tropical= c('darkorange', 'dodgerblue', 'hotpink', 'limegreen', 'yellow')
palette(tropical)
fpkm = texpr(bg_chrX,meas="FPKM")
fpkm = log2(fpkm+1) 
    boxplot(fpkm,col=as.numeric(pheno_data$sex),las=2,ylab='log2(FPKM+1)')

Incoming Links #

Related Articles #

Related Medical Scholarly Articles #

Suggested Pages #

web biohackers.net
0.0.1_20140628_0