Skip to content

Commit

Permalink
Merge pull request #46 from igemsoftware2020/finalChanges
Browse files Browse the repository at this point in the history
Fixed all text, added how to section, added link to MultiStress Explo…
  • Loading branch information
MaherHassanain authored Oct 27, 2020
2 parents 5d04021 + 9f47178 commit 273c2b9
Show file tree
Hide file tree
Showing 13 changed files with 286 additions and 109 deletions.
Binary file added public/images/CSU.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/images/astrobio-screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/images/twistbiosice.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions public/stylesheets/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -282,3 +282,7 @@ td.x {
td.y {
color: red;
}

.redcolor a:link{
color: red;
}
25 changes: 19 additions & 6 deletions scripts/R/DEA/GSE147272.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
#License

# © Copyright 2020 iGEM Concordia, Maher Hassanain, Benjamin Clark, Hajar Mouddene, Grecia Orlano
# This file is part of AstroBio.
# AstroBio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# AstroBio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstroBio. If not, see <https://www.gnu.org/licenses/>.

library(edgeR)
library(dplyr)

Expand All @@ -16,8 +30,8 @@ d0 <- calcNormFactors(d0)
#filtering low expressed genes
cutoff <- 1
drop <- which(apply(cpm(d0), 1, max) < cutoff)
d <- d0[-drop,]
dim(d)
d <- d0[-drop,]
dim(d)

#Setting up factor names
gravity <- append(rep("MG", 4), rep("NG",4))
Expand All @@ -40,14 +54,14 @@ fit2 <- eBayes(fit2)
tT.exp <- topTable(fit2, n = Inf, adjust.method = "fdr")


#getting annotations
#getting annotations
anno <- rtracklayer::import("ecoli_nissle_1917.gtf")

anno <- anno %>% as.data.frame %>% filter(type == "exon") %>% select(-seqnames, -source, -score, -phase)
vmatch <- match(rownames(tT.exp),anno$gene_id)

vmatch_id <- anno$gene_name[vmatch]
tT.exp <- tT.exp %>% mutate(Gene.Symbol = vmatch_id, Platform.ORF = rownames(tT.exp)) %>% na.omit()
tT.exp <- tT.exp %>% mutate(Gene.Symbol = vmatch_id, Platform.ORF = rownames(tT.exp)) %>% na.omit()
write.csv(tT.exp, file = "datasets/GSE147272_Ecol/GSE147272_exponential.growth.csv")

#now for stationary phase
Expand All @@ -59,7 +73,7 @@ tT.sta <- topTable(fit3, n = Inf, adjust.method = "fdr")
vmatch <- match(rownames(tT.sta),anno$gene_id)

vmatch_id <- anno$gene_name[vmatch]
tT.sta <- tT.sta %>% mutate(Gene.Symbol = vmatch_id, Platform.ORF = rownames(tT.sta)) %>% na.omit()
tT.sta <- tT.sta %>% mutate(Gene.Symbol = vmatch_id, Platform.ORF = rownames(tT.sta)) %>% na.omit()
write.csv(tT.sta, file = "datasets/GSE147272_Ecol/GSE147272_stationary.growth.csv")

#getting metadata
Expand All @@ -73,4 +87,3 @@ strain <- "Nissle_1917"
gselist <- list(list(GSE = mdata[,c(1,2,5,6)]), list(GSE = mdata[,c(3,4,7,8)]))
metalabels <- c("exponential.growth", "stationary.growth")
extractMetaData(gse_groups = gselist, filename = metaName, microgravity_type = M.TYPE$RCCS, metaLabels = metalabels, strain = strain)

46 changes: 29 additions & 17 deletions scripts/R/DEA/GSE40648.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#License

# © Copyright 2020 iGEM Concordia, Maher Hassanain, Benjamin Clark, Hajar Mouddene, Grecia Orlano
# This file is part of AstroBio.
# AstroBio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# AstroBio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstroBio. If not, see <https://www.gnu.org/licenses/>.

#GSE40648 Ecoli MICROARRAY
#R script by BENJAMIN CLARK
Expand All @@ -8,7 +21,7 @@ library(Biobase)
library(limma)
library(org.EcK12.eg.db)
source("microarray_functions.R")
#This pulls the all the samples from the microarry dataset. This returns a list containing a single expressionSet object.
#This pulls the all the samples from the microarry dataset. This returns a list containing a single expressionSet object.
list.gse <- getGEO("GSE40648", GSEMatrix =TRUE, AnnotGPL=TRUE)

gse <- list.gse[[1]]
Expand All @@ -31,7 +44,7 @@ treatment <- c(4,5,6)

ecoli <- de.analysis(gse = gse.rm, microgravity_group = treatment, ground_group = control)

#print out the toptable
#print out the toptable
ecoliname <- "datasets/GSE40648_Ecoli/GSE40648_Ecoli.csv"
write.table(ecoli$TopTable, ecoliname, row.names = FALSE, sep = ",")
remove.controls(ecoli$TopTable)
Expand Down Expand Up @@ -64,44 +77,44 @@ anno.go.genome <- function(go.ids){
terms <- sapply(names(line.go.items[[1]]),FUN = Term)
names(terms) <- NULL
terms <- unlist(terms)

ontologies <- sapply(names(line.go.items[[1]]), FUN = Ontology)
names(ontologies) <- NULL
ontologies <- unlist(ontologies)

inner_out <- data.frame(id = names(line.go.items[[1]]), term = terms, ontology = ontologies)
out[names(go.ids)[i]]<- list(inner_out)



}
return(out)
}
go.genome <- anno.go.genome(mapped_gos)
valid_ids <- c()
for(i in 1:length(entrez_ids)){
if(length(go.genome[[entrez_ids[i]]]$ontology) > 0){
if(length(go.genome[[entrez_ids[i]]]$ontology) > 0){
GO.Function <- paste(dplyr::filter(go.genome[[entrez_ids[i]]], ontology == "MF")$term , collapse = "///")
GO.Process <- paste(dplyr::filter(go.genome[[entrez_ids[i]]], ontology == "BP")$term , collapse = "///")
GO.Component <- paste(dplyr::filter(go.genome[[entrez_ids[i]]], ontology == "CC")$term , collapse = "///")
}
else{
next
}

ided.rows <- grep(filtered.tT$TopTable$Gene.symbol, pattern = names(entrez_ids[i]))
correct.probe <- which.min(filtered.tT$TopTable[ided.rows,]$P.Value)

filtered.tT$TopTable$GO.Function[ided.rows[correct.probe]] <- GO.Function

filtered.tT$TopTable$GO.Component[ided.rows[correct.probe]] <- GO.Component

filtered.tT$TopTable$GO.Process[ided.rows[correct.probe]] <- GO.Process


valid_ids <- append(valid_ids, ided.rows[correct.probe])


}
valid_ids <- valid_ids[-which(duplicated(valid_ids))]
filtered.tT$TopTable <- filtered.tT$TopTable[valid_ids,]
Expand All @@ -118,4 +131,3 @@ strain <- "K12 MG1655"
gse_list <- list(ecoli)
labels <- c("ecoli")
extractMetaData(filename = metaName, gse_groups = gse_list, microgravity_type = M.TYPE$RPM, metaLabels = labels, strain = strain)

25 changes: 19 additions & 6 deletions scripts/R/DEA/GSE4136.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
#License

# © Copyright 2020 iGEM Concordia, Maher Hassanain, Benjamin Clark, Hajar Mouddene, Grecia Orlano
# This file is part of AstroBio.
# AstroBio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# AstroBio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstroBio. If not, see <https://www.gnu.org/licenses/>.

#GSE4136 YEAST MICROARRAY
#BENJAMIN CLARK
Expand All @@ -9,7 +22,7 @@ library(stats)
library(dendextend)
library(gplots)
source("microarray_functions.R")
#This pulls the all the samples from the microarry dataset. This returns a list containing a single expressionSet object.
#This pulls the all the samples from the microarry dataset. This returns a list containing a single expressionSet object.
list.gse <- getGEO("GSE4136", GSEMatrix =TRUE, AnnotGPL=TRUE)

gse <- list.gse[[1]]
Expand All @@ -28,7 +41,7 @@ control <- c(1,2,3)
treatment <- c(7,8,9)
gen5 <- de.analysis(gse = gse, microgravity_group = treatment, ground_group = control)

#print out the toptable
#print out the toptable
gen5name <- "datasets/GSE4136_Scer/GSE4136_5thGen.csv"
write.table(gen5$TopTable, gen5name, row.names = FALSE, sep = ",")

Expand Down Expand Up @@ -74,7 +87,7 @@ ex_genes_f <- readxl::read_xlsx("essential/TableS3_excludedStrains-hom.xlsx", sh

ex_genes <- union(ex_genes_f, ex_genes_g)

#Adding to Gen5 Study
#Adding to Gen5 Study
essential_bool5 <- c()

essential_bool5[match(full_names, gen5$TopTable$Gene.symbol)] <- TRUE
Expand Down Expand Up @@ -121,7 +134,7 @@ gen25.orfs <- gen25$TopTable$ID[gen25.sig.df.genes]

grouped.orfs <- union(gen5.orfs,gen25.orfs)

#pulling relevent expression data
#pulling relevent expression data
ex <- exprs(gse)
filtered.ex <- ex[rownames(ex) %in% grouped.orfs,]

Expand All @@ -147,8 +160,8 @@ hc <- as.dendrogram(hclust(as.dist(1-cor(t(filtered.ex), method="pearson")), met

#c.index <- which(labels(hc) %in% both)

hc %>% set("labels_col", "white") %>%
set("by_labels_branches_col", value = both) %>%
hc %>% set("labels_col", "white") %>%
set("by_labels_branches_col", value = both) %>%
plot(main = "Highlighted Union Genes Across Timescales")

#PLOTTING INTERSECTING Genes
Expand Down
58 changes: 36 additions & 22 deletions scripts/R/DEA/GSE50881.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#License

# © Copyright 2020 iGEM Concordia, Maher Hassanain, Benjamin Clark, Hajar Mouddene, Grecia Orlano
# This file is part of AstroBio.
# AstroBio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# AstroBio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstroBio. If not, see <https://www.gnu.org/licenses/>.

###GSE50881 YEAST MICROARRAY TWO CHANNEL
#BENJAMIN CLARK
#BENJAMIN CLARK

library(GEOquery)
library(Biobase)
Expand Down Expand Up @@ -28,17 +42,17 @@ fvarLabels(gse) <- make.names(fvarLabels(gse))

# design <- cbind(DyeEffect = 1,SpaceVsGround = c(1,-1,1,-1,1,-1,1,-1))
# #block <- fData(gse[,1])$Block
#
#
#
#
# fit <- lmFit(gse,design)
# fit <- eBayes(fit, 0.01)
#
#
# #topTable.dyes <- topTable(fit, coef = "DyeEffect")
#
#
# anno.data <- fData(gse)
#
#
# f.tT <- remove.candida.controls(topTable.SvsG)
#
#
# f.tT <- subset(f.tT, select = c("CGD_Systematic_Name", "Description", "SpaceVsGround", "AveExpr", "F", "P.Value", "adj.P.Val"))

topTable.SvsG <- topTable(fit, adjust.method = "fdr", sort.by = "B", number = length(fit[[1]]))
Expand All @@ -48,10 +62,10 @@ f.tT <- subset(f.tT, select = c("CGD_Systematic_Name", "Description", "SpaceVsGr



rowid <- c()
rowid <- c()
for(i in 1:length(f.tT$ID)){
rowid <- append(rowid,((f.tT %>% filter(SPOT_ID == f.tT$SPOT_ID[i]) %>% arrange(P.Value))[1,])$ID)

}

best.rows.ids <- rowid[-which(duplicated(rowid))]
Expand Down Expand Up @@ -81,9 +95,9 @@ go_ids <- read.csv("Candida_albicans_GO.csv")
ordered.gos <- list()
for(annos in 1:length(rm.ftT$CGD_Systematic_Name)){
indexes <- which(rm.ftT$CGD_Systematic_Name[annos] == go_ids$systemic_id)
ids <- go_ids$go_id[indexes]
ids <- go_ids$go_id[indexes]
ordered.gos[annos] <- list(ids)

}

anno.terms <- list()
Expand All @@ -96,24 +110,24 @@ for(i in 1:length(ordered.gos)){
GO.COMPONENT <- c()
if(length(ordered.gos[[i]]) == 0){
full.MF <- append(full.MF, NA)
full.CC <- append(full.CC, NA)
full.CC <- append(full.CC, NA)
full.BP <- append(full.BP, NA)
next
}
for(j in 1:length(ordered.gos[[i]])){

if(Ontology(ordered.gos[[i]][[j]]) == "MF"){
GO.FUNCTION <- append(GO.FUNCTION, Term(ordered.gos[[i]][[j]]))

}else if(Ontology(ordered.gos[[i]][[j]]) == "CC"){
GO.COMPONENT <- append(GO.COMPONENT, Term(ordered.gos[[i]][[j]]))

}
else if(Ontology(ordered.gos[[i]][[j]]) == "BP"){
GO.PROCESS <- append(GO.PROCESS, Term(ordered.gos[[i]][[j]]))

}

}
if(length(GO.FUNCTION) != 0){
full.MF <- append(full.MF, paste(GO.FUNCTION, collapse = "///"))}
Expand Down Expand Up @@ -145,15 +159,15 @@ names <- unlist(names)
Chromosome_Location <- stringr::str_extract_all(rm.ftT$Description, pattern = "(Contig\\d+:\\D+\\d+..\\d+\\)|Contig\\d+:\\d+..\\d+)")
Chromosome_Location <- sapply(Chromosome_Location, FUN = paste, collapse = "///", USE.NAMES = FALSE)

final.tT <- rm.ftT %>% mutate( GO.Function = full.MF, GO.Component = full.CC,
GO.Process = full.BP, Gene.Name = names,
Chromosome.Location = Chromosome_Location,
ID = NULL, SPOT_ID = NULL, Description = NULL) %>%
final.tT <- rm.ftT %>% mutate( GO.Function = full.MF, GO.Component = full.CC,
GO.Process = full.BP, Gene.Name = names,
Chromosome.Location = Chromosome_Location,
ID = NULL, SPOT_ID = NULL, Description = NULL) %>%
rename(LogFC = SpaceVsGround, Platform_ORF = CGD_Systematic_Name)


write.csv(final.tT, file = "datasets/GSE50881_Calb/GSE50881.csv")


extractMetaData(gse_groups = list(list(GSE = gse[,c(1,3,5,7)]), list(GSE = gse[,c(2,4,6,8)])), microgravity_type = M.TYPE$SPACEFLOWN,
extractMetaData(gse_groups = list(list(GSE = gse[,c(1,3,5,7)]), list(GSE = gse[,c(2,4,6,8)])), microgravity_type = M.TYPE$SPACEFLOWN,
filename = "datasets/GSE50881_Calb/GSE50881_meta", metaLabels = c("dye_swap1", "dye_swap2"), strain = "SC5413")
16 changes: 15 additions & 1 deletion scripts/R/DEA/GSE64468.R
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
#License

# © Copyright 2020 iGEM Concordia, Maher Hassanain, Benjamin Clark, Hajar Mouddene, Grecia Orlano
# This file is part of AstroBio.
# AstroBio is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or any later version.
# AstroBio is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with AstroBio. If not, see <https://www.gnu.org/licenses/>.

###GSE64468 YEAST MICROARRAY
#BENJAMIN CLARK
#BENJAMIN CLARK

library(GEOquery)
library(Biobase)
Expand Down
Loading

0 comments on commit 273c2b9

Please sign in to comment.