In the following, I will attempt to find the variance associated with different experimental factors in the macrophage data with mappings against the parasite transcriptome.
As in macrophage_estimation_parasite.html, I need to pull out the relevant samples:
parasite_expt$notes
## [1] "Created on Wed Dec 7 15:47:21 2016.\n"
colnames(parasite_expt$design)
## [1] "sampleid" "experimentname"
## [3] "tubelabel" "alias"
## [5] "condition" "batch"
## [7] "anotherbatch" "snpclade"
## [9] "snpcladev2" "snpcladev3"
## [11] "pathogenstrain" "donor"
## [13] "time" "pctmappedparasite"
## [15] "pctcategory" "state"
## [17] "sourcelab" "expperson"
## [19] "pathogen" "host"
## [21] "hostcelltype" "noofhostcells"
## [23] "infectionperiodhpitimeofharvest" "moiexposure"
## [25] "parasitespercell" "pctinf"
## [27] "rnangul" "rnaqcpassed"
## [29] "libraryconst" "libqcpassed"
## [31] "index" "descriptonandremarks"
## [33] "observation" "lowercaseid"
## [35] "humanfile" "parasitefile"
## [37] "file"
## make sure that I am getting the material from ~ 2016-09-20
macrophage_parasite <- expt_subset(parasite_expt, subset="experimentname=='macrophage'")
new_colors <- c("#000088", "#880000")
names(new_colors) <- c("macro_sh","macro_ch")
macrophage_parasite <- set_expt_colors(macrophage_parasite, colors=new_colors)
macronorm_parasite <- sm(normalize_expt(macrophage_parasite, filter=TRUE))
tt <- graph_metrics(macronorm_parasite)
## Graphing number of non-zero genes with respect to CPM by library.
## Graphing library sizes.
## Warning: Ignoring unknown aesthetics: parse
## Graphing a boxplot.
## I am reasonably sure this should be log scaled and am setting it.
## If this is incorrect, set scale='raw'
## Graphing a correlation heatmap.
## Graphing a standard median correlation.
## Performing correlation.
## Graphing a distance heatmap.
## Graphing a standard median distance.
## Performing distance.
## Graphing a PCA plot.
## Plotting a density plot.
## This data will benefit from being displayed on the log scale.
## If this is not desired, set scale='raw'
## Printing a color to condition legend.
Start out with just condition and batch
## The default arguments are to query ~ condition + (1|batch)
## Which, because condition is categorical, will end badly.
vp_cb <- varpart(macronorm_parasite, predictor=NULL, factors=c("condition","batch"))
## Attempting mixed linear model with: ~ (1|condition) + (1|batch)
## Fitting the expressionset to the model, this is slow.
## Projected run time: ~ 0.5 min
## Error in varpart(macronorm_parasite, predictor = NULL, factors = c("condition", : An error like 'vtv downdated' may be because there are too many 0s, try and filter the data and rerun.
vp_cb$percent_plot
## Error in eval(expr, envir, enclos): object 'vp_cb' not found
vp_cb$partition_plot
## Error in eval(expr, envir, enclos): object 'vp_cb' not found
Try using the snp information and see if it helps. Unfortunately, I have not yet processed one of the strains, that should be addressed asap.
The following all fail with “Downdated VtV is not positive definite” wtf ever that means. My google searches have so far proven useless for this.
vp_cbs3 <- varpart(macronorm_parasite, predictor=NULL, factors=c("condition","batch","snpcladev3"))
vp_cbs3$percent_plot
vp_cbs3$partition_plot