diff --git a/src/repertoire.r b/src/repertoire.r index 4ed9b55..b7a5d83 100644 --- a/src/repertoire.r +++ b/src/repertoire.r @@ -34,6 +34,12 @@ preprocess_data <- function(repertoires) { return(filtered_repertoires) } +save_data <- function(repertoires) { + for (chain in names(repertoires)) { + file_name <- paste("data/", chain, ".fastq", sep = "") + Biostrings::writeXStringSet(repertoires[[chain]], file_name, format = "fastq") + } +} parse_cli_arguments <- function(args) { if (length(args) != 1) { @@ -46,3 +52,4 @@ args <- commandArgs(trailingOnly = TRUE) number_of_sequences <- parse_cli_arguments(args) sim_repertoire <- generate_repertoires(number_of_sequences) processed_data <- preprocess_data(sim_repertoire) +save_data(processed_data) \ No newline at end of file