diff --git a/DESCRIPTION b/DESCRIPTION index 6d5b129..351df9c 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -27,6 +27,7 @@ Imports: foreach, Rcpp (>= 0.11.3), Biostrings (>= 2.52.0), + pwalign (>= 1.6.0), RSQLite (>= 0.11.4), stringr (>= 0.6.2), IRanges, diff --git a/R/pairwise_aln.R b/R/pairwise_aln.R index 1b98658..4c8081d 100644 --- a/R/pairwise_aln.R +++ b/R/pairwise_aln.R @@ -15,8 +15,8 @@ #' @author Sarah Scharfenberg and Hajk-Georg Drost #' @details This function provides an interface between R and common pairwise alignment computation methods. #' -#' The current version of this function computes pairwise alignments based on the \code{\link[Biostrings]{pairwiseAlignment}} -#' function implemented in the \pkg{Biostrings} package. +#' The current version of this function computes pairwise alignments based on the \code{\link[pwalign]{pairwiseAlignment}} +#' function implemented in the \pkg{pwalign} package. #' #' The default pairwise alignment method is based on the \emph{Needleman-Wunsch Algorithm}. #' @@ -85,7 +85,7 @@ pairwise_aln <- function(file, ) } - # Needleman-Wunsch using Biostrings::pairwiseAlignment( type=global) + # Needleman-Wunsch using pwalign::pairwiseAlignment( type=global) if (tool == "NW") { #read file if (is.element(seq_type, c("dna", "cds"))) { @@ -122,25 +122,25 @@ pairwise_aln <- function(file, # align aln <- - Biostrings::pairwiseAlignment(pattern = seqs[[1]], - subject = seqs[[2]], - type = "global") + pwalign::pairwiseAlignment(pattern = seqs[[1]], + subject = seqs[[2]], + type = "global") #write file -> comment Hajk: what does pattern() and subject() do in pattern(aln), subject(aln) ? # pattern(aln) == get aligned sequence that was set as pattern input # subject(aln) == get aligned sequence that was set as subject input seqinr::write.fasta( - sequences = list(Biostrings::pattern(aln), IRanges::subject(aln)), + sequences = list(pwalign::pattern(aln), pwalign::subject(aln)), names = names, file.out = file.out ) if (store_locally) { local_store_path <- file.path("orthologr_alignment_files", "_pairwise_alignment_with_score") - Biostrings::writePairwiseAlignments(aln, file.path(local_store_path, paste0(pairwise_aln_name, "_", tool, "_", seqtype, ".aln"))) + pwalign::writePairwiseAlignments(aln, file.path(local_store_path, paste0(pairwise_aln_name, "_", tool, "_", seqtype, ".aln"))) } else { local_store_path <- file.path(tempdir(), "_pairwise_alignment_with_score") - Biostrings::writePairwiseAlignments(aln, file.path(local_store_path, paste0(pairwise_aln_name, "_", tool, "_", seqtype, ".aln"))) + pwalign::writePairwiseAlignments(aln, file.path(local_store_path, paste0(pairwise_aln_name, "_", tool, "_", seqtype, ".aln"))) } if (!quiet) {