Hi Jarrett,

This has been working for me using the package ‘apex':

x <- read.multiFASTA(files) # creates a multiDNA object
genes <- x@dna[] # creates a list with your loci.

I hope this helps.

Best
Gustavo

Em qui., 12 de mar. de 2020 às 11:18, Jarrett Phillips <
phillipsjarre...@gmail.com> escreveu:

> Hi All,
>
> I have a folder with multiple FASTA files which need to be read into R.
>
> To avoid file overwriting, I use ape::rbind.DNAbin() as follows:
>
> file.names <- list.files(path = envr$filepath, pattern = ".fas")
>           tmp <- matrix()
>           for (i in 1:length(file.names)) {
>             seqs <- read.dna(file = file.names[i], format = "fasta")
>             seqs <- rbind.DNAbin(tmp, seqs)
>           }
>
> When run however, I get an error saying that the files do not have the same
> number of columns (i.e., alignments are all not of the same length).
>
> How can I avoid this error. I feel that it's a basic fix, but one that is
> not immediately obvious to me.
>
> Thanks!
>
>         [[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/
>


-- 
*Gustavo Silva de Miranda*
Peter Buck Postdoctoral Fellow - GGI <https://ggi.si.edu/>
Department of Entomology
National Museum of Natural History
Smithsonian Institution
Personal website <http://gustavomiranda.weebly.com/> | Google Scholar
<https://scholar.google.com.br/citations?user=dXEGc40AAAAJ&hl=en> |
ResearchGate
<https://www.researchgate.net/profile/Gustavo_Miranda4>|
ORCID <http://orcid.org/0000-0002-2895-9331> | Publons
<https://publons.com/a/637460/> | Curriculum Lattes
<http://buscatextual.cnpq.br/buscatextual/visualizacv.do?id=K4270248D7> (PT)
*Editor:* Check List <https://checklist.pensoft.net/> | A Bruxa
<https://www.revistaabruxa.com/>

        [[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