Skip to content
Snippets Groups Projects
Commit de259a96 authored by Marek Ostaszewski's avatar Marek Ostaszewski
Browse files

remove nonprintables and improve read

parent a2aca965
No related branches found
No related tags found
1 merge request!22remove nonprintables and improve read
This commit is part of merge request !22. Comments created here will be created in the context of that merge request.
......@@ -98,6 +98,7 @@ get_hipathia_files <- function(raw_sif, node_prefix, model_elements, target_dir)
att_nodes <- sort(unique(c(raw_sif[,1],raw_sif[,3])))
att_labels <- sapply(att_nodes, function(x) with(model_elements, name[elementId == x]))
att_labels <- gsub("[^ -~]+", "", att_labels)
node_ID <- paste0("N-",node_prefix,"-", att_nodes)
### Retrieve Entrez and type for the entire list of unique nodes
entrez <- sapply(att_nodes, group_elements, model_elements, all_entrez)
......
......@@ -56,8 +56,8 @@ create_hipathia_graph <- function(hipathia_attributes, hipathia_sif) {
### A function to return graph object from the att and sif files
read_hipathia_graph <- function(file_name, prefix){
hats <- read.table(paste0(prefix, file_name, ".att"), sep = "\t", header = T, stringsAsFactors = F)
hsif <- read.table(paste0(prefix,file_name, ".sif"), sep = "\t", header = T, stringsAsFactors = F)
hats <- read.table(paste0(prefix, file_name, ".att"), sep = "\t", header = T, stringsAsFactors = F, quote = "")
hsif <- read.table(paste0(prefix,file_name, ".sif"), sep = "\t", header = T, stringsAsFactors = F, quote = "")
create_hipathia_graph(hats, hsif)
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment