From 53dda36c66b1eafce128b74f1b8f646ea79c698c Mon Sep 17 00:00:00 2001 From: coolneng Date: Fri, 26 Feb 2021 02:20:11 +0100 Subject: [PATCH] Export the data to FASTQ files --- src/repertoire.r | 7 +++++++ 1 file changed, 7 insertions(+) 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