Skip to content

Get rid of ReplaceWordInFile function #95

@marinak-ebi

Description

@marinak-ebi

Instead of replacing one word in the function.R file, create a parameter for Rscript that indicates a version.

ReplaceWordInFile function:

ReplaceWordInFile = function(file,
pattern = '',
replaceBy = '',
fixed = TRUE,
...) {
if (!file.exists(file)) {
message0('file does not exists. file \n\t =>', file)
return (invisible(file))
}
tx <- readLines(file)
tx2 <-
gsub(
pattern = pattern,
replace = replaceBy,
x = tx,
fixed = fixed,
...
)
writeLines(tx2, con = file)
message0('Replace in file successful. Pattern: ',
pattern,
', Replaced by: ',
replaceBy)
return (invisible(file))
}

Example of line in the log file:
Replace in file successful. Pattern: DRversionNotSpecified, Replaced by: 20.17

ReplaceWordInFile function replace pattern in following files:

To-do list:

  • Remove ReplaceWordInFile function.
  • Add version parameter to the function.R and function_windowed.R.
  • Replace function in the orchestration script.

Metadata

Metadata

Assignees

Labels

refactorRestructure code, but not its functionality

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions