diff --git a/tools/w4mconcatenate/.shed.yml b/tools/w4mconcatenate/.shed.yml new file mode 100644 index 000000000..fa563f4f4 --- /dev/null +++ b/tools/w4mconcatenate/.shed.yml @@ -0,0 +1,9 @@ +categories: [Metabolomics] +description: '[W4M][Utils] concatenate two Metadata tables' +homepage_url: http://workflow4metabolomics.org +long_description: 'Part of the W4M project: http://workflow4metabolomics.org / The + R script concatenates two metadata file (sample metadata or + variable metadata) and returns a metadata file and two data matrix files.' +name: w4mconcatenate +owner: workflow4metabolomics +remote_repository_url: https://github.com/workflow4metabolomics/tools-metabolomics \ No newline at end of file diff --git a/tools/w4mconcatenate/README.md b/tools/w4mconcatenate/README.md new file mode 100644 index 000000000..8a3ddaf62 --- /dev/null +++ b/tools/w4mconcatenate/README.md @@ -0,0 +1,55 @@ +# W4M concatenate + + +Metadata +----------- + + * **@name**: W4M concatenate + * **@galaxyID**: W4Mconcatenate + * **@version**: 1.0.0 + * **@authors**: Original code: Hanane Nourine (Intern - PFEM - INRAE) - Maintainer: Melanie Petera (PFEM - INRAE - MetaboHUB) + * **@init date**: 2024, May + * **@main usage**: This tool enables the concatenation of two matrices of Metadata and returns a matrix of Metadata and two DataMatrix + + +Context +----------- + +This tool is provided as one of the [Workflow4Metabolomics](http://workflow4metabolomics.org) Galaxy instance data handling tools. +W4M is an international infrastructure providing software tools to process, analyse and annotate metabolomics data. + +User interface is based on the Galaxy platform (homepage: https://galaxyproject.org/). It is an open, web-based platform for data intensive biomedical research. +Whether on the free public server or your own instance, you can perform, reproduce, and share complete analyses. + +The tool was created as part of a Master's level internship. + +Configuration +----------- + +### Requirement: + * R software: version = 4.3.3 recommended + * r-dplyr = 1.1.4 + * r-w4mrutils = 1.0.0 + +Technical description +----------- + +Main files: + +- concatenation.R: R function (core script) +- fonctions_auxiliaires.R : R auxiliary functions. +- concatenation_wrapper.R: R script to link the main R function to inputs +- concat.xml: XML wrapper (interface for Galaxy) + + +Services provided +----------- + + * Help and support: https://community.france-bioinformatique.fr/c/workflow4metabolomics/10 + + + +License +----------- + + * Cea Cnrs Inria Logiciel Libre License, version 2.1 (CECILL-2.1) diff --git a/tools/w4mconcatenate/concat.xml b/tools/w4mconcatenate/concat.xml new file mode 100644 index 000000000..aa74348dd --- /dev/null +++ b/tools/w4mconcatenate/concat.xml @@ -0,0 +1,261 @@ + + to merge two metadata tables + + r-base + r-dplyr + r-w4mrutils + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 10.1093/bioinformatics/btu813 + + + + + + + + + + \ No newline at end of file diff --git a/tools/w4mconcatenate/concatenation.R b/tools/w4mconcatenate/concatenation.R new file mode 100644 index 000000000..013e5e38e --- /dev/null +++ b/tools/w4mconcatenate/concatenation.R @@ -0,0 +1,352 @@ +if (FALSE) { + rm(list = ls()) + + DM1 <- data.frame(data = c("5d_-kkcùf", "npèt", "5PY4(*3"), + `j 785` = c(0.356426723610756, 0.801750949101246, 0.875199970420953), + `y54j 68y4j6` = c(0.380152310071702, 0.535593104115636, 0.0825428101366147), + `5-6 4` = c(0.0306944207412024, 0.258351312473067, 0.253659010703906), + hrrrrh = c(0.334137638848017, 0.599475573145688, 0.507762246807195), + `5h -` = c(0.298147485608469, 0.0763319665667417, 0.856444177031262)) + + DM2 <- data.frame(data = c("5d_-kkcùf", "npèt", "5PY4(*3"), + `j 785` = c(0.356426723610756, 0.801750949101246, 0.875199970420953), + `y54j 68y4j6` = c(0.380152310071702, 0.535593104115636, 0.0825428101366147), + `5-6 4` = c(0.0306944207412024, 0.258351312473067, 0.253659010703906), + hrrrrh = c(0.334137638848017, 0.599475573145688, 0.507762246807195), + `5h -` = c(0.298147485608469, 0.0763319665667417, 0.856444177031262)) + + M1 <- data.frame(samplename = c("j 785", "y54j 68y4j6", "5-6 4", "hrrrrh", "5h -"), + ABD = c(19, 24, 2, 3, "y"), E = c(9, "p0", 45, 24, 29), + AAA = c("r", "bg", "il", "d", "b"), + fp = c("pj", "z", "e", "r", "t"), + uv = c("s", "d", "f", "s", "d")) + + M2 <- data.frame(samplename = c("j 785", "y54j 68y4j6", "5-6 4", "hrrrrh", "5h -"), + ABD = c(19, 24, 2, 3, "y"), E = c(9, "ici", 45, 24, 29), + AAA = c("r", "bg", "il", "d", "b"), + fp = c("pj", "z", "e", "r", "t"), + uv = c("s", "d", "f", "s", "d")) + type <- "sample" + concatenation <- "unique" + tab1 <- "tab1" + tab2 <- "tab2" + choice_keep <- "oui" + keep <- 0 + concat(DM1, M1, DM2, M2, type, tab1, tab2, concatenation, choice_keep, keep) +} + +################################################################################################################# + + +concat <- function(DM1, M1, DM2, M2, type, tab1, tab2, concatenation, choice_keep, keep) { + + + + #DM1/DM2 = data.frame containing data Matrix + #M1/M2 = data.frame containing sample Metadata or variable Metadata + #type = "sample" or "variable" depending on Metadata content + #tab1/tab2 = Suffix for Metadata 1/2 + #concatenation = type of concatenation + #choice_keep = choice of keeping columns with the same no or keeping just one + #keep = keep the column in M1 or M2 + #returns the concatenated metadata and the two Data Matrix + + identifiers_1 <- colnames(M1)[1] + identifiers_2 <- colnames(M2)[1] + + err.stock <- NULL + + #Concatenation------------------------------------------------------------------ + + #If Metadatas is Sample_Metadata we transpose + if (type == "sample") { + + rownames(DM1) <- DM1[, 1] + corner_DM1 <- colnames(DM1)[1] + DM1 <- DM1[, -1, drop = FALSE] + DM1 <- t(DM1) + DM1 <- data.frame(sample = row.names(DM1), DM1, check.names = FALSE) + rownames(DM1) <- NULL + + rownames(DM2) <- DM2[, 1] + corner_DM2 <- colnames(DM2)[1] + DM2 <- DM2[, -1, drop = FALSE] + DM2 <- t(DM2) + DM2 <- data.frame(sample = row.names(DM2), DM2, check.names = FALSE) + rownames(DM2) <- NULL + } + + #Add order of sample and Sort by order + + + M1$order1 <- seq(1, nrow(M1)) + M2$order2 <- seq(nrow(M1) + 1, nrow(M2) + nrow(M1)) + + M1_bf <- M1[order(M1[, 1]), ] + M2_bf <- M2[order(M2[, 1]), ] + + + #Check the variables in common and extract them. + + + same <- check_features(M1_bf, M2_bf) + same <- same[- which(same == identifiers_1)] + + #Check that shared variables have the same values. + #If not, they are renamed or deleted according to the parameters chosen by the user. + result2 <- compare_same_columns(M1_bf, M2_bf, same, choice_keep, keep, tab1, tab2) + M1 <- result2$M1 + M2 <- result2$M2 + + #Unique-------------------------------------------------------------------------- + if (concatenation == "unique") { + #Table match check + #We verify that the individuals are all the same + err.stock <- match2_bis(M1, M2, type) + check_err(err.stock) + M_merge <- merge(M1, M2, by = 1) + } + + + #Intersection-------------------------------------------------------------------- + + if (concatenation == "intersection") { + + #select individuals in common + sample_common <- intersect(M1[, 1], M2[, 1]) + + #if the list of individuals in common is null, an error message is sent + if (length(sample_common) == 0) { + err.stock <- c(err.stock, "\nThere are no individuals in common \n") + check_err(err.stock) + } + #if the list of individuals in common is less than 5, then a Warning message is sent + if (length(sample_common) < 5) { + cat("\nWarning: Less than 5 individuals in common\n") + } + M_merge <- merge(M1, M2, by = 1) + } + + #Union -------------------------------------------------------------------------- + if (concatenation == "union") { + + #select common ids + id_common <- intersect(M1[, 1], M2[, 1]) + + if (is.null(id_common)) { + cat("\nT Warning : there are no individuals in common\n") + } + + M2_common <- M2[M2[, 1] %in% id_common, ] + #Store rows with individuals belonging only to M2 + M2_specifique <- M2[! M2[, 1] %in% id_common, ] + #Merge the two tables only with the samples not in common + M_merge <- bind_rows(M1, M2_specifique) + col_names <- colnames(M2_common) + col_names <- col_names[- which(col_names == identifiers_2)] + feature_common <- check_features(M_merge, M2_bf) + #Check if M_merge and M2_bf have columns in common. If so, complete the table with the values not taken. + if (!is.null(feature_common)) { + + identifiers_3 <- M2_specifique[, 1] + #We select the value in M2_bf, the M2 table before undergoing any changes, then insert it in the M_merge table. + for (feature in feature_common) { + for (id in identifiers_3) { + + index_row <- which(M2_bf[, 1] == id) + index_col <- which(colnames(M2_bf) == feature) + new_value <- M2_bf[index_row, index_col] + index_row <- which(M_merge[, 1] == id) + index_col <- which(colnames(M_merge) == feature) + M_merge[index_row, index_col] <- new_value + + } + } + } + #Fill in the table with common values + for (col in col_names) { + for (id in id_common) { + index_row <- which(M2_common[, 1] == id) + index_col <- which(colnames(M2_common) == col) + new_value <- M2_common[index_row, index_col] + index_row <- which(M_merge[, 1] == id) + index_col <- which(colnames(M_merge) == col) + M_merge[index_row, index_col] <- new_value + + } + } + } + M_merge_sort <- M_merge[order(M_merge$order1, M_merge$order2), ] + M_merge_sort <- M_merge_sort[, - which(colnames(M_merge_sort) == "order1")] + M_merge_sort <- M_merge_sort[, - which(colnames(M_merge_sort) == "order2")] + #DataMatrix --------------------------------------------------------------------- + + colnames_1 <- colnames(DM1) + colnames_2 <- colnames(DM2) + #Unique ------------------------------------------------------------------------- + + if (concatenation == "unique") { + + if (type == "sample") { + + rownames(DM1) <- DM1[, 1] + DM1 <- DM1[, -1] + DM1 <- t(DM1) + DM1 <- data.frame(sample = row.names(DM1), DM1, check.names = FALSE) + colnames(DM1)[1] <- corner_DM1 + rownames(DM1) <- NULL + + rownames(DM2) <- DM2[, 1] + DM2 <- DM2[, -1, drop = FALSE] + DM2 <- t(DM2) + DM2 <- data.frame(sample = row.names(DM2), DM2, check.names = FALSE) + colnames(DM2)[1] <- corner_DM2 + rownames(DM2) <- NULL + } + result <- list(M_merge_sort = M_merge_sort, DM1 = DM1, DM2 = DM2) + return(result) + } + + #Intersection-------------------------------------------------------------------- + + if (concatenation == "intersection") { + + id_in_common <- intersect(DM1[, 1], DM2[, 1]) + + DM1_filter <- subset(DM1, DM1[, 1] %in% id_in_common) + DM2_filter <- subset(DM2, DM2[, 1] %in% id_in_common) + + if (type == "sample") { + + rownames(DM1_filter) <- DM1_filter[, 1] + DM1_filter <- DM1_filter[, -1] + DM1_filter <- t(DM1_filter) + DM1_filter <- data.frame(sample = row.names(DM1_filter), DM1_filter, check.names = FALSE) + colnames(DM1_filter)[1] <- corner_DM1 + rownames(DM1_filter) <- NULL + + rownames(DM2_filter) <- DM2_filter[, 1] + DM2_filter <- DM2_filter[, -1, drop = FALSE] + DM2_filter <- t(DM2_filter) + DM2_filter <- data.frame(sample = row.names(DM2_filter), DM2_filter, check.names = FALSE) + colnames(DM2_filter)[1] <- corner_DM2 + rownames(DM2_filter) <- NULL + } + result <- list(M_merge_sort = M_merge_sort, DM1 = DM1_filter, DM2 = DM2_filter) + return(result) + } + + #Union -------------------------------------------------------------------------- + + if (concatenation == "union") { + + common_individuals <- intersect(DM1[, 1], DM2[, 1]) + common_columns <- intersect(colnames_1, colnames_2) + #check whether there are individuals or variables in common + if (is.null(common_individuals) || is.null(common_columns)) { + + comparison_result <- FALSE + #If the individuals in common take the same values for all variables, then comparison_result=TRUE + } else { + + DM1_common <- subset(DM1, DM1[, 1] %in% common_individuals) + DM2_common <- subset(DM2, DM2[, 1] %in% common_individuals) + DM1_common <- DM1_common[, common_columns, drop = FALSE] + DM2_common <- DM2_common[, common_columns, drop = FALSE] + + for (col in common_columns) { + comparison_result <- identical(DM1_common$col, DM2_common$col) + } + + } + + if (comparison_result) { + + + DM1$order1 <- seq(1, nrow(DM1)) + DM2$order2 <- seq(nrow(DM1) + 1, nrow(DM2) + nrow(DM1)) + DM1_sort <- DM1[order(DM1[, 1]), ] + DM2_sort <- DM2[order(DM2[, 1]), ] + id_in_common <- intersect(DM1[, 1], DM2[, 1]) + DM1_filter <- subset(DM1, DM1[, 1] %in% id_in_common) + DM2_filter <- subset(DM2, DM2[, 1] %in% id_in_common) + different_DM2 <- colnames_2[! colnames_2 %in% colnames_1] + DM2_specifique <- DM2[! DM2[, 1] %in% id_in_common, ] + #Merge the two tables only with the samples not in common + DM1_merge <- bind_rows(DM1, DM2_specifique) + + + #Deletion of columns present only in DM2 + DM1_merge <- DM1_merge[, ! names(DM1_merge) %in% different_DM2] + different_DM1 <- colnames_1[! colnames_1 %in% colnames_2] + DM1_specifique <- DM1[! DM1[, 1] %in% id_in_common, ] + #Merge the two tables only with the samples not in common + DM2_merge <- bind_rows(DM2, DM1_specifique) + #Deletion of columns present only in DM2 + DM2_merge <- DM2_merge[, ! names(DM2_merge) %in% different_DM1] + #DM2_merge + + + DM1_merge_sort <- DM1_merge[order(DM1_merge$order1, DM1_merge$order2), ] + DM1_merge_sort <- DM1_merge_sort[, - which(colnames(DM1_merge_sort) == "order1")] + DM1_merge_sort <- DM1_merge_sort[, - which(colnames(DM1_merge_sort) == "order2")] + + DM2_merge_sort <- DM2_merge[order(DM2_merge$order1, DM2_merge$order2), ] + DM2_merge_sort <- DM2_merge_sort[, - which(colnames(DM2_merge_sort) == "order1")] + DM2_merge_sort <- DM2_merge_sort[, - which(colnames(DM2_merge_sort) == "order2")] + + + if (type == "sample") { + + rownames(DM1_merge_sort) <- DM1_merge_sort[, 1] + DM1_merge_sort <- DM1_merge_sort[, -1] + DM1_merge_sort <- t(DM1_merge_sort) + DM1_merge_sort <- data.frame(sample = row.names(DM1_merge_sort), DM1_merge_sort, check.names = FALSE) + colnames(DM1_merge_sort)[1] <- corner_DM1 + rownames(DM1_merge_sort) <- NULL + + rownames(DM2_merge_sort) <- DM2_merge_sort[, 1] + DM2_merge_sort <- DM2_merge_sort[, -1, drop = FALSE] + DM2_merge_sort <- t(DM2_merge_sort) + DM2_merge_sort <- data.frame(sample = row.names(DM2_merge_sort), DM2_merge_sort, check.names = FALSE) + colnames(DM2_merge_sort)[1] <- corner_DM2 + rownames(DM2_merge_sort) <- NULL + } + + result <- list(M_merge_sort = M_merge_sort, DM1 = DM1_merge_sort, DM2 = DM2_merge_sort) + return(result) + + } else { + #selects line ids that are in DM2 and not in DM1 + id_diff_1 <- setdiff(DM2[, 1], DM1[, 1]) + #we store them in a dataframe + row_add_1 <- data.frame(id = id_diff_1) + #renames columns with their names in DM1 + colnames(row_add_1)[1] <- colnames(DM1)[1] + #Merge + DM1_add <- bind_rows(DM1, row_add_1) + id_diff_2 <- setdiff(DM1[, 1], DM2[, 1]) + row_add_2 <- data.frame(id = id_diff_2) + colnames(row_add_2)[1] <- colnames(DM2)[1] + DM2_add <- bind_rows(DM2, row_add_2) + + if (type == "sample") { + rownames(DM1_add) <- DM1_add[, 1] + DM1_add <- DM1_add[, -1] + DM1_add <- t(DM1_add) + DM1_add <- data.frame(sample = row.names(DM1_add), DM1_add, check.names = FALSE) + colnames(DM1_add)[1] <- corner_DM1 + rownames(DM1_add) <- NULL + rownames(DM2_add) <- DM2_add[, 1] + DM2_add <- DM2_add[, -1, drop = FALSE] + DM2_add <- t(DM2_add) + DM2_add <- data.frame(sample = row.names(DM2_add), DM2_add, check.names = FALSE) + colnames(DM2_add)[1] <- corner_DM2 + rownames(DM2_add) <- NULL + } + result <- list(M_merge_sort = M_merge_sort, DM1 = DM1_add, DM2 = DM2_add) + return(result) + + } + } +} diff --git a/tools/w4mconcatenate/concatenation_wrapper.R b/tools/w4mconcatenate/concatenation_wrapper.R new file mode 100644 index 000000000..98d3c673a --- /dev/null +++ b/tools/w4mconcatenate/concatenation_wrapper.R @@ -0,0 +1,44 @@ +rm(list = ls()) +#Chargement des library et des ressources + +library("W4MRUtils") +library(dplyr) + + +source_local("concatenation.R") +source_local("fonctions_auxiliaires.R") + + +para <- W4MRUtils::parse_args(args = commandArgs()) + + +cat("\nJob starting time:\n", format(Sys.time(), "%a %d %b %Y %X"), + "\n\n--------------------------------------------------------------------", + "\nParameters used by the 'W4M concatenate' tool:\n\n") +print(para) +cat("--------------------------------------------------------------------\n\n") + + +#Lancement de l'outil + +A <- W4MRUtils::import2(para$dataMatrix_1, para$metadata_1, para$type, disable_comm = FALSE) +B <- W4MRUtils::import2(para$dataMatrix_2, para$metadata_2, para$type, disable_comm = FALSE) + +DM1 <- A$dataMatrix +M1 <- A$metadata + +DM2 <- B$dataMatrix +M2 <- B$metadata + + +result_tables <- concat(DM1, M1, DM2, M2, para$type, para$tab1, para$tab2, para$concatenation, para$choice_keep, para$keep) + +write.table(result_tables[[1]], file = para$metadata_out, sep = "\t", row.names = FALSE, quote = FALSE) +write.table(result_tables[[2]], file = para$dataMatrix_1_out, sep = "\t", row.names = FALSE, quote = FALSE) +write.table(result_tables[[3]], file = para$dataMatrix_2_out, sep = "\t", row.names = FALSE, quote = FALSE) + +cat("\n--------------------------------------------------------------------", + "\nInformation about R (version, Operating System, attached or loaded packages):\n\n") +sessionInfo() +cat("--------------------------------------------------------------------\n", + "\nJob ending time:\n", format(Sys.time(), "%a %d %b %Y %X")) diff --git a/tools/w4mconcatenate/fonctions_auxiliaires.R b/tools/w4mconcatenate/fonctions_auxiliaires.R new file mode 100644 index 000000000..c3a4139a7 --- /dev/null +++ b/tools/w4mconcatenate/fonctions_auxiliaires.R @@ -0,0 +1,158 @@ +#-------------------------------------------------------------------------------------------------------------------------------------------------------------- +check_features <- function(M1, M2) { + #M1/M2 = data.frame containing sampleMetadata or variableMetadata + #check the variables in the 2 matrices . + #returns the names of the columns in the two metadata + + colnames_1 <- colnames(M1) + colnames_2 <- colnames(M2) + samecolumns <- intersect(colnames_1, colnames_2) + + if (is.null(samecolumns)) { + cat("\nWarning: There are no features in common \n") + } + + return(samecolumns) +} + +#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +compare_same_columns <- function(M1, M2, same, choice_keep, Keep, tab1, tab2) { + + #M1/M2 = data.frame containing sampleMetadata or variableMetadata + #same = list of column names with the same name in M1 and M2 + #choice_keep = choice of keeping columns with the same no or keeping just one + #keep = keep the column in M1 or M2 + #tab1/tab2 = Suffix for Metadata 1/2 + + #Check that the variables in the 2 matrices have the same values and + #If not, they are renamed or deleted according to the parameters chosen by the user. + #returns the two modified metadata + + compare_results <- list() + non_identical_columns_v <- c() + + + #Creation of 2 sub-tables with shared individuals and variables + common_individuals <- intersect(M1[, 1], M2[, 1]) + common_columns <- intersect(colnames(M1), colnames(M2)) + + M1_common <- subset(M1, M1[, 1] %in% common_individuals) + M2_common <- subset(M2, M2[, 1] %in% common_individuals) + + + M1_common <- M1_common[, common_columns] + M2_common <- M2_common[, common_columns] + + + + common_columns <- common_columns[-1]# delete id column + + + for (col_name in common_columns) { + #Check that the columns are identical, then delete them from M2 + if (!identical(M1_common[[col_name]], M2_common[[col_name]])) { + + non_identical_columns_v <- c(non_identical_columns_v, col_name) + + #otherwise store the columns where the values are not the same in non_identical_columns + } else { + M2 <- M2[, -which(colnames(M2) == col_name)] + } + + } + + #if the list of columns that do not take the same values is null, we return M1/M2 + if (is.null(non_identical_columns_v)) { + + result <- list(M1 = M1, M2 = M2) + + return(result) + + + } else { + + for (non_identical_columns in non_identical_columns_v) { + + #If we decide to keep the 2 columns and they do not take the same values, we change their names by adding a suffix. + + if (choice_keep == "yes") {#keep both columns and give them a new name + + new_name <- paste(tab1, non_identical_columns, sep = "_") + colnames(M1)[colnames(M1) == non_identical_columns] <- new_name + + new_name <- paste(tab2, non_identical_columns, sep = "_") + colnames(M2)[colnames(M2) == non_identical_columns] <- new_name + + } + + if (choice_keep == "no") {#Keep only one and delete the other + if (Keep == 1) { + M2 <- M2[, -which(colnames(M2) == non_identical_columns)] + new_name <- paste(tab1, non_identical_columns, sep = "_") + colnames(M1)[colnames(M1) == non_identical_columns] <- new_name + + } + if (Keep == 2) { + M1 <- M1[, -which(colnames(M1) == non_identical_columns)] + new_name <- paste(tab2, non_identical_columns, sep = "_") + colnames(M2)[colnames(M2) == non_identical_columns] <- new_name + } + + } + } + } + + + result <- list(M1 = M1, M2 = M2) + return(result) + +} +#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- + +#--------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +match2_bis <- function(Metadata_1, Metadata_2, Mtype) { + + + #Metadata1/Metadata2 = data.frame containing sampleMetadata or variableMetadata + #Mtype = "sample" or "variable" depending on Metadata content + #To check if metadata1 and metadata2 match regarding identifiers + #returns a vector containing an error message if the identifiers are not all the same in the two metadatas + err.stock <- NULL#error vector + + + id2 <- Metadata_1[, 1] + id1 <- Metadata_2[, 1] + + if (length(which(id1 %in% id2)) != length(id1) || length(which(id2 %in% id1)) != length(id2)) { + err.stock <- c("\n", Mtype, "Metadata_1 and ", Mtype, "Metadata_2 do not match regarding Metadata_2 identifiers.") + if (length(which(id1 %in% id2)) != length(id1)) { + if (length(which(! (id1 %in% id2))) < 4) { + err.stock <- c(err.stock, "\n The ") + } else { + err.stock <- c(err.stock, "\n For example, the ") + } + err.stock <- c(err.stock, "following identifiers found in the ", Mtype, "Metadata_1 file\n", + " do not appear in the ", Mtype, " Metadata_2 file:\n") + identif <- id1[which(! (id1 %in% id2))][seq_len(min(3, length(which(! (id1 %in% id2)))))] + err.stock <- c(err.stock, " ", paste(identif, collapse = "\n "), "\n") + } + if (length(which(id2 %in% id1)) != length(id2)) { + if (length(which(! (id2 %in% id1))) < 4) { + err.stock <- c(err.stock, "\n The ") + } else { + err.stock <- c(err.stock, "\n For example, the ") + } + err.stock <- c(err.stock, "following identifiers found in the ", Mtype, " Metadata_2 file\n", + " do not appear in the", Mtype, " Metadata_1 file:\n") + identif <- id2[which(! (id2 %in% id1))][seq_len(min(3, length(which(! (id2 %in% id1)))))] + err.stock <- c(err.stock, " ", paste(identif, collapse = "\n "), "\n") + } + err.stock <- c(err.stock, "\nPlease check your data.\n") + } + + return(err.stock) + +} diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3-4-5_DM1.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3-4-5_DM1.txt new file mode 100644 index 000000000..ae05a2423 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3-4-5_DM1.txt @@ -0,0 +1,18 @@ +data j 785 y54j 68y4j6 5-6 4 hrrrrh 5h - 34 t64 t54 66 y6y t6 5h (5y g51 ( 6 98 j7-0 06654h 60 +5d_-kkcùf 0.356426723610756 0.380152310071702 0.0306944207412024 0.334137638848017 0.298147485608469 0.975073793297568 0.129099504745855 0.973451663994064 0.334792719284834 0.0751565260418877 0.322897933010729 0.129033714279026 0.722966330196726 0.580654367692078 0.644502528016206 0.352827235332827 0.511778286438001 +npèt 0.801750949101246 0.535593104115636 0.258351312473067 0.599475573145688 0.0763319665667417 0.504558103160623 0.367963830290116 0.440540211857668 0.158066366765388 0.609574253877002 0.550590276177951 0.232864384033621 0.637065775537391 0.424098276140436 0.662053737304139 0.0217541227637467 0.299053946391647 +5PY4(*3 0.875199970420953 0.0825428101366147 0.253659010703906 0.507762246807195 0.856444177031262 0.291594962324086 0.616538655402613 0.388475672176377 0.914254939740854 0.449607330807756 0.628469388494906 0.436558212905713 0.951198610265672 0.956459387015831 0.0113483457928278 0.611559621193868 0.127393349941781 +k 0.235214515530521 0.50917637648828 0.0303152651414629 0.305595242012361 0.470145996588881 0.356776179776951 0.569840649303474 0.720070419680388 0.875026990189028 0.97246313990283 0.936423978578332 0.810603455355391 0.903046784946495 0.667091730522105 0.0282601148338295 0.276666638740528 0.747503427028951 +t v^ptok!R/; 0.251801918471682 0.871383805557867 0.285183681272061 0.552739436194454 0.863766301215097 0.182656918760194 0.977603710051043 0.204845724382198 0.751690583305025 0.751475804910098 0.938399878874186 0.218163132174348 0.523463794277572 0.987156468237196 0.630938391969655 0.495061607430081 0.815474132321848 +ojt* 0.907412839750932 0.857498273276021 0.370137361785406 0.76678484779183 0.213299689296413 0.521214352529346 0.0851731095099456 0.868227767553325 0.0711706993343434 0.70186429888193 0.700568035764899 0.7467824290166 0.570332959002042 0.23270290523468 0.126423339798572 0.816262268500797 0.466363859676536 +lmtki 0.344288940919619 0.308219131305663 0.218449898667526 0.700869668247368 0.932538878977527 0.396198994630489 0.710306820874376 0.124235068279782 0.56608643523601 0.887647287670482 0.0375011938139768 0.282378766400105 0.757492159558571 0.506567258021703 0.990910788272054 0.326205008250378 0.61003856679129 +1h6-(587 t 0.308709890328272 0.717202505490233 0.777934118812417 0.604807545422864 0.588458968776734 0.940112596977594 0.788662314418432 0.133046934771924 0.891405172730758 0.915119678712577 0.401136527896346 0.996068607925829 0.049077648050296 0.157657286859101 0.598183619914656 0.439531332356748 0.11995300831499 +r154 (54 86 0.0861033910635205 0.243889357950567 0.848801588667359 0.972183114768299 0.311829870889657 0.434854970574638 0.0240613698880671 0.273335646139236 0.902686361056168 0.73479376111027 0.232132726965829 0.471097756642369 0.511949019774828 0.934158039531663 0.60125450357768 0.972297241140637 0.63149263296722 +(h4 0.336373953934809 0.521412085356266 0.281632887739949 0.67004516763179 0.0199332367594847 0.867732114278491 0.973477443505332 0.883197938525362 0.334509105447652 0.793947578560618 0.465167375556954 0.508757674191867 0.983758014396725 0.100582744588671 0.501301982240787 0.789637338939369 0.967382850752139 +2 0.65083934802851 0.915695024588 0.0376667088550816 0.514003854683931 0.274761574286474 0.652108809243866 0.689393057486628 0.262205073769319 0.871958663956254 0.709490850507154 0.854477673591409 0.672918329289054 0.141693817710263 0.00543057257281332 0.273084303937691 0.39570748778882 0.303196826092465 +m(yk 0.798331012769621 0.806128809071498 0.519974578571807 0.0237856823099186 0.396426673475168 0.75979784245693 0.0589336105092753 0.763144123705766 0.16086904822931 0.301000258395631 0.321186481311644 0.0091434029302796 0.0346149352313591 0.276366137673702 0.686099471259438 0.0548240244354505 0.909361338008149 +-546 -3 -3 0.981561422839383 0.755973696318293 0.328878596436459 0.233341270249666 0.14569201922932 0.458105216271765 0.191023237667199 0.775603857680909 0.146769440956804 0.86812372109824 0.601678275863019 0.782019307745586 0.955614654474782 0.836058192741214 0.454550085076576 0.181788519803465 0.325277631599655 +nz^à t 0.920089977342539 0.249031996586174 0.105577675363886 0.805216649434891 0.505774902707566 0.619612431793644 0.337662179244335 0.672829320507873 0.387228581340173 0.209795853201976 0.0403285073621635 0.540614252108851 0.43362855410287 0.160204078494507 0.924783730297701 0.116837628312753 0.58763473928668 +kzjù 0.418651623550921 0.668434005412235 0.845525871017258 0.567468950919516 0.111441846749533 0.411424602517146 0.0743349602270699 0.583730221710347 0.0105008018078939 0.918789674284249 0.808643595994088 0.33578972219198 0.536848200622412 0.898842910125025 0.333954421105444 0.0390509357521919 0.159857705429294 +. Glk(ôepjg$ 0.3266193089274 0.806668730531573 0.87265879590923 0.934940869880726 0.548967615908753 0.250539517744596 0.75436043048449 0.597444122305604 0.343955002787363 0.560987092777944 0.134929631392942 0.958047956861493 0.870429681664852 0.66286672214456 0.441523248613101 0.437073092741238 0.265031623006715 +rmlgj*lr , 0.462672931523031 0.74679446664976 0.151929368261195 0.165870989887449 0.90931621240424 0.423706631494886 0.337742032589001 0.184993498717115 0.0792523932129463 0.071353352835237 0.525247607449536 0.647744088759121 0.158725526449032 0.203927461340644 0.20055683200405 0.897053444943847 0.506954538974894 diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3_DM2.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3_DM2.txt new file mode 100644 index 000000000..ae05a2423 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_1-2-3_DM2.txt @@ -0,0 +1,18 @@ +data j 785 y54j 68y4j6 5-6 4 hrrrrh 5h - 34 t64 t54 66 y6y t6 5h (5y g51 ( 6 98 j7-0 06654h 60 +5d_-kkcùf 0.356426723610756 0.380152310071702 0.0306944207412024 0.334137638848017 0.298147485608469 0.975073793297568 0.129099504745855 0.973451663994064 0.334792719284834 0.0751565260418877 0.322897933010729 0.129033714279026 0.722966330196726 0.580654367692078 0.644502528016206 0.352827235332827 0.511778286438001 +npèt 0.801750949101246 0.535593104115636 0.258351312473067 0.599475573145688 0.0763319665667417 0.504558103160623 0.367963830290116 0.440540211857668 0.158066366765388 0.609574253877002 0.550590276177951 0.232864384033621 0.637065775537391 0.424098276140436 0.662053737304139 0.0217541227637467 0.299053946391647 +5PY4(*3 0.875199970420953 0.0825428101366147 0.253659010703906 0.507762246807195 0.856444177031262 0.291594962324086 0.616538655402613 0.388475672176377 0.914254939740854 0.449607330807756 0.628469388494906 0.436558212905713 0.951198610265672 0.956459387015831 0.0113483457928278 0.611559621193868 0.127393349941781 +k 0.235214515530521 0.50917637648828 0.0303152651414629 0.305595242012361 0.470145996588881 0.356776179776951 0.569840649303474 0.720070419680388 0.875026990189028 0.97246313990283 0.936423978578332 0.810603455355391 0.903046784946495 0.667091730522105 0.0282601148338295 0.276666638740528 0.747503427028951 +t v^ptok!R/; 0.251801918471682 0.871383805557867 0.285183681272061 0.552739436194454 0.863766301215097 0.182656918760194 0.977603710051043 0.204845724382198 0.751690583305025 0.751475804910098 0.938399878874186 0.218163132174348 0.523463794277572 0.987156468237196 0.630938391969655 0.495061607430081 0.815474132321848 +ojt* 0.907412839750932 0.857498273276021 0.370137361785406 0.76678484779183 0.213299689296413 0.521214352529346 0.0851731095099456 0.868227767553325 0.0711706993343434 0.70186429888193 0.700568035764899 0.7467824290166 0.570332959002042 0.23270290523468 0.126423339798572 0.816262268500797 0.466363859676536 +lmtki 0.344288940919619 0.308219131305663 0.218449898667526 0.700869668247368 0.932538878977527 0.396198994630489 0.710306820874376 0.124235068279782 0.56608643523601 0.887647287670482 0.0375011938139768 0.282378766400105 0.757492159558571 0.506567258021703 0.990910788272054 0.326205008250378 0.61003856679129 +1h6-(587 t 0.308709890328272 0.717202505490233 0.777934118812417 0.604807545422864 0.588458968776734 0.940112596977594 0.788662314418432 0.133046934771924 0.891405172730758 0.915119678712577 0.401136527896346 0.996068607925829 0.049077648050296 0.157657286859101 0.598183619914656 0.439531332356748 0.11995300831499 +r154 (54 86 0.0861033910635205 0.243889357950567 0.848801588667359 0.972183114768299 0.311829870889657 0.434854970574638 0.0240613698880671 0.273335646139236 0.902686361056168 0.73479376111027 0.232132726965829 0.471097756642369 0.511949019774828 0.934158039531663 0.60125450357768 0.972297241140637 0.63149263296722 +(h4 0.336373953934809 0.521412085356266 0.281632887739949 0.67004516763179 0.0199332367594847 0.867732114278491 0.973477443505332 0.883197938525362 0.334509105447652 0.793947578560618 0.465167375556954 0.508757674191867 0.983758014396725 0.100582744588671 0.501301982240787 0.789637338939369 0.967382850752139 +2 0.65083934802851 0.915695024588 0.0376667088550816 0.514003854683931 0.274761574286474 0.652108809243866 0.689393057486628 0.262205073769319 0.871958663956254 0.709490850507154 0.854477673591409 0.672918329289054 0.141693817710263 0.00543057257281332 0.273084303937691 0.39570748778882 0.303196826092465 +m(yk 0.798331012769621 0.806128809071498 0.519974578571807 0.0237856823099186 0.396426673475168 0.75979784245693 0.0589336105092753 0.763144123705766 0.16086904822931 0.301000258395631 0.321186481311644 0.0091434029302796 0.0346149352313591 0.276366137673702 0.686099471259438 0.0548240244354505 0.909361338008149 +-546 -3 -3 0.981561422839383 0.755973696318293 0.328878596436459 0.233341270249666 0.14569201922932 0.458105216271765 0.191023237667199 0.775603857680909 0.146769440956804 0.86812372109824 0.601678275863019 0.782019307745586 0.955614654474782 0.836058192741214 0.454550085076576 0.181788519803465 0.325277631599655 +nz^à t 0.920089977342539 0.249031996586174 0.105577675363886 0.805216649434891 0.505774902707566 0.619612431793644 0.337662179244335 0.672829320507873 0.387228581340173 0.209795853201976 0.0403285073621635 0.540614252108851 0.43362855410287 0.160204078494507 0.924783730297701 0.116837628312753 0.58763473928668 +kzjù 0.418651623550921 0.668434005412235 0.845525871017258 0.567468950919516 0.111441846749533 0.411424602517146 0.0743349602270699 0.583730221710347 0.0105008018078939 0.918789674284249 0.808643595994088 0.33578972219198 0.536848200622412 0.898842910125025 0.333954421105444 0.0390509357521919 0.159857705429294 +. Glk(ôepjg$ 0.3266193089274 0.806668730531573 0.87265879590923 0.934940869880726 0.548967615908753 0.250539517744596 0.75436043048449 0.597444122305604 0.343955002787363 0.560987092777944 0.134929631392942 0.958047956861493 0.870429681664852 0.66286672214456 0.441523248613101 0.437073092741238 0.265031623006715 +rmlgj*lr , 0.462672931523031 0.74679446664976 0.151929368261195 0.165870989887449 0.90931621240424 0.423706631494886 0.337742032589001 0.184993498717115 0.0792523932129463 0.071353352835237 0.525247607449536 0.647744088759121 0.158725526449032 0.203927461340644 0.20055683200405 0.897053444943847 0.506954538974894 diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM1.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM1.txt new file mode 100644 index 000000000..eea102124 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM1.txt @@ -0,0 +1,18 @@ +samplename ABD E AAA fp uv +j 785 19 9 r pj s +y54j 68y4j6 24 p0 bg z d +5-6 4 2 45 il e f +hrrrrh 3 24 d r s +5h - y 29 b t d +34 f6 71 a ky f +t64 4 chgmt l u s +t54 66 23 91 c i d +y6y 5 61 f o f +t6 5h 8g 21 s p s +(5y 98 77 b q d +g51 67 1 b s f +( 98 48 r d s +6 2 10 a f d +98 j7-0 1 36 a g f +06654h 34 100 k h s +60 67 38 d j d \ No newline at end of file diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM2.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM2.txt new file mode 100644 index 000000000..858db78d3 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_1_SM2.txt @@ -0,0 +1,18 @@ +samplename ABD E AAA fp uv +j 785 ici 9 r pj s +y54j 68y4j6 24 p0 bg z d +5-6 4 2 45 il ici f +hrrrrh 3 24 d r s +5h - y 29 b t d +34 f6 71 a ky f +t64 4 chgmt l u s +t54 66 23 91 c ici d +y6y 5 61 f o f +t6 5h 8g 21 s p s +(5y 98 77 b q d +g51 67 1 b s f +( 98 48 r ici s +6 2 10 a f d +98 j7-0 1 36 a g f +06654h 34 100 k h s +60 67 38 d j d \ No newline at end of file diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_4_DM2.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_DM2.txt new file mode 100644 index 000000000..d0ed7aafd --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_DM2.txt @@ -0,0 +1,18 @@ +data pj 785 py54j 68y4j6 p5-6 4 phrrrrh p5h - p34 pt64 pt54 66 py6y pt6 5h p(5y pg51 p( p6 p98 j7-0 p06654h p60 +5d_-kkcùf 0.356426723610756 0.380152310071702 0.0306944207412024 0.334137638848017 0.298147485608469 0.975073793297568 0.129099504745855 0.973451663994064 0.334792719284834 0.0751565260418877 0.322897933010729 0.129033714279026 0.722966330196726 0.580654367692078 0.644502528016206 0.352827235332827 0.511778286438001 +npèt 0.801750949101246 0.535593104115636 0.258351312473067 0.599475573145688 0.0763319665667417 0.504558103160623 0.367963830290116 0.440540211857668 0.158066366765388 0.609574253877002 0.550590276177951 0.232864384033621 0.637065775537391 0.424098276140436 0.662053737304139 0.0217541227637467 0.299053946391647 +5PY4(*3 0.875199970420953 0.0825428101366147 0.253659010703906 0.507762246807195 0.856444177031262 0.291594962324086 0.616538655402613 0.388475672176377 0.914254939740854 0.449607330807756 0.628469388494906 0.436558212905713 0.951198610265672 0.956459387015831 0.0113483457928278 0.611559621193868 0.127393349941781 +k 0.235214515530521 0.50917637648828 0.0303152651414629 0.305595242012361 0.470145996588881 0.356776179776951 0.569840649303474 0.720070419680388 0.875026990189028 0.97246313990283 0.936423978578332 0.810603455355391 0.903046784946495 0.667091730522105 0.0282601148338295 0.276666638740528 0.747503427028951 +t v^ptok!R/; 0.251801918471682 0.871383805557867 0.285183681272061 0.552739436194454 0.863766301215097 0.182656918760194 0.977603710051043 0.204845724382198 0.751690583305025 0.751475804910098 0.938399878874186 0.218163132174348 0.523463794277572 0.987156468237196 0.630938391969655 0.495061607430081 0.815474132321848 +ojt* 0.907412839750932 0.857498273276021 0.370137361785406 0.76678484779183 0.213299689296413 0.521214352529346 0.0851731095099456 0.868227767553325 0.0711706993343434 0.70186429888193 0.700568035764899 0.7467824290166 0.570332959002042 0.23270290523468 0.126423339798572 0.816262268500797 0.466363859676536 +lmtki 0.344288940919619 0.308219131305663 0.218449898667526 0.700869668247368 0.932538878977527 0.396198994630489 0.710306820874376 0.124235068279782 0.56608643523601 0.887647287670482 0.0375011938139768 0.282378766400105 0.757492159558571 0.506567258021703 0.990910788272054 0.326205008250378 0.61003856679129 +1h6-(587 t 0.308709890328272 0.717202505490233 0.777934118812417 0.604807545422864 0.588458968776734 0.940112596977594 0.788662314418432 0.133046934771924 0.891405172730758 0.915119678712577 0.401136527896346 0.996068607925829 0.049077648050296 0.157657286859101 0.598183619914656 0.439531332356748 0.11995300831499 +r154 (54 86 0.0861033910635205 0.243889357950567 0.848801588667359 0.972183114768299 0.311829870889657 0.434854970574638 0.0240613698880671 0.273335646139236 0.902686361056168 0.73479376111027 0.232132726965829 0.471097756642369 0.511949019774828 0.934158039531663 0.60125450357768 0.972297241140637 0.63149263296722 +(h4 0.336373953934809 0.521412085356266 0.281632887739949 0.67004516763179 0.0199332367594847 0.867732114278491 0.973477443505332 0.883197938525362 0.334509105447652 0.793947578560618 0.465167375556954 0.508757674191867 0.983758014396725 0.100582744588671 0.501301982240787 0.789637338939369 0.967382850752139 +2 0.65083934802851 0.915695024588 0.0376667088550816 0.514003854683931 0.274761574286474 0.652108809243866 0.689393057486628 0.262205073769319 0.871958663956254 0.709490850507154 0.854477673591409 0.672918329289054 0.141693817710263 0.00543057257281332 0.273084303937691 0.39570748778882 0.303196826092465 +m(yk 0.798331012769621 0.806128809071498 0.519974578571807 0.0237856823099186 0.396426673475168 0.75979784245693 0.0589336105092753 0.763144123705766 0.16086904822931 0.301000258395631 0.321186481311644 0.0091434029302796 0.0346149352313591 0.276366137673702 0.686099471259438 0.0548240244354505 0.909361338008149 +-546 -3 -3 0.981561422839383 0.755973696318293 0.328878596436459 0.233341270249666 0.14569201922932 0.458105216271765 0.191023237667199 0.775603857680909 0.146769440956804 0.86812372109824 0.601678275863019 0.782019307745586 0.955614654474782 0.836058192741214 0.454550085076576 0.181788519803465 0.325277631599655 +nz^à t 0.920089977342539 0.249031996586174 0.105577675363886 0.805216649434891 0.505774902707566 0.619612431793644 0.337662179244335 0.672829320507873 0.387228581340173 0.209795853201976 0.0403285073621635 0.540614252108851 0.43362855410287 0.160204078494507 0.924783730297701 0.116837628312753 0.58763473928668 +kzjù 0.418651623550921 0.668434005412235 0.845525871017258 0.567468950919516 0.111441846749533 0.411424602517146 0.0743349602270699 0.583730221710347 0.0105008018078939 0.918789674284249 0.808643595994088 0.33578972219198 0.536848200622412 0.898842910125025 0.333954421105444 0.0390509357521919 0.159857705429294 +. Glk(ôepjg$ 0.3266193089274 0.806668730531573 0.87265879590923 0.934940869880726 0.548967615908753 0.250539517744596 0.75436043048449 0.597444122305604 0.343955002787363 0.560987092777944 0.134929631392942 0.958047956861493 0.870429681664852 0.66286672214456 0.441523248613101 0.437073092741238 0.265031623006715 +rmlgj*lr , 0.462672931523031 0.74679446664976 0.151929368261195 0.165870989887449 0.90931621240424 0.423706631494886 0.337742032589001 0.184993498717115 0.0792523932129463 0.071353352835237 0.525247607449536 0.647744088759121 0.158725526449032 0.203927461340644 0.20055683200405 0.897053444943847 0.506954538974894 diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM1.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM1.txt new file mode 100644 index 000000000..beccde3df --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM1.txt @@ -0,0 +1,18 @@ +samplename ICI ICI2 ICI3 ICI4 ICI5 +j 785 19 9 r pj s +y54j 68y4j6 24 p0 bg z d +5-6 4 2 45 il e f +hrrrrh 3 24 d r s +5h - y 29 b t d +34 f6 71 a ky f +t64 4 chgmt l u s +t54 66 23 91 c i d +y6y 5 61 f o f +t6 5h 8g 21 s p s +(5y 98 77 b q d +g51 67 1 b s f +( 98 48 r d s +6 2 10 a f d +98 j7-0 1 36 a g f +06654h 34 100 k h s +60 67 38 d j d \ No newline at end of file diff --git a/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM2.txt b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM2.txt new file mode 100644 index 000000000..ccad83f09 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Input_Unique_Test_4_SM2.txt @@ -0,0 +1,18 @@ +samplename ICI ICI2 ICI3 ICI4 ICI5 +pj 785 19 9 r pj s +py54j 68y4j6 24 p0 bg z d +p5-6 4 2 45 il e f +phrrrrh 3 24 d r s +p5h - y 29 b t d +p34 f6 71 a ky f +pt64 4 chgmt l u s +pt54 66 23 91 c i d +py6y 5 61 f o f +pt6 5h 8g 21 s p s +p(5y 98 77 b q d +pg51 67 1 b s f +p( 98 48 r d s +p6 2 10 a f d +p98 j7-0 1 36 a g f +p06654h 34 100 k h s +p60 67 38 d j d \ No newline at end of file diff --git a/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM1.txt b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM1.txt new file mode 100644 index 000000000..ae05a2423 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM1.txt @@ -0,0 +1,18 @@ +data j 785 y54j 68y4j6 5-6 4 hrrrrh 5h - 34 t64 t54 66 y6y t6 5h (5y g51 ( 6 98 j7-0 06654h 60 +5d_-kkcùf 0.356426723610756 0.380152310071702 0.0306944207412024 0.334137638848017 0.298147485608469 0.975073793297568 0.129099504745855 0.973451663994064 0.334792719284834 0.0751565260418877 0.322897933010729 0.129033714279026 0.722966330196726 0.580654367692078 0.644502528016206 0.352827235332827 0.511778286438001 +npèt 0.801750949101246 0.535593104115636 0.258351312473067 0.599475573145688 0.0763319665667417 0.504558103160623 0.367963830290116 0.440540211857668 0.158066366765388 0.609574253877002 0.550590276177951 0.232864384033621 0.637065775537391 0.424098276140436 0.662053737304139 0.0217541227637467 0.299053946391647 +5PY4(*3 0.875199970420953 0.0825428101366147 0.253659010703906 0.507762246807195 0.856444177031262 0.291594962324086 0.616538655402613 0.388475672176377 0.914254939740854 0.449607330807756 0.628469388494906 0.436558212905713 0.951198610265672 0.956459387015831 0.0113483457928278 0.611559621193868 0.127393349941781 +k 0.235214515530521 0.50917637648828 0.0303152651414629 0.305595242012361 0.470145996588881 0.356776179776951 0.569840649303474 0.720070419680388 0.875026990189028 0.97246313990283 0.936423978578332 0.810603455355391 0.903046784946495 0.667091730522105 0.0282601148338295 0.276666638740528 0.747503427028951 +t v^ptok!R/; 0.251801918471682 0.871383805557867 0.285183681272061 0.552739436194454 0.863766301215097 0.182656918760194 0.977603710051043 0.204845724382198 0.751690583305025 0.751475804910098 0.938399878874186 0.218163132174348 0.523463794277572 0.987156468237196 0.630938391969655 0.495061607430081 0.815474132321848 +ojt* 0.907412839750932 0.857498273276021 0.370137361785406 0.76678484779183 0.213299689296413 0.521214352529346 0.0851731095099456 0.868227767553325 0.0711706993343434 0.70186429888193 0.700568035764899 0.7467824290166 0.570332959002042 0.23270290523468 0.126423339798572 0.816262268500797 0.466363859676536 +lmtki 0.344288940919619 0.308219131305663 0.218449898667526 0.700869668247368 0.932538878977527 0.396198994630489 0.710306820874376 0.124235068279782 0.56608643523601 0.887647287670482 0.0375011938139768 0.282378766400105 0.757492159558571 0.506567258021703 0.990910788272054 0.326205008250378 0.61003856679129 +1h6-(587 t 0.308709890328272 0.717202505490233 0.777934118812417 0.604807545422864 0.588458968776734 0.940112596977594 0.788662314418432 0.133046934771924 0.891405172730758 0.915119678712577 0.401136527896346 0.996068607925829 0.049077648050296 0.157657286859101 0.598183619914656 0.439531332356748 0.11995300831499 +r154 (54 86 0.0861033910635205 0.243889357950567 0.848801588667359 0.972183114768299 0.311829870889657 0.434854970574638 0.0240613698880671 0.273335646139236 0.902686361056168 0.73479376111027 0.232132726965829 0.471097756642369 0.511949019774828 0.934158039531663 0.60125450357768 0.972297241140637 0.63149263296722 +(h4 0.336373953934809 0.521412085356266 0.281632887739949 0.67004516763179 0.0199332367594847 0.867732114278491 0.973477443505332 0.883197938525362 0.334509105447652 0.793947578560618 0.465167375556954 0.508757674191867 0.983758014396725 0.100582744588671 0.501301982240787 0.789637338939369 0.967382850752139 +2 0.65083934802851 0.915695024588 0.0376667088550816 0.514003854683931 0.274761574286474 0.652108809243866 0.689393057486628 0.262205073769319 0.871958663956254 0.709490850507154 0.854477673591409 0.672918329289054 0.141693817710263 0.00543057257281332 0.273084303937691 0.39570748778882 0.303196826092465 +m(yk 0.798331012769621 0.806128809071498 0.519974578571807 0.0237856823099186 0.396426673475168 0.75979784245693 0.0589336105092753 0.763144123705766 0.16086904822931 0.301000258395631 0.321186481311644 0.0091434029302796 0.0346149352313591 0.276366137673702 0.686099471259438 0.0548240244354505 0.909361338008149 +-546 -3 -3 0.981561422839383 0.755973696318293 0.328878596436459 0.233341270249666 0.14569201922932 0.458105216271765 0.191023237667199 0.775603857680909 0.146769440956804 0.86812372109824 0.601678275863019 0.782019307745586 0.955614654474782 0.836058192741214 0.454550085076576 0.181788519803465 0.325277631599655 +nz^à t 0.920089977342539 0.249031996586174 0.105577675363886 0.805216649434891 0.505774902707566 0.619612431793644 0.337662179244335 0.672829320507873 0.387228581340173 0.209795853201976 0.0403285073621635 0.540614252108851 0.43362855410287 0.160204078494507 0.924783730297701 0.116837628312753 0.58763473928668 +kzjù 0.418651623550921 0.668434005412235 0.845525871017258 0.567468950919516 0.111441846749533 0.411424602517146 0.0743349602270699 0.583730221710347 0.0105008018078939 0.918789674284249 0.808643595994088 0.33578972219198 0.536848200622412 0.898842910125025 0.333954421105444 0.0390509357521919 0.159857705429294 +. Glk(ôepjg$ 0.3266193089274 0.806668730531573 0.87265879590923 0.934940869880726 0.548967615908753 0.250539517744596 0.75436043048449 0.597444122305604 0.343955002787363 0.560987092777944 0.134929631392942 0.958047956861493 0.870429681664852 0.66286672214456 0.441523248613101 0.437073092741238 0.265031623006715 +rmlgj*lr , 0.462672931523031 0.74679446664976 0.151929368261195 0.165870989887449 0.90931621240424 0.423706631494886 0.337742032589001 0.184993498717115 0.0792523932129463 0.071353352835237 0.525247607449536 0.647744088759121 0.158725526449032 0.203927461340644 0.20055683200405 0.897053444943847 0.506954538974894 diff --git a/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM2.txt b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM2.txt new file mode 100644 index 000000000..ae05a2423 --- /dev/null +++ b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1-2-3_DM2.txt @@ -0,0 +1,18 @@ +data j 785 y54j 68y4j6 5-6 4 hrrrrh 5h - 34 t64 t54 66 y6y t6 5h (5y g51 ( 6 98 j7-0 06654h 60 +5d_-kkcùf 0.356426723610756 0.380152310071702 0.0306944207412024 0.334137638848017 0.298147485608469 0.975073793297568 0.129099504745855 0.973451663994064 0.334792719284834 0.0751565260418877 0.322897933010729 0.129033714279026 0.722966330196726 0.580654367692078 0.644502528016206 0.352827235332827 0.511778286438001 +npèt 0.801750949101246 0.535593104115636 0.258351312473067 0.599475573145688 0.0763319665667417 0.504558103160623 0.367963830290116 0.440540211857668 0.158066366765388 0.609574253877002 0.550590276177951 0.232864384033621 0.637065775537391 0.424098276140436 0.662053737304139 0.0217541227637467 0.299053946391647 +5PY4(*3 0.875199970420953 0.0825428101366147 0.253659010703906 0.507762246807195 0.856444177031262 0.291594962324086 0.616538655402613 0.388475672176377 0.914254939740854 0.449607330807756 0.628469388494906 0.436558212905713 0.951198610265672 0.956459387015831 0.0113483457928278 0.611559621193868 0.127393349941781 +k 0.235214515530521 0.50917637648828 0.0303152651414629 0.305595242012361 0.470145996588881 0.356776179776951 0.569840649303474 0.720070419680388 0.875026990189028 0.97246313990283 0.936423978578332 0.810603455355391 0.903046784946495 0.667091730522105 0.0282601148338295 0.276666638740528 0.747503427028951 +t v^ptok!R/; 0.251801918471682 0.871383805557867 0.285183681272061 0.552739436194454 0.863766301215097 0.182656918760194 0.977603710051043 0.204845724382198 0.751690583305025 0.751475804910098 0.938399878874186 0.218163132174348 0.523463794277572 0.987156468237196 0.630938391969655 0.495061607430081 0.815474132321848 +ojt* 0.907412839750932 0.857498273276021 0.370137361785406 0.76678484779183 0.213299689296413 0.521214352529346 0.0851731095099456 0.868227767553325 0.0711706993343434 0.70186429888193 0.700568035764899 0.7467824290166 0.570332959002042 0.23270290523468 0.126423339798572 0.816262268500797 0.466363859676536 +lmtki 0.344288940919619 0.308219131305663 0.218449898667526 0.700869668247368 0.932538878977527 0.396198994630489 0.710306820874376 0.124235068279782 0.56608643523601 0.887647287670482 0.0375011938139768 0.282378766400105 0.757492159558571 0.506567258021703 0.990910788272054 0.326205008250378 0.61003856679129 +1h6-(587 t 0.308709890328272 0.717202505490233 0.777934118812417 0.604807545422864 0.588458968776734 0.940112596977594 0.788662314418432 0.133046934771924 0.891405172730758 0.915119678712577 0.401136527896346 0.996068607925829 0.049077648050296 0.157657286859101 0.598183619914656 0.439531332356748 0.11995300831499 +r154 (54 86 0.0861033910635205 0.243889357950567 0.848801588667359 0.972183114768299 0.311829870889657 0.434854970574638 0.0240613698880671 0.273335646139236 0.902686361056168 0.73479376111027 0.232132726965829 0.471097756642369 0.511949019774828 0.934158039531663 0.60125450357768 0.972297241140637 0.63149263296722 +(h4 0.336373953934809 0.521412085356266 0.281632887739949 0.67004516763179 0.0199332367594847 0.867732114278491 0.973477443505332 0.883197938525362 0.334509105447652 0.793947578560618 0.465167375556954 0.508757674191867 0.983758014396725 0.100582744588671 0.501301982240787 0.789637338939369 0.967382850752139 +2 0.65083934802851 0.915695024588 0.0376667088550816 0.514003854683931 0.274761574286474 0.652108809243866 0.689393057486628 0.262205073769319 0.871958663956254 0.709490850507154 0.854477673591409 0.672918329289054 0.141693817710263 0.00543057257281332 0.273084303937691 0.39570748778882 0.303196826092465 +m(yk 0.798331012769621 0.806128809071498 0.519974578571807 0.0237856823099186 0.396426673475168 0.75979784245693 0.0589336105092753 0.763144123705766 0.16086904822931 0.301000258395631 0.321186481311644 0.0091434029302796 0.0346149352313591 0.276366137673702 0.686099471259438 0.0548240244354505 0.909361338008149 +-546 -3 -3 0.981561422839383 0.755973696318293 0.328878596436459 0.233341270249666 0.14569201922932 0.458105216271765 0.191023237667199 0.775603857680909 0.146769440956804 0.86812372109824 0.601678275863019 0.782019307745586 0.955614654474782 0.836058192741214 0.454550085076576 0.181788519803465 0.325277631599655 +nz^à t 0.920089977342539 0.249031996586174 0.105577675363886 0.805216649434891 0.505774902707566 0.619612431793644 0.337662179244335 0.672829320507873 0.387228581340173 0.209795853201976 0.0403285073621635 0.540614252108851 0.43362855410287 0.160204078494507 0.924783730297701 0.116837628312753 0.58763473928668 +kzjù 0.418651623550921 0.668434005412235 0.845525871017258 0.567468950919516 0.111441846749533 0.411424602517146 0.0743349602270699 0.583730221710347 0.0105008018078939 0.918789674284249 0.808643595994088 0.33578972219198 0.536848200622412 0.898842910125025 0.333954421105444 0.0390509357521919 0.159857705429294 +. Glk(ôepjg$ 0.3266193089274 0.806668730531573 0.87265879590923 0.934940869880726 0.548967615908753 0.250539517744596 0.75436043048449 0.597444122305604 0.343955002787363 0.560987092777944 0.134929631392942 0.958047956861493 0.870429681664852 0.66286672214456 0.441523248613101 0.437073092741238 0.265031623006715 +rmlgj*lr , 0.462672931523031 0.74679446664976 0.151929368261195 0.165870989887449 0.90931621240424 0.423706631494886 0.337742032589001 0.184993498717115 0.0792523932129463 0.071353352835237 0.525247607449536 0.647744088759121 0.158725526449032 0.203927461340644 0.20055683200405 0.897053444943847 0.506954538974894 diff --git a/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1_Metadata.txt b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1_Metadata.txt new file mode 100644 index 000000000..80aa8c54e --- /dev/null +++ b/tools/w4mconcatenate/test-data/Output_Attendu_Unique_Test_1_Metadata.txt @@ -0,0 +1,18 @@ +samplename tab1_ABD E AAA tab1_fp uv tab2_ABD tab2_fp +j 785 19 9 r pj s ici pj +y54j 68y4j6 24 p0 bg z d 24 z +5-6 4 2 45 il e f 2 ici +hrrrrh 3 24 d r s 3 r +5h - y 29 b t d y t +34 f6 71 a ky f f6 ky +t64 4 chgmt l u s 4 u +t54 66 23 91 c i d 23 ici +y6y 5 61 f o f 5 o +t6 5h 8g 21 s p s 8g p +(5y 98 77 b q d 98 q +g51 67 1 b s f 67 s +( 98 48 r d s 98 ici +6 2 10 a f d 2 f +98 j7-0 1 36 a g f 1 g +06654h 34 100 k h s 34 h +60 67 38 d j d 67 j