[Seqinr-commits] r2121 - in pkg: R man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Thu May 20 11:23:54 CEST 2021
Author: simonpenel
Date: 2021-05-20 11:23:54 +0200 (Thu, 20 May 2021)
New Revision: 2121
Modified:
pkg/R/dist.alignment.R
pkg/man/dist.alignment.Rd
Log:
Argument gap is now a boolean
Modified: pkg/R/dist.alignment.R
===================================================================
--- pkg/R/dist.alignment.R 2021-05-20 07:56:36 UTC (rev 2120)
+++ pkg/R/dist.alignment.R 2021-05-20 09:23:54 UTC (rev 2121)
@@ -2,7 +2,7 @@
# Pairwise Distances from Aligned Protein or DNA/RNA Sequences
#
-dist.alignment <- function(x, matrix = c("identity", "similarity"),gap )
+dist.alignment <- function(x, matrix = c("identity", "similarity"),gap = FALSE )
{
#
# Check arguments:
@@ -26,12 +26,12 @@
#
# Call the C distance function:
#
- if (missing(gap)) {
- dist <- .Call("distance", sequences, nbseq, matNumber, seqtype,0, PACKAGE = "seqinr")
- }
+ if (gap == TRUE) {
+ dist <- .Call("distance", sequences, nbseq, matNumber, seqtype,1, PACKAGE = "seqinr")
+ }
else {
- dist <- .Call("distance", sequences, nbseq, matNumber, seqtype,gap, PACKAGE = "seqinr")
- }
+ dist <- .Call("distance", sequences, nbseq, matNumber, seqtype,0, PACKAGE = "seqinr")
+ }
#
# Convert the result in a object of class dist:
#
Modified: pkg/man/dist.alignment.Rd
===================================================================
--- pkg/man/dist.alignment.Rd 2021-05-20 07:56:36 UTC (rev 2120)
+++ pkg/man/dist.alignment.Rd 2021-05-20 09:23:54 UTC (rev 2121)
@@ -17,7 +17,7 @@
\item{x}{an object of class \code{alignment}, as returned by
\code{read.alignment} for instance}
\item{matrix}{the matrix distance to be used, partial matching allowed }
- \item{gap}{-optional- with nucleotides, if set to 1, gaps will be counted in the identity measure }
+ \item{gap}{-optional- logical, with identity matrix, if set to \code{TRUE}, gaps will be counted in the identity measure }
}
\value{
The distance matrix, object of class \code{dist}, computed by using the
More information about the Seqinr-commits
mailing list