R/read_barracoda_excel.R

Defines functions read_barracoda_excel

read_barracoda_excel = function(path){
  list_of_barracoda_output = lapply(excel_sheets(path = path),
                                    read_excel, path = path)
  barracoda_data = do.call(rbind, list_of_barracoda_output)
  exp_var_names = c('barcode', 'sample', 'count.1', 'input.1', 'input.2',
                    'input.3', 'log_fold_change', 'p', 'pep.number')
  if( ncol(barracoda_data) != 9 |
      !all(colnames(barracoda_data)==exp_var_names) ){
    stop("Barracoda input is not raw - Did you change column names or add columns in excel?")
  }
  return( barracoda_data )
}
leonjessen/Barracoda2viz documentation built on Feb. 23, 2018, 3:43 p.m.