locigenesis/src/repertoire.r

32 lines
739 B
R
Raw Normal View History

library(immuneSIM)
2021-02-25 20:00:35 +01:00
generate_repertoires <- function(number_of_sequences) {
a_chain <- immuneSIM(
number_of_seqs = number_of_sequences,
species = "hs",
receptor = "tr",
chain = "a",
verbose = TRUE
)
b_chain <- immuneSIM(
number_of_seqs = number_of_sequences,
species = "hs",
receptor = "tr",
chain = "b",
verbose = TRUE
)
return(list("a_chain" = a_chain, "b_chain" = b_chain))
}
parse_cli_arguments <- function(args) {
if (length(args) != 1) {
stop("usage: repertoire.r <number of sequences>")
}
return(as.integer(args[1]))
}
args <- commandArgs(trailingOnly = TRUE)
number_of_sequences <- parse_cli_arguments(args)
sim_repertoire <- generate_repertoires(number_of_sequences)