I have a set of files based on which I expect to load RDS files like R1-Tn5-NHP-55_NA and R1-Tn5-NHP-42_NA but the code is producing just the name of the 55 files not both 55 and 42.
#standardize N set names
rename_KP_set <- function(sample_name_vector) {
new_sample_name_vector <- apply(sample_name_vector,
function(x){
if (grepl("42",x[3])){
c(x[1:3],'55',x[5])
} else if (grepl("55",x[3])) {
c(x[1:3],'NHP',x[5])
} else if (grepl("55",x[3])){
c(x[1:3],'NHP',x[5])
} else
c(x[1:3],'55',x[5])
}
}) %>%
sapply(paste, collapse='-')
return(new_sample_name_vector)
}
How I can get separate rds files having 42 and 55 numbers or for that matter any rds with some number attached to them?
I have already posted this question on Stack overflow on February 27th, 2023 but have got no answers so I am reposting that in Stack exchange bioinformatics in search of an answer. Any help on this issue will be considered useful.