In [1]:
source("http://bioconductor.org/biocLite.R")
biocLite("rhdf5")
In [1]:
devtools::install_github("pachterlab/sleuth")
In [2]:
library("sleuth")
In [3]:
base_dir <- "../data/kallisto"
sample_id <- dir(file.path(base_dir), pattern='^lo')
sample_id
In [4]:
kal_dirs <- sapply(sample_id, function(id) file.path(base_dir, id))
kal_dirs
In [5]:
dir(kal_dirs)
In [7]:
gsy_samples <- c('lo05', 'lo09', 'lo03', 'lo11')
gsy_samples
In [16]:
gsy_dirs <- c(kal_dirs[seq(1, length(kal_dirs), 2)], kal_dirs[seq(2, length(kal_dirs), 2)])
gsy_dirs
In [ ]:
gsy
In [17]:
s2c <- data.frame(sample=c('lo03', 'lo05', 'lo09', 'lo11'), condition=c('gsy', 'wt', 'wt', 'gsy'), path=c('../data/kallisto/lo03','../data/kallisto/lo05', '../data/kallisto/lo09','../data/kallisto/lo11'))
s2c
In [ ]:
In [18]:
so <- sleuth_prep(s2c, ~ condition)
In [36]:
so <- sleuth_fit(so)
In [37]:
so <- sleuth_fit(so, ~1, 'reduced')
In [38]:
#so <- sleuth_test(so, which_beta='conditionwt')
so <- sleuth_lrt(so, 'reduced', 'full')
In [39]:
models(so)
In [41]:
source("http://bioconductor.org/biocLite.R")
biocLite("biomaRt")
In [42]:
mart <- biomaRt::useMart(biomart = "ENSEMBL_MART_ENSEMBL",
dataset = "celegans_gene_ensembl",
host = 'ensembl.org')
In [43]:
t2g <- biomaRt::getBM(attributes = c("ensembl_transcript_id", "ensembl_gene_id",
"external_gene_name"), mart = mart)
t2g <- dplyr::rename(t2g, target_id = ensembl_transcript_id,
ens_gene = ensembl_gene_id, ext_gene = external_gene_name)
so <- sleuth_prep(s2c, ~ condition, target_mapping = t2g)
In [44]:
so <- sleuth_fit(so)
In [46]:
so <- sleuth_fit(so, ~1, 'reduced')
In [47]:
so <- sleuth_lrt(so, 'reduced', 'full')
In [51]:
so <- sleuth_wt(so, which_beta = 'conditionwt')
In [52]:
sleuth_live_settings(test_type='wt')
In [ ]:
sleuth_live(so)
In [10]:
write.table(res,file='../kallisto/results.tsv', sep='\t')
In [ ]:
sleuth_live(so)
In [ ]:
res <- sleuth_results(so, 'conditionwt')
In [ ]: