Compare commits

..

2 Commits

2 changed files with 8 additions and 10 deletions

View File

@ -19,5 +19,5 @@ fastq=".fastq"
filename="sequence"
prefix="curesim_"
Rscript src/repertoire.r "$sequences" "$sequencing_runs" && java -jar tools/CuReSim.jar -n "$sequencing_runs" -m "$read_mean_size" -sd "$read_variance_size" -f "$data_directory$filename$fasta" -o "$data_directory$prefix$filename$fastq"
Rscript src/repertoire.r "$sequences" && java -jar tools/CuReSim.jar -n $((sequencing_runs * sequences)) -m "$read_mean_size" -sd "$read_variance_size" -f "$data_directory$filename$fasta" -o "$data_directory$prefix$filename$fastq"
rm "$data_directory/log.txt"

View File

@ -10,9 +10,7 @@ generate_repertoire <- function(number_of_sequences) {
))
}
process_data <- function(repertoire, reads) {
columns <- c("sequence", "v_call", "j_call")
data <- repertoire[, columns]
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)
@ -21,12 +19,12 @@ process_data <- function(repertoire, reads) {
parse_cli_arguments <- function() {
args <- commandArgs(trailingOnly = TRUE)
if (length(args) != 2) {
stop("usage: repertoire.r <number of sequences> <sequencing runs>")
if (length(args) != 1) {
stop("usage: repertoire.r <number of sequences>")
}
return(c(args[1], args[2]))
return(args[1])
}
args <- parse_cli_arguments()
repertoire <- generate_repertoire(number_of_sequences = as.integer(args[1]))
process_data(repertoire = repertoire, reads = as.integer(args[2]))
argument <- parse_cli_arguments()
repertoire <- generate_repertoire(number_of_sequences = as.integer(argument))
process_data(data = repertoire)