Skip to content

Commit

Permalink
Bug fix for blanks =2 in CoRe= TRUE as empty DF was returned and caus…
Browse files Browse the repository at this point in the history
…ed error in saving.
  • Loading branch information
ChristinaSchmidt1 committed Feb 19, 2025
1 parent 5ea4024 commit e9a15a2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
11 changes: 10 additions & 1 deletion R/Processing.R
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ PreProcessing <- function(InputData,
}

if(CoRe ==TRUE){
DFList_CoRe <- list( "CV_CoRe_blank"= data_CoReNorm[["DF"]][["CV_CoRe_blank"]],"Variation_ContigencyTable_CoRe_blank"=data_CoReNorm[["DF"]][["Contigency_table_CoRe_blank"]])
if(is.null(data_CoReNorm[["DF"]][["Contigency_table_CoRe_blank"]])){
DFList_CoRe <- list( "CV_CoRe_blank"= data_CoReNorm[["DF"]][["CV_CoRe_blank"]])
}else{
DFList_CoRe <- list( "CV_CoRe_blank"= data_CoReNorm[["DF"]][["CV_CoRe_blank"]],"Variation_ContigencyTable_CoRe_blank"=data_CoReNorm[["DF"]][["Contigency_table_CoRe_blank"]])
}
DFList <- c(DFList, DFList_CoRe)
}

Expand Down Expand Up @@ -1177,6 +1181,11 @@ CoReNorm <-function(InputData,
}
# Filter the CoRe_media samples
CoRe_medias <- CoRe_medias %>% dplyr::filter(!rownames(CoRe_medias) %in% different_samples)
}else{
message <- paste0("Only >=2 blank samples available. Thus,we can not perform outlier testing for the blank samples.")
logger::log_trace(message)
message(message)

}
CoRe_media_df <- as.data.frame(data.frame("CoRe_mediaMeans"= colMeans(CoRe_medias, na.rm = TRUE)))
}
Expand Down
6 changes: 3 additions & 3 deletions vignettes/CoRe Metabolomics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@ Media_Metadata <- Media%>%
PreProcessing_res <- MetaProViz::PreProcessing(InputData=Media_input,
SettingsFile_Sample =Media_Metadata,
SettingsInfo = c(Conditions = "Conditions",
Biological_Replicates = "Biological_Replicates",
CoRe_norm_factor = "GrowthFactor",
CoRe_media = "blank"),
Biological_Replicates = "Biological_Replicates",
CoRe_norm_factor = "GrowthFactor",
CoRe_media = "blank"),
FeatureFilt = "Modified",
FeatureFilt_Value = 0.8,
TIC = TRUE,# As we have raw data we will perform total ion count norm
Expand Down

0 comments on commit e9a15a2

Please sign in to comment.