Mercurial > repos > iuc > edger
comparison edger.R @ 18:fd9902d118e5 draft default tip
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/edger commit 96699cdbdadf0a1c40fdbd87f870b47049c0449f
author | iuc |
---|---|
date | Wed, 15 Oct 2025 12:56:34 +0000 |
parents | fb9dc2ee2fd4 |
children |
comparison
equal
deleted
inserted
replaced
17:fb9dc2ee2fd4 | 18:fd9902d118e5 |
---|---|
86 } | 86 } |
87 | 87 |
88 # Sanitise file base names coming from factors or contrasts | 88 # Sanitise file base names coming from factors or contrasts |
89 sanitise_basename <- function(string) { | 89 sanitise_basename <- function(string) { |
90 string <- gsub("[/^]", "_", string) | 90 string <- gsub("[/^]", "_", string) |
91 # If string is longer than 200 characters, truncate intelligently | |
92 if (nchar(string) > 200) { | |
93 # Keep first 80 characters, last 80 characters, and add hash in middle | |
94 start_part <- substr(string, 1, 80) | |
95 end_part <- substr(string, nchar(string) - 79, nchar(string)) | |
96 # Create a simple hash of the full string using built-in functions | |
97 hash_input <- utf8ToInt(string) | |
98 hash_value <- sum(hash_input * seq_along(hash_input)) %% 99999999 | |
99 hash_str <- sprintf("%08d", hash_value) | |
100 string <- paste0(start_part, "_", hash_str, "_", end_part) | |
101 } | |
91 return(string) | 102 return(string) |
92 } | 103 } |
93 | 104 |
94 # Generate output folder and paths | 105 # Generate output folder and paths |
95 make_out <- function(filename) { | 106 make_out <- function(filename) { |