Remove redundant sequencing runs argument
This commit is contained in:
parent
13f453718d
commit
576597cb04
|
@ -19,6 +19,5 @@ fastq=".fastq"
|
||||||
filename="sequence"
|
filename="sequence"
|
||||||
prefix="curesim_"
|
prefix="curesim_"
|
||||||
|
|
||||||
Rscript src/repertoire.r "$sequences" "$sequencing_runs"
|
Rscript src/repertoire.r "$sequences" && 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"
|
||||||
java -jar tools/CuReSim.jar -m "$read_mean_size" -sd "$read_variance_size" -f "$data_directory$filename$fasta" -o "$data_directory$prefix$filename$fastq"
|
|
||||||
rm "$data_directory/log.txt"
|
rm "$data_directory/log.txt"
|
||||||
|
|
|
@ -10,44 +10,31 @@ generate_repertoire <- function(number_of_sequences) {
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
amplify_rows <- function(data, column, factor) {
|
|
||||||
if (column == "sequence") {
|
|
||||||
dna_string <- Biostrings::DNAStringSet(data)
|
|
||||||
reverse_complement <- Biostrings::reverseComplement(dna_string)
|
|
||||||
return(rep(reverse_complement, factor))
|
|
||||||
}
|
|
||||||
return(rep(data, factor))
|
|
||||||
}
|
|
||||||
|
|
||||||
save_data <- function(data) {
|
save_data <- function(data) {
|
||||||
Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta")
|
Biostrings::writeXStringSet(data$sequence, "data/sequence.fasta")
|
||||||
vdj_sequences <- data[-1]
|
vdj_sequences <- data[-1]
|
||||||
write.csv(vdj_sequences, "data/vdj_alignment.csv", row.names = FALSE)
|
write.csv(vdj_sequences, "data/vdj_alignment.csv", row.names = FALSE)
|
||||||
}
|
}
|
||||||
|
|
||||||
process_data <- function(repertoire, sequencing_runs) {
|
process_data <- function(repertoire) {
|
||||||
columns <- c(
|
columns <- c(
|
||||||
"sequence", "v_sequence_alignment",
|
"sequence", "v_sequence_alignment",
|
||||||
"d_sequence_alignment", "j_sequence_alignment"
|
"d_sequence_alignment", "j_sequence_alignment"
|
||||||
)
|
)
|
||||||
data <- repertoire[, columns]
|
data <- repertoire[, columns]
|
||||||
amplified_data <- mapply(data, names(data),
|
dna_sequence <- Biostrings::DNAStringSet(data$sequence)
|
||||||
sequencing_runs,
|
data$sequence <- Biostrings::reverseComplement(dna_sequence)
|
||||||
FUN = amplify_rows
|
save_data(data)
|
||||||
)
|
|
||||||
save_data(amplified_data)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
parse_cli_arguments <- function(args) {
|
parse_cli_arguments <- function() {
|
||||||
if (length(args) != 2) {
|
args <- commandArgs(trailingOnly = TRUE)
|
||||||
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 <- commandArgs(trailingOnly = TRUE)
|
args <- parse_cli_arguments()
|
||||||
arguments <- parse_cli_arguments(args)
|
repertoire <- generate_repertoire(number_of_sequences = as.integer(args[1]))
|
||||||
number_of_sequences <- as.integer(arguments[1])
|
process_data(repertoire)
|
||||||
sequencing_runs <- as.integer(arguments[2])
|
|
||||||
repertoire <- generate_repertoire(number_of_sequences)
|
|
||||||
process_data(repertoire, sequencing_runs)
|
|
Loading…
Reference in New Issue