duplicates = multiple editions
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
A Classical Introduction to Modern Number Theory, Kenneth Ireland Michael Rosen
| library(shiny) | |
| # Define server logic for random distribution application | |
| shinyServer(function(input, output) { | |
| # Reactive expression to generate the requested distribution. This is | |
| # called whenever the inputs change. The renderers defined | |
| # below then all use the value computed from this expression | |
| data <- reactive({ | |
| dist <- switch(input$dist, |
| Algeria | Africa | |
|---|---|---|
| Angola | Africa | |
| Benin | Africa | |
| Botswana | Africa | |
| Burkina Faso | Africa | |
| Burundi | Africa | |
| Cameroon | Africa | |
| Cape Verde | Africa | |
| Central African Republic | Africa | |
| Chad | Africa |
| load("HMPv35_100nt.biom_MRexperiment.rdata") | |
| library(msd16s) | |
| k = which(pData(obj)$bodysite == "UBERON_stool") | |
| obj = obj[,k] | |
| mergeData = function(o1,o2,norm=FALSE){ | |
| o1names = rownames(o1) | |
| o2names = rownames(o2) |
| import_biom2 <- function(x, | |
| treefilename=NULL, refseqfilename=NULL, refseqFunction=readDNAStringSet, refseqArgs=NULL, | |
| parseFunction=parse_taxonomy_default, parallel=FALSE, version=1.0, ...){ | |
| # initialize the argument-list for phyloseq. Start empty. | |
| argumentlist <- list() | |
| x = biom(x) | |
| b_data = biom_data(x) | |
| b_data_mat = as(b_data, "matrix") |
| setMethod("normFactors", signature(object="MRexperiment"), | |
| function(object) { | |
| nf <- pData(obj@expSummary$expSummary)[["normFactors"]] | |
| nf <- unlist(nf) | |
| names( nf ) <- sampleNames(object) | |
| nf | |
| }) | |
| setReplaceMethod("normFactors", signature(object="MRexperiment", value="numeric"), | |
| function( object, value ) { |
| j = unlist(locals[2:3]) | |
| obj2 = obj[,j] | |
| sampleID2 = sampleID[j] | |
| mat = MRcounts(obj2,norm=TRUE,log=TRUE) | |
| otusToKeep <- which(rowSums(mat)>0) | |
| otuVars<-rowSds(mat[otusToKeep,]) | |
| otuIndices<-otusToKeep[order(otuVars,decreasing=TRUE)[1:1000]] | |
| mat <- mat[otuIndices,] | |
| mat = t(mat) |
| require(vegan) | |
| require(biom) | |
| require(metagenomeSeq) | |
| files = grep(".biom$",list.files(),value=TRUE) | |
| files2= grep(".txt",list.files(),value=TRUE) | |
| files3 = sprintf("%s_MRexperiment.rdata",files) | |
| # This generates the data - only run once. | |
| for(i in 1:length(files)){ |
| #!/bin/bash | |
| # grab the biom data | |
| wget https://github.com/biocore/American-Gut/raw/master/data/PGP/PGP_100nt.biom.gz | |
| wget https://github.com/biocore/American-Gut/raw/master/data/HMP/HMPv35_100nt.biom.gz | |
| wget https://github.com/biocore/American-Gut/raw/master/data/GG/GG_100nt.biom.gz | |
| wget https://github.com/biocore/American-Gut/raw/master/data/AG/AG_100nt.biom.gz | |
| gunzip * | |
| # grab the phenodata |