[Seqinr-commits] r1764 - pkg/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Dec 7 17:21:05 CET 2011


Author: simonpenel
Date: 2011-12-07 17:21:05 +0100 (Wed, 07 Dec 2011)
New Revision: 1764

Modified:
   pkg/R/read.alignment.R
Log:
read.alignment now return an error message is return when the format is not correct. Thanks to Dave Gerrard for signaling this bug.


Modified: pkg/R/read.alignment.R
===================================================================
--- pkg/R/read.alignment.R	2011-10-12 09:17:54 UTC (rev 1763)
+++ pkg/R/read.alignment.R	2011-12-07 16:21:05 UTC (rev 1764)
@@ -7,14 +7,21 @@
   # Check that we have read permission on the file:
   #
   if(file.access(file, mode = 4) != 0) stop(paste("File", file, "is not readable"))
-
+  
   ali <- switch( format,
 	fasta = .Call("read_fasta_align", file, PACKAGE = "seqinr"), 
+	FASTA = .Call("read_fasta_align", file, PACKAGE = "seqinr"), 
 	mase = .Call("read_mase", file, PACKAGE = "seqinr"),
+	MASE = .Call("read_mase", file, PACKAGE = "seqinr"),
 	phylip = .Call("read_phylip_align", file, PACKAGE = "seqinr"),
+	PHYLIP = .Call("read_phylip_align", file, PACKAGE = "seqinr"),
 	msf = .Call("read_msf_align", file, PACKAGE = "seqinr"),
-	clustal = .Call("read_clustal_align", file, PACKAGE = "seqinr")
+	MSF = .Call("read_msf_align", file, PACKAGE = "seqinr"),
+	CLUSTAL = .Call("read_clustal_align", file, PACKAGE = "seqinr"),
+	clustal = .Call("read_clustal_align", file, PACKAGE = "seqinr"),
+	stop("Wrong format name: Format available are fasta,mase,phylip,msf,clustal")
   )
+
   ali <- lapply(ali, as.character)
   if(forceToLower) ali[[3]] <- lapply(ali[[3]], tolower)
   if(format == "mase"){



More information about the Seqinr-commits mailing list