From 2cece5e53e020dd8dbafa8312a9985b0845ea392 Mon Sep 17 00:00:00 2001 From: coolneng Date: Thu, 25 Feb 2021 20:02:11 +0100 Subject: [PATCH] Set number of sequences via a CLI argument --- src/repertoire.r | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/repertoire.r b/src/repertoire.r index ebfe7ce..1a5cefc 100644 --- a/src/repertoire.r +++ b/src/repertoire.r @@ -19,3 +19,13 @@ generate_repertoires <- function(number_of_sequences) { } +parse_cli_arguments <- function(args) { + if (length(args) != 1) { + stop("usage: repertoire.r ") + } + return(as.integer(args[1])) +} + +args <- commandArgs(trailingOnly = TRUE) +number_of_sequences <- parse_cli_arguments(args) +sim_repertoire <- generate_repertoires(number_of_sequences)