Change output format to FASTA

This commit is contained in:
coolneng 2021-03-02 20:08:14 +01:00
parent deb1066982
commit d2e45bc00f
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
2 changed files with 8 additions and 9 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
*.txt *.txt
*.fastq *.fasta

View File

@ -1,7 +1,7 @@
library(immuneSIM) library(immuneSIM)
library(Biostrings) library(Biostrings)
generate_repertoires <- function(number_of_sequences) { generate_repertoire <- function(number_of_sequences) {
b_chain <- immuneSIM( b_chain <- immuneSIM(
number_of_seqs = number_of_sequences, number_of_seqs = number_of_sequences,
species = "hs", species = "hs",
@ -22,9 +22,8 @@ preprocess_data <- function(repertoire, sequencing_runs) {
} }
save_data <- function(repertoire) { save_data <- function(repertoire) {
file_name <- "data/sequence.fastq" file_name <- "data/sequence.fasta"
# TODO Change format to fasta Biostrings::writeXStringSet(repertoire, file_name, format = "fasta")
Biostrings::writeXStringSet(repertoire, file_name, format = "fastq")
} }
parse_cli_arguments <- function(args) { parse_cli_arguments <- function(args) {
@ -35,9 +34,9 @@ parse_cli_arguments <- function(args) {
} }
args <- commandArgs(trailingOnly = TRUE) args <- commandArgs(trailingOnly = TRUE)
parameters <- parse_cli_arguments(args) arguments <- parse_cli_arguments(args)
number_of_sequences <- as.integer(parameters[1]) number_of_sequences <- as.integer(arguments[1])
sequencing_runs <- as.integer(parameters[2]) sequencing_runs <- as.integer(arguments[2])
repertoire <- generate_repertoires(number_of_sequences) repertoire <- generate_repertoire(number_of_sequences)
processed_data <- preprocess_data(repertoire, sequencing_runs) processed_data <- preprocess_data(repertoire, sequencing_runs)
save_data(processed_data) save_data(processed_data)