From a296f9f8fbc73d8466209ab62e84db0a6e86a3b2 Mon Sep 17 00:00:00 2001 From: Waldir Leoncio Date: Fri, 3 Sep 2021 08:43:37 +0200 Subject: [PATCH] greedyMix changed to channel data load (close #16) --- R/greedyMix.R | 37 ++++++++++++++++++++----------------- man/greedyMix.Rd | 15 +++------------ 2 files changed, 23 insertions(+), 29 deletions(-) diff --git a/R/greedyMix.R b/R/greedyMix.R index 83472e4..8b79573 100644 --- a/R/greedyMix.R +++ b/R/greedyMix.R @@ -1,20 +1,23 @@ #' @title Clustering of individuals -#' @param tietue File -#' @param format Format of the data ("BAPS", "GenePop" or "Preprocessed") -#' @param savePreProcessed Save the pre-processed data? -#' @param filePreProcessed Is the file already processed? +#' @param data data file +#' @param format Format of the data c("FASTA", "VCF" ,"SAM", or "GenePop") #' @importFrom utils read.delim #' @export -greedyMix <- function( - tietue, - format = NULL, - savePreProcessed = NULL, - filePreProcessed = NULL -) { - stop( - "greedyMix() has been superseded by load_fasta().", - " Please change your code to use the latter instead of the former.", - " If you believe the error is internal to rBAPS, please open", - " a new issue (link on the package DESCRIPTION file)." - ) -} +greedyMix <- function(data, format) { + format <- tolower(format) + if (format == "fasta") { + out <- load_fasta(data) + } else if (format == "vcf") { + stop("VCF files not yet supported." ) + # TODO #16: implement load_vcf() + } else if (format == "sam") { + stop("SAM files not yet supported." ) + # TODO #16: implement load_sam() + } else if(format == "genepop") { + # TODO #16: implement load_genepop() + stop("GenePop files not yet supported." ) + } else { + stop("Format not supported.") + } + return(out) +} \ No newline at end of file diff --git a/man/greedyMix.Rd b/man/greedyMix.Rd index b8a04cb..7117437 100644 --- a/man/greedyMix.Rd +++ b/man/greedyMix.Rd @@ -4,21 +4,12 @@ \alias{greedyMix} \title{Clustering of individuals} \usage{ -greedyMix( - tietue, - format = NULL, - savePreProcessed = NULL, - filePreProcessed = NULL -) +greedyMix(data, format) } \arguments{ -\item{tietue}{File} +\item{data}{data file} -\item{format}{Format of the data ("BAPS", "GenePop" or "Preprocessed")} - -\item{savePreProcessed}{Save the pre-processed data?} - -\item{filePreProcessed}{Is the file already processed?} +\item{format}{Format of the data c("FASTA", "VCF" ,"SAM", or "GenePop")} } \description{ Clustering of individuals