Mercurial > repos > proteore > proteore_prot_features
comparison add_protein_features.R @ 12:1a4cfa7a3a27 draft
planemo upload commit 77279e994f5751c6cd9aa165aa0604db3d241271-dirty
author | proteore |
---|---|
date | Mon, 11 Mar 2019 09:16:00 -0400 |
parents | 8df559ad14a7 |
children | 0116d444d21f |
comparison
equal
deleted
inserted
replaced
11:8df559ad14a7 | 12:1a4cfa7a3a27 |
---|---|
1 # Read file and return file content as data.frame | 1 # Read file and return file content as data.frame |
2 read_file <- function(path,header){ | 2 read_file <- function(path,header){ |
3 file <- try(read.table(path,header=header, sep="\t",stringsAsFactors = FALSE, quote="", check.names = F),silent=TRUE) | 3 file <- try(read.csv(path,header=header, sep="\t",stringsAsFactors = FALSE, quote="", check.names = F),silent=TRUE) |
4 if (inherits(file,"try-error")){ | 4 if (inherits(file,"try-error")){ |
5 stop("File not found !") | 5 stop("File not found !") |
6 }else{ | 6 }else{ |
7 file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE] | 7 file <- file[!apply(is.na(file) | file == "", 1, all), , drop=FALSE] |
8 return(file) | 8 return(file) |