From 5154a35fca5b3c51c561fcad471e73422bbe0b78 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 21 Apr 2021 19:59:38 +0200 Subject: [PATCH] Remove sequencing runs argument from repertoire --- src/repertoire.r | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/repertoire.r b/src/repertoire.r index f38ed88..13c47fa 100644 --- a/src/repertoire.r +++ b/src/repertoire.r @@ -10,9 +10,7 @@ generate_repertoire <- function(number_of_sequences) { )) } -process_data <- function(repertoire, reads) { - columns <- c("sequence", "v_call", "j_call") - data <- repertoire[, columns] +process_data <- function(data) { dna_sequence <- Biostrings::DNAStringSet(data$sequence) data$sequence <- Biostrings::reverseComplement(dna_sequence) names(data$sequence) <- paste(rownames(data), data$v_call, data$j_call) @@ -21,12 +19,12 @@ process_data <- function(repertoire, reads) { parse_cli_arguments <- function() { args <- commandArgs(trailingOnly = TRUE) - if (length(args) != 2) { - stop("usage: repertoire.r ") + if (length(args) != 1) { + stop("usage: repertoire.r ") } - return(c(args[1], args[2])) + return(args[1]) } -args <- parse_cli_arguments() -repertoire <- generate_repertoire(number_of_sequences = as.integer(args[1])) -process_data(repertoire = repertoire, reads = as.integer(args[2])) \ No newline at end of file +argument <- parse_cli_arguments() +repertoire <- generate_repertoire(number_of_sequences = as.integer(argument)) +process_data(data = repertoire)