R/readSif.R

Defines functions readSif

Documented in readSif

#' Read in a binary SIF file
#'
#' @param inputFile an inputFile
#' @return a data.frame with the interactions in the binary SIF format
#'
#' @examples
#' results <- readSif(system.file("extdata", "test_sif.txt", package="paxtoolsr"))
#'
#' @concept paxtoolsr
#' @export
#' 
#' @importFrom readr read_tsv cols
readSif <- function(inputFile) {
  checkInputFilePc(inputFile)

  results <- read_tsv(inputFile, 
                      progress = TRUE, 
                      col_names = c("PARTICIPANT_A", "INTERACTION_TYPE", "PARTICIPANT_B"), 
                      col_types = cols(.default = "c"))
  
  results <- as.data.frame(results)
  #colnames(results) <- c("PARTICIPANT_A",  "INTERACTION_TYPE", "PARTICIPANT_B")

  return(results)
}

Try the paxtoolsr package in your browser

Any scripts or data that you put into this service are public.

paxtoolsr documentation built on Nov. 8, 2020, 8:29 p.m.