From 18ffbf9a758c711c5661361bba9de947259cda21 Mon Sep 17 00:00:00 2001 From: coolneng Date: Wed, 21 Apr 2021 18:46:00 +0200 Subject: [PATCH] Add v_call and j_call to sequence ID --- src/repertoire.r | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/repertoire.r b/src/repertoire.r index 8904ad7..f38ed88 100644 --- a/src/repertoire.r +++ b/src/repertoire.r @@ -10,19 +10,13 @@ generate_repertoire <- function(number_of_sequences) { )) } -save_data <- function(data, reads) { - Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta") - vdj_sequences <- data[-1] - amplified_vdj <- vdj_sequences[rep(seq_len(nrow(vdj_sequences)), reads), ] - write.csv(amplified_vdj, "data/vdj_metadata.csv", row.names = FALSE) -} - process_data <- function(repertoire, reads) { - columns <- c("sequence", "junction", "v_call", "j_call") + columns <- c("sequence", "v_call", "j_call") data <- repertoire[, columns] dna_sequence <- Biostrings::DNAStringSet(data$sequence) data$sequence <- Biostrings::reverseComplement(dna_sequence) - save_data(data, reads) + names(data$sequence) <- paste(rownames(data), data$v_call, data$j_call) + Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta") } parse_cli_arguments <- function() {