Hi,

I am having a problem with write.nexus.data, such that the file generated
is nonsense.

I have a very, very large data set, but have been working with a subset
trying to solve this problem. My data is in .fasta format, and I am looking
to convert it into nexus format.

I load the data:

> library(ape)
> data <- read.dna("concat.fasta", format="fasta", as.matrix=TRUE)

This gives the following:

> data
> 5 DNA sequences in binary format stored in a matrix

    All sequences of same length: 5023

    Labels: Species etc.

    Base composition: a c g t

Also:

> class(data)
> "DNAbin"

This is exactly the same as the woodmouse example data provided in the
package ape, which I have been following when trying to solve this issue
(see ?write.nexus.data). When I export the data:

> write.nexus.data(data, file="test.nex", interleaved=TRUE,
charsperline=100)

a file is produced which begins:

BEGIN DATA;
  DIMENSIONS NTAX=135165 NCHAR=1;
  FORMAT DATATYPE=DNA MISSING=? GAP=- INTERLEAVE=YES;
  MATRIX
    1           04000000000 etc.

I haven't been able to find other posts on this, any help is greatly
appreciated.

Sincerely,

Nick


-- 
Nicholas Crouch
Graduate Student, Igić Lab
Department of Biological Sciences
University of Illinois at Chicago

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-phylo mailing list - R-sig-phylo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-phylo
Searchable archive at http://www.mail-archive.com/r-sig-phylo@r-project.org/

Reply via email to