Error with reading fasta file into R - "arguments imply differing number of rows"
0
2
Entering edit mode
7.2 years ago

Hi, I'm new to using R studio and I'm using the phangorn package. I'm trying to read in an alignment with a fast file containing protein sequences, but it is showing me an error:

Error in (function (..., row.names = NULL, check.rows = FALSE, check.names = TRUE, : arguments imply differing number of rows: 279, 305, 343, 331, 285, 253, 315, 302, 301, 311, 633, 644, 662, 563

This is what I tried and I cannot figure out why I'm getting the error.

library(phangorn)

file = "Loxosceles_reclusa.fasta"

dat = read.phyDat("Loxosceles_reclusa.fasta", format = "fasta", type = "AA")

Could someone please help me find out what the problem here is? Thank you so much!

R alignment software error fasta read.phydat • 4.7k views
ADD COMMENT
1
Entering edit mode

I get the same error. A quick look at the code doesn't reveal much, read.phyDat() calls read.FASTA.AA()and then that function's definition doesn't give me an immediate cause. I suggest you file an issue in github, where the author seems to keep developing.

ADD REPLY
0
Entering edit mode

I have seen this error in R before with other tasks I have done. I would start by making sure your fasta file is properly formatted. Is each amino acid sequence only on one line (not a multiline fasta)? Are there no blank lines in the fasta file? Is the line ending character compatible; Windows line ending character (CR and LF) versus Linux line ending character (LF)? Does each fasta record start with the greater than character (>)? Since you are specifying amino acid fasta just double check to be sure the sequences are actually amino acid characters.

ADD REPLY

Login before adding your answer.

Traffic: 2455 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6