#' Reads a collection of topolink log files given a log list file and a path to the log collection
#'
#' @param loglistLocation The path to a text file containing the names of the log files. can be generated by 'ls *.log > loglist.txt' on the appropriate directory.
#' @param topolinkLogsDirectory The path to the directory containing the topolink logs.
#' @return A list of parsed topolink logs
read.topolink.output <- function(loglistLocation,
topolinkLogsDirectory){
######
#
# This script relies on logs obtained by TopoLink Software. TopoLink is open-source software.
# Whenever you use TopoLink software, please cite:
#
# Ferrari, Allan & MartÃnez, Leandro & Cesar Gozzo, Fabio. (2017).
# TopoLink: A software to validate structural models using chemical crosslinking constraints.
# Nature Protocol Exchange. 10.1038/protex.2017.035.
#
# Obtain TopoLink software at http://leandro.iqm.unicamp.br/topolink/home.shtml
#
######
logList <- readLines(loglistLocation)
logTableList <- list()
progressBar <- txtProgressBar(min = 0, max = length(logList), style = 3)
for (i in 1:length(logList)){
logPath <- paste0(topolinkLogsDirectory, logList[i])
logTableList[[logList[i]]] <- readLines(logPath)
filterVector <- grep(pattern = 'LINK:', x = logTableList[[logList[i]]])
logTableList[[logList[i]]] <- logTableList[[logList[i]]][filterVector]
logTableList[[logList[i]]] <- read.table(text = logTableList[[logList[i]]],
header = FALSE)
setTxtProgressBar(progressBar, i)
}
names(logTableList) = logList
return(logTableList)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.