Difficulty with msaConvert function in R package
1
0
Entering edit mode
@25b49ca9
Last seen 8 months ago
Portugal

Hello,

I have been using the "msa" R package, and it has been working great. However, I recently got some warning messages when using the "msaConvert" function to convert an "MsaDNAMultipleAlignment" object into a "DNAbin" object. The warning messages are as follows:

Code should be placed in three backticks as shown below

#Input
library(msa)
converted<- msaConvert(alignment,type="ape::DNAbin")
#output
Base composition:
  a   c   g   t
NaN NaN NaN NaN
(Total: 5.82 kb)
Warning messages:
1: In f(x) : NAs introduced by coercion
2: In f(x) : NAs introduced by coercion
3: In f(x) : out-of-range values treated as 0 in coercion to raw

My alignment object seems to be fine, the trouble happens when converting into the "DNAbin".

The problem is further noticeable when I try to construct a distance matrix out of my alignment using the "ape" package using the following command:

matrix_dist<-dist.dna(converted, model = "K80",as.matrix = T)

Do you have any suggestions that may resolve the issue or any idea what may be causing it?

Thank you so much, João

ape msa • 370 views
ADD COMMENT
0
Entering edit mode
UBodenhofer ▴ 290
@ubodenhofer-5425
Last seen 14 days ago
University of Applied Sciences Upper Au…

Sorry for the late reply here, I overlooked this post. We have sorted this out already in a private communication. However, I want to share the reply with the community, even if it comes really late:

This issue is caused by a change in the interface of the 'ape' package. It should be fixed in the next release (current devel). There is also a workaround in case that you can't/don't want to wait:

### Do not load the ‘ape’ package yet!
alignment <- msa(mySequences, type="dna",method="ClustalW")
converted<- msaConvert(alignment, type="ape::DNAbin")
class(converted) <- "matrix"

## now load ‘ape’
library(ape)
converted <- as.DNAbin(converted)
## now ‘converted’ is a proper ‘DNAbin’ object
ADD COMMENT

Login before adding your answer.

Traffic: 549 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