Remove sequencing runs argument from repertoire

This commit is contained in:
coolneng 2021-04-21 19:59:38 +02:00
parent 18ffbf9a75
commit 5154a35fca
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 7 additions and 9 deletions

View File

@ -10,9 +10,7 @@ generate_repertoire <- function(number_of_sequences) {
)) ))
} }
process_data <- function(repertoire, reads) { process_data <- function(data) {
columns <- c("sequence", "v_call", "j_call")
data <- repertoire[, columns]
dna_sequence <- Biostrings::DNAStringSet(data$sequence) dna_sequence <- Biostrings::DNAStringSet(data$sequence)
data$sequence <- Biostrings::reverseComplement(dna_sequence) data$sequence <- Biostrings::reverseComplement(dna_sequence)
names(data$sequence) <- paste(rownames(data), data$v_call, data$j_call) 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() { parse_cli_arguments <- function() {
args <- commandArgs(trailingOnly = TRUE) args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 2) { if (length(args) != 1) {
stop("usage: repertoire.r <number of sequences> <sequencing runs>") stop("usage: repertoire.r <number of sequences>")
} }
return(c(args[1], args[2])) return(args[1])
} }
args <- parse_cli_arguments() argument <- parse_cli_arguments()
repertoire <- generate_repertoire(number_of_sequences = as.integer(args[1])) repertoire <- generate_repertoire(number_of_sequences = as.integer(argument))
process_data(repertoire = repertoire, reads = as.integer(args[2])) process_data(data = repertoire)