<commit_before># This file is part of sbpipe.
#
# sbpipe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# sbpipe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with sbpipe.  If not, see <http://www.gnu.org/licenses/>.
#
#
#
# $Revision: 3.0 $
# $Author: <NAME> $
# $Date: 2016-07-7 16:14:32 $



# Retrieve the environment variable SBPIPE
SBPIPE <- Sys.getenv(c("SBPIPE"))
source(file.path(SBPIPE, 'sbpipe','R','sbpipe_sim.r'))


# R Script to plot time courses and collect statistics.
#
# :args[1]: the model name without extension
# :args[2]: the input directory
# :args[3]: the output directory
# :args[4]: the output file name containing the statistics
# :args[5]: the output template file storing the summary of model simulation repeats
# :args[6]: the file containing the experimental data.
# :args[7]: TRUE if the experimental data should also be plotted
# :args[8]: the label for the x axis (e.g. Time [min])
# :args[9]: the label for the y axis (e.g. Level [a.u.])
main <- function(args) {
    model_noext <- args[1]
    inputdir <- args[2]
    outputdir <- args[3]
    outputfile <- args[4]
    repeats_file_template <- args[5]
    exp_dataset <- args[6]
    plot_exp_dataset <- args[7]
    xaxis_label <- args[8]
    yaxis_label <- args[9]

    if(plot_exp_dataset == 'True' || plot_exp_dataset == 'TRUE' || plot_exp_dataset == 'true') {
       plot_exp_dataset = TRUE
    } else {
       plot_exp_dataset = FALSE
    }

    # generate a table of statistics
    gen_stats_table(inputdir, outputdir, model_noext, outputfile, xaxis_label, yaxis_label)

    # summarise the time course repeats in tables
    summarise_data(inputdir, model_noext, repeats_file_template)

    # plot the time courses
    plot_sep_sims(dirname(repeats_file_template), outputdir, model_noext, exp_dataset, plot_exp_dataset, xaxis_label, yaxis_label)<commit_msg>Skip heatmap and multiple time course plot if only one simulation is run. This is generally the case for deterministic simulations. In any case, these two plot types are just redundant.<commit_after># This file is part of sbpipe.
#
# sbpipe is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# sbpipe is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with sbpipe.  If not, see <http://www.gnu.org/licenses/>.
#
#
#
# $Revision: 3.0 $
# $Author: <NAME> $
# $Date: 2016-07-7 16:14:32 $



# Retrieve the environment variable SBPIPE
SBPIPE <- Sys.getenv(c("SBPIPE"))
source(file.path(SBPIPE, 'sbpipe','R','sbpipe_sim.r'))


# R Script to plot time courses and collect statistics.
#
# :args[1]: the model name without extension
# :args[2]: the input directory
# :args[3]: the output directory
# :args[4]: the output file name containing the statistics
# :args[5]: the output template file storing the summary of model simulation repeats
# :args[6]: the file containing the experimental data.
# :args[7]: TRUE if the experimental data should also be plotted
# :args[8]: the label for the x axis (e.g. Time [min])
# :args[9]: the label for the y axis (e.g. Level [a.u.])
main <- function(args) {
    model_noext <- args[1]
    inputdir <- args[2]
    outputdir <- args[3]
    outputfile <- args[4]
    repeats_file_template <- args[5]
    exp_dataset <- args[6]
    plot_exp_dataset <- args[7]
    xaxis_label <- args[8]
    yaxis_label <- args[9]

    if(plot_exp_dataset == 'True' || plot_exp_dataset == 'TRUE' || plot_exp_dataset == 'true') {
       plot_exp_dataset = TRUE
    } else {
       plot_exp_dataset = FALSE
    }

    # generate a table of statistics
    gen_stats_table(inputdir, outputdir, model_noext, outputfile, xaxis_label, yaxis_label)

    # summarise the time course repeats in tables
    summarise_data(inputdir, model_noext, repeats_file_template)

    # plot the time courses
    files <- list.files( path=inputdir, pattern=model_noext )
    if(length(files) > 1) {
        plot_sep_sims(dirname(repeats_file_template), outputdir, model_noext, exp_dataset, plot_exp_dataset, xaxis_label, yaxis_label)
    }
{'fraction_non_alphanumeric': 0.10179518563851489, 'fraction_numerical': 0.014075887392900856, 'mean_word_length': 3.99796126401631, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6582297', 'n_tokens_mistral': 1563, 'n_tokens_neox': 1484, 'n_words': 565}