Skip to content
Snippets Groups Projects
Commit 6ac82225 authored by Thomas  OBADIA's avatar Thomas OBADIA
Browse files

Force reading Excel MFI input as text columns for to prevent bugs with...

Force reading Excel MFI input as text columns for to prevent bugs with pivot_long() use mixing together sample/antigen names (character) and MFI values (numbers).
parent 12dbda4a
No related branches found
No related tags found
No related merge requests found
...@@ -136,7 +136,7 @@ runRelativeAntibodyUnits = function(fname1, fname2, MFI_CSV, MFI_N_ANTIGENS, TEM ...@@ -136,7 +136,7 @@ runRelativeAntibodyUnits = function(fname1, fname2, MFI_CSV, MFI_N_ANTIGENS, TEM
endcount_row_number <- which(L_full$xPONENT == "Avg Net MFI") endcount_row_number <- which(L_full$xPONENT == "Avg Net MFI")
# Load Excel file # Load Excel file
L <- as.data.frame(read_excel(fname1, skip = median_row_number+1)) L <- as.data.frame(read_excel(fname1, skip = median_row_number+1, col_types = "text"))
## Find all blank rows (i.e. rows that are all NA). ## Find all blank rows (i.e. rows that are all NA).
## Then keep rows preceding the first blank row. ## Then keep rows preceding the first blank row.
...@@ -165,7 +165,7 @@ runRelativeAntibodyUnits = function(fname1, fname2, MFI_CSV, MFI_N_ANTIGENS, TEM ...@@ -165,7 +165,7 @@ runRelativeAntibodyUnits = function(fname1, fname2, MFI_CSV, MFI_N_ANTIGENS, TEM
# MFI values as numeric # MFI values as numeric
L[,-which(colnames(L) %in% c("Location","Sample","Total Events","TotalEvents"))] = lapply(L[,-which(colnames(L) %in% c("Location","Sample","Total Events"))], as.numeric) L[,-which(colnames(L) %in% c("Location","Sample","Total Events","TotalEvents"))] = lapply(L[,-which(colnames(L) %in% c("Location","Sample","Total Events"))], as.numeric)
C <- as.data.frame(read_excel(fname1, skip = count_row_number+1)) C <- as.data.frame(read_excel(fname1, skip = count_row_number+1, col_types = "text"))
## Find all blank rows (i.e. rows that are all NA). ## Find all blank rows (i.e. rows that are all NA).
## Then keep rows preceding the first blank row. ## Then keep rows preceding the first blank row.
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment