Export original CDR3 to a file

This commit is contained in:
coolneng 2021-04-22 11:54:40 +02:00
parent 83819b296b
commit 4adb92e901
Signed by: coolneng
GPG Key ID: 9893DA236405AF57
1 changed files with 8 additions and 2 deletions

View File

@ -10,11 +10,16 @@ generate_repertoire <- function(number_of_sequences) {
))
}
save_data <- function(data) {
Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta")
Biostrings::writeXStringSet(data$junction, "data/HVR.fasta")
}
process_data <- function(data) {
dna_sequence <- Biostrings::DNAStringSet(data$sequence)
data$sequence <- Biostrings::reverseComplement(dna_sequence)
names(data$sequence) <- paste(rownames(data), data$v_call, data$j_call, " ")
Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta")
return(data)
}
parse_cli_arguments <- function() {
@ -27,4 +32,5 @@ parse_cli_arguments <- function() {
argument <- parse_cli_arguments()
repertoire <- generate_repertoire(number_of_sequences = as.integer(argument))
process_data(data = repertoire)
data <- process_data(data = repertoire)
save_data(data)