Error while reading mlc file from CODEML into ggtree/treeio in R
1
0
Entering edit mode
4.1 years ago

I'm trying to read an mlc file (output from CODEML program) using the read.codeml_mlc function from the treeio package in R, as follows:

tree <- read.codeml_mlc(mlc_file)

However, I'm getting the following error:

Error in strsplit(., split = "[[:space:]]") : non character argument

Does anyone have an idea of what could be wrong? This is an ordinary mlc output from PAML from a free ratio branch model, I have not modified or altered it. However, the error seems to be related to my file, because I have tried running the example from the tutorial (reading the mlc file provided with the package) and it works fine.

Put it some other way: Where does the strsplit function come about when reading the mlc file and what part exactly of the file is it referring to? Maybe knowing that will help solve my problem.

Thanks in advance for any help that could be provided!!

ggtree treeio software error R phylogenetics • 1.8k views
ADD COMMENT
2
Entering edit mode
4.1 years ago
Fatima ▴ 1000

It might be the strsplit at the end of this script:

https://github.com/YuLab-SMU/treeio/blob/master/R/paml.R

nodeNum <- strsplit(paml[edge.idx], split="\\.\\.") %>%
        unlist %>% strsplit(split="[[:space:]]") %>% unlist

Is this the sample file that you used?

https://github.com/YuLab-SMU/treeio/blob/master/inst/extdata/PAML_Codeml/mlc

You can compare your edge indexes, branch and node Numbers with your file to see if they are valid.

ADD COMMENT
0
Entering edit mode

Hello Fatima! You're right, there is a problem with my mlc output file. For some reason, it does not contain the elements that indicate the branch and node numbers, so I guess the solution is fixing that from PAML and then trying treeio again! Thanks so much!!

ADD REPLY
0
Entering edit mode

Dear Sir,

Have you solved this problem, kindly let me know how can I amend the mlc file in order to read by treeio.

Thnaks

ADD REPLY
0
Entering edit mode

Hello,

I have run into the same issue trying to read example input mlc file from the source you provided. I simply took the example mlc file from the source and saved it as "example.mlc". Here is my command mlcfile <- system.file("Users/Documents/ACE_PAML_analysis/", "example.mlc", package="treeio"). The command returns a n empty data file shown as " " in my R environment. Am I using the the example command correctly? Any guidance is greatly appreciated. Thank you.

ADD REPLY

Login before adding your answer.

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