[Seqinr-commits] r1557 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Feb 12 16:19:27 CET 2009


Author: lobry
Date: 2009-02-12 16:19:27 +0100 (Thu, 12 Feb 2009)
New Revision: 1557

Modified:
   pkg/R/al2bp.R
Log:
new split argument

Modified: pkg/R/al2bp.R
===================================================================
--- pkg/R/al2bp.R	2009-02-12 12:09:00 UTC (rev 1556)
+++ pkg/R/al2bp.R	2009-02-12 15:19:27 UTC (rev 1557)
@@ -1,7 +1,7 @@
-al2bp <- function(allele.name, repeat.bp = 4, offLadderChars = "><"){
+al2bp <- function(allele.name, repeat.bp = 4, offLadderChars = "><", split = "\\."){
   allele.name <- as.character(allele.name)
   if(any(s2c(allele.name) %in% s2c(offLadderChars))) return(NA)	
-  dec <- unlist(strsplit(allele.name, split = "\\."))
+  dec <- unlist(strsplit(allele.name, split = split))
   res <- repeat.bp*suppressWarnings(as.numeric(dec[1]))
          # NA are returned for X and Y at Amelogenin locus for instance
   if(length(dec) > 1) res <- res + as.numeric(dec[2])



More information about the Seqinr-commits mailing list