R/ds.getSNPs.R

Defines functions ds.getSNPs

Documented in ds.getSNPs

#' @title Retrieve SNPs from  
#'
#' @param genoData \code{character} Object of class \code{GenotypeData} or 
#' \code{GdsGenotypeReader} on the server
#' @param datasources a list of \code{\link{DSConnection-class}} (default \code{NULL}) objects obtained after login
#'
#' @return Character vector with the SNP names
#' @export

ds.getSNPs <- function(genoData, datasources = NULL){
  
  if (is.null(datasources)) {
    datasources <- DSI::datashield.connections_find()
  }
  
  cally <- paste0("getVariable(", genoData, ", 'snp.rs.id')")
  snps <- unlist(DSI::datashield.aggregate(datasources,  cally))
  names(snps) <- NULL
  return(snps)
}
isglobal-brge/dsOmicsClient documentation built on March 20, 2023, 3:52 p.m.