Permalink
Newer
Older
100644 31 lines (22 sloc) 753 Bytes
Dec 4, 2015 @cheeyeelim Initial commit
1 #(1) Setup paths and environment.
Dec 11, 2015 @cheeyeelim Update name
2 library(BTR)
Dec 4, 2015 @cheeyeelim Initial commit
3 library(doParallel)
4
Mar 16, 2016 @cheeyeelim Changes for revision.
5 path='~/btr_output/'
Dec 4, 2015 @cheeyeelim Initial commit
6 setwd(path)
7
8 #Setting up for parallel processing.
9 registerDoParallel(cores=4)
10
11 #(2)Load data.
12 data(bon_bmodel)
13 data(bon_istate)
14 data(wilson_raw_rnaseq)
15
16 bmodel = initialise_model(bon_bmodel)
17 istate = initialise_data(bon_istate)
18
19 #(3)Filtering expression data.
Mar 16, 2016 @cheeyeelim Changes for revision.
20 cdata = initialise_raw_data(wilson_raw_rnaseq) #do not filter data at this stage. keep the whole matrix.
Dec 4, 2015 @cheeyeelim Initial commit
21 fcdata = cdata[grepl('hsc', rownames(cdata)),] #select only HSC cells.
22
23 #(3)Filtering expression data.
Mar 16, 2016 @cheeyeelim Changes for revision.
24 result = model_train(cdata=fcdata, bmodel=bmodel, istate=istate, verbose=T)
Dec 4, 2015 @cheeyeelim Initial commit
25
26 filename = 'bon_wilson_rnaseq_HSC_trained_bmodel.rda'
27 save(result, file=filename)
28
29 #Cleaning up.
30 stopImplicitCluster()