-## write.dna.R (2012-05-03)
+## write.dna.R (2012-06-22)
## Write DNA Sequences in a File
fmt <- paste("%-", max.nc + 1, "s", sep = "")
names(x) <- sprintf(fmt, names(x))
}
- if (format == "interleaved") {
+ switch(format, "interleaved" = {
## Write the first block with the taxon names
colsel <- if (nb.block == 1) 1:totalcol else 1:nbcol
for (i in 1:N) {
}
}
- }
- if (format == "sequential") {
+ }, "sequential" = {
if (nb.block == 1) {
for (i in 1:N) {
cat(names(x)[i], file = zz)
}
}
}
- }
- if (format == "fasta") {
+ }, "fasta" = {
for (i in 1:N) {
- cat(">", names(x)[i], file = zz)
+ cat(">", names(x)[i], file = zz, sep = "")
cat("\n", file = zz)
X <- paste(x[[i]], collapse = "")
S <- length(x[[i]])
cat("\n", file = zz)
}
}
- }
+ })
}