Compare commits
7 Commits
b5323436ec
...
dev
| Author | SHA1 | Date | |
|---|---|---|---|
| 560540cf1a | |||
| bd52e8c452 | |||
| 43b807cc63 | |||
| cb38ea347d | |||
| 6671939939 | |||
| a6f0c97d47 | |||
| 56484a5903 |
+36
-13
@@ -88,6 +88,7 @@ ui <- fluidPage(
|
|||||||
tabsetPanel(
|
tabsetPanel(
|
||||||
tabPanel("Entrada",
|
tabPanel("Entrada",
|
||||||
actionButton("goButtonDir","Selecciona directorio fenotipo"),
|
actionButton("goButtonDir","Selecciona directorio fenotipo"),
|
||||||
|
textInput("cytopath", label="Directorio fenotipo", value=""),
|
||||||
textOutput("session"),
|
textOutput("session"),
|
||||||
hr(),
|
hr(),
|
||||||
actionButton("fcsconvert", "Convertir a fcs"),
|
actionButton("fcsconvert", "Convertir a fcs"),
|
||||||
@@ -143,24 +144,28 @@ server <- function(input, output) {
|
|||||||
print(CCfile)
|
print(CCfile)
|
||||||
if (input$dbtype == "UM"){
|
if (input$dbtype == "UM"){
|
||||||
dta<<-odbcConnectAccess2007(access.file = UMfile,
|
dta<<-odbcConnectAccess2007(access.file = UMfile,
|
||||||
pwd = .rs.askForPassword("Enter password:"))
|
pwd = getPass::getPass("Enter password:"))
|
||||||
}
|
}
|
||||||
if (input$dbtype == "OV"){
|
if (input$dbtype == "OV"){
|
||||||
dta<<-odbcConnectAccess2007(access.file = OVfile,
|
dta<<-odbcConnectAccess2007(access.file = OVfile,
|
||||||
pwd = .rs.askForPassword("Enter password:"))
|
pwd = getPass::getPass("Enter password:"))
|
||||||
}
|
}
|
||||||
if (input$dbtype == "CC"){
|
if (input$dbtype == "CC"){
|
||||||
dta<<-odbcConnectAccess2007(access.file = CCfile,
|
dta<<-odbcConnectAccess2007(access.file = CCfile,
|
||||||
pwd = .rs.askForPassword("Enter password:"))
|
pwd = getPass::getPass("Enter password:"))
|
||||||
}
|
}
|
||||||
print(dta)
|
print(dta)
|
||||||
if (input$backup == T){
|
if (input$backup == T){
|
||||||
if (! input$dbtype %in% c("UM","OV")){
|
if (! input$dbtype %in% c("UM","OV")){
|
||||||
sqlBackUp(bu.dir="CC_BU")
|
sqlBackUp(dbfile = CCfile, bu.dir="CC_BU")
|
||||||
}else{
|
|
||||||
sqlBackUp()
|
|
||||||
}
|
}
|
||||||
|
if (input$dbtype == "UM"){
|
||||||
|
sqlBackUp(dbfile = UMfile)
|
||||||
|
}
|
||||||
|
if (input$dbtype == "OV"){
|
||||||
|
sqlBackUp(dbfile = OVfile)
|
||||||
|
}
|
||||||
|
print("Back up realizado.")
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -379,7 +384,7 @@ server <- function(input, output) {
|
|||||||
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "samples"=new.samp) %>% merge(sqlFetch(dta,"OVID"), all.x=T) %>% arrange(samples)
|
new.samp.df<-data.frame("NHC"=values[["DF"]]$NHC, "samples"=new.samp) %>% merge(sqlFetch(dta,"OVID"), all.x=T) %>% arrange(samples)
|
||||||
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(samples)
|
samples.exp<-merge(samples %>% slice(0), new.samp.df %>% select(-NHC), all=T) %>% select(colnames(samples)) %>% arrange(samples)
|
||||||
if (today==TRUE){
|
if (today==TRUE){
|
||||||
samples.exp$IQ_date<-format(Sys.Date(), "%d/%m/%y")
|
samples.exp$Date_extraction<-format(Sys.Date(), "%d/%m/%y")
|
||||||
}
|
}
|
||||||
|
|
||||||
nhc.table<-values[["DF"]]
|
nhc.table<-values[["DF"]]
|
||||||
@@ -753,6 +758,7 @@ server <- function(input, output) {
|
|||||||
sqlFetch(dta, "NITROGEN"),
|
sqlFetch(dta, "NITROGEN"),
|
||||||
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","UM-Nitrogen.xlsx")
|
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","UM-Nitrogen.xlsx")
|
||||||
)
|
)
|
||||||
|
print("Backup Creado.")
|
||||||
|
|
||||||
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
|
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
|
||||||
|
|
||||||
@@ -783,6 +789,7 @@ server <- function(input, output) {
|
|||||||
|
|
||||||
sqlDrop(dta, "NITROGEN")
|
sqlDrop(dta, "NITROGEN")
|
||||||
sqlSave(dta, table.um %>% select(-FECHA) %>% filter(!is.na(CODIGO)), tablename="NITROGEN", rownames=F)
|
sqlSave(dta, table.um %>% select(-FECHA) %>% filter(!is.na(CODIGO)), tablename="NITROGEN", rownames=F)
|
||||||
|
print("Tabla Actualizada.")
|
||||||
}
|
}
|
||||||
if (input$dbtype == "OV"){
|
if (input$dbtype == "OV"){
|
||||||
## Copia de backup
|
## Copia de backup
|
||||||
@@ -796,6 +803,7 @@ server <- function(input, output) {
|
|||||||
sqlFetch(dta, "NITROGEN"),
|
sqlFetch(dta, "NITROGEN"),
|
||||||
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","OV-Nitrogen.xlsx")
|
file=paste0(NitroRoute, format(Sys.time(), format="%Y%m%d"),"-","OV-Nitrogen.xlsx")
|
||||||
)
|
)
|
||||||
|
print("Backup Creado.")
|
||||||
|
|
||||||
## Lectura del excel
|
## Lectura del excel
|
||||||
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
|
table<-read.xlsx(paste0(gsub("/BU_NITRO/", "", NitroRoute),"/Nitrogen_ICO.xlsx"))
|
||||||
@@ -821,6 +829,7 @@ server <- function(input, output) {
|
|||||||
|
|
||||||
sqlDrop(dta, "NITROGEN")
|
sqlDrop(dta, "NITROGEN")
|
||||||
sqlSave(dta, table.ov, tablename="NITROGEN", rownames=F)
|
sqlSave(dta, table.ov, tablename="NITROGEN", rownames=F)
|
||||||
|
print("Tabla Actualizada.")
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
@@ -923,9 +932,14 @@ server <- function(input, output) {
|
|||||||
|
|
||||||
pops<-sqlFetch(dta, "POPULATIONS")
|
pops<-sqlFetch(dta, "POPULATIONS")
|
||||||
|
|
||||||
g_pop<-pops %>% dplyr::filter(samples == input$id) %>% gather(pop,value,-samples) %>%
|
g_pop<-pops %>%
|
||||||
mutate(pop=factor(pop, levels=c("CD45pos_Alive","T_cells","CD8","CD4","DN","NK", "B_cells",
|
dplyr::filter(sample == input$id) %>%
|
||||||
"CD45neg_LDneg","EpCAMneg_HLAIneg","EpCAMneg_HLAIpos","EpCAMpos_HLAIpos"))) %>%
|
gather(pop,value,-sample, -code, -fc_time) %>%
|
||||||
|
# mutate(pop=factor(pop, levels=c("CD45pos_Alive","T_cells","CD8","CD4","DN","NK", "B_cells",
|
||||||
|
# "CD45neg_LDneg","EpCAMneg_HLAIneg","EpCAMneg_HLAIpos","EpCAMpos_HLAIpos"))) %>%
|
||||||
|
# mutate(pop=factor(pop, levels=c("CD45pos_Alive","T_cells","CD8","CD4","DN","NK", "B_cells",
|
||||||
|
# "CD45neg_LDneg","EpCAMneg_HLAIneg","EpCAMneg_HLAIpos","EpCAMpos_HLAIpos"))) %>%
|
||||||
|
mutate(value=as.numeric(gsub(",",".",value))) %>%
|
||||||
ggplot(aes(pop, value))+
|
ggplot(aes(pop, value))+
|
||||||
geom_bar(stat="identity", color="black", fill="grey70")+
|
geom_bar(stat="identity", color="black", fill="grey70")+
|
||||||
labs(title = input$id, y="% parent", x="")+
|
labs(title = input$id, y="% parent", x="")+
|
||||||
@@ -969,7 +983,11 @@ server <- function(input, output) {
|
|||||||
|
|
||||||
observe({
|
observe({
|
||||||
if(input$goButtonDir > 0){
|
if(input$goButtonDir > 0){
|
||||||
cito_dir<<-choose.dir() %>% gsub("\\","/",. ,fixed=T) %>% paste0("/")
|
if (input$cytopath == ""){
|
||||||
|
cito_dir<<-choose.dir() %>% gsub("\\","/",. ,fixed=T) %>% paste0("/")
|
||||||
|
}else{
|
||||||
|
cito_dir<<-input$cytopath %>% gsub("\\","/",. ,fixed=T) %>% gsub("/$", "", .) %>% paste0("/")
|
||||||
|
}
|
||||||
|
|
||||||
output$session <- renderText(
|
output$session <- renderText(
|
||||||
cito_dir
|
cito_dir
|
||||||
@@ -1008,7 +1026,7 @@ server <- function(input, output) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (input$phenotype == "IC"){
|
if (input$phenotype == "IC"){
|
||||||
route<-cito_dir
|
route<-stringi::stri_enc_tonative(cito_dir)
|
||||||
|
|
||||||
ws<-open_flowjo_xml(paste0(route,"IC.wsp"))
|
ws<-open_flowjo_xml(paste0(route,"IC.wsp"))
|
||||||
gs<-flowjo_to_gatingset(ws, name="All Samples")
|
gs<-flowjo_to_gatingset(ws, name="All Samples")
|
||||||
@@ -1169,6 +1187,11 @@ server <- function(input, output) {
|
|||||||
# plot.margin = margin(-200,0,0,0),
|
# plot.margin = margin(-200,0,0,0),
|
||||||
axis.text = element_blank())
|
axis.text = element_blank())
|
||||||
|
|
||||||
|
nodes<-gs_get_pop_paths(gs)
|
||||||
|
nodes_parent<-nodes[!grepl("CTLA4|LAG3|PD1|TIGIT|TIM3|root$", nodes)]
|
||||||
|
nodes_cd4<-nodes[grepl("CTLA4$|LAG3$|PD1$|TIGIT$|TIM3$", nodes) & grepl("/CD4/",nodes)]
|
||||||
|
nodes_cd8<-nodes[grepl("CTLA4$|LAG3$|PD1$|TIGIT$|TIM3$", nodes) & grepl("/CD8/",nodes)]
|
||||||
|
|
||||||
# g1<-ggcyto_arrange(autoplot(gs[[ab]], nodes_parent, bins=128), nrow=1)
|
# g1<-ggcyto_arrange(autoplot(gs[[ab]], nodes_parent, bins=128), nrow=1)
|
||||||
# g2<-ggcyto_arrange(autoplot(gs[[iso]], nodes_cd8, bins=64), nrow=1)
|
# g2<-ggcyto_arrange(autoplot(gs[[iso]], nodes_cd8, bins=64), nrow=1)
|
||||||
# g3<-ggcyto_arrange(autoplot(gs[[ab]], nodes_cd8, bins=64), nrow=1)
|
# g3<-ggcyto_arrange(autoplot(gs[[ab]], nodes_cd8, bins=64), nrow=1)
|
||||||
|
|||||||
Reference in New Issue
Block a user