How to parse Hyphy JSON output into treedata?
0
0
Entering edit mode
5 months ago
Shola • 0

I have two outputs from evolutionary software analysis I can upload to R studio: aPAML codeml .mlc file and a Hyphy aBSREL output in JSON format. I am currently using the treeio, jsonlite, tidyverse and data.table packages in R studio.

I would like to grab the omega values generated from the Hyphy.json file onto a tree containing all the information from the .mlc file using ggtree. I can grab the PAML tree and add the omega values from Hyphy, but I am stuck on how to parse out the Hyphy data into a format I can convert into tree data.

I've only gotten this far after reading both the manuals and looking online:

  1. I can open the file using jsonlite: fromJSON(). It is a list of lists and I am grabbing the second item in the file " branch attributes" The items in this list I want to grab are in another list with 10 items.
  2. I can transform this item into a data table but I am also wanting to figure out a way to iterate through uneven rows in these lists.

What I've tried and doesn't work/don't want

  1. Reading the output using read.jplace() or other programs in treeio.
  2. I can pull out the individual omega values, create a new column in the treedata in PAML and map it out on ggtree. However, I would like a way to get all my data in as a tree so I can plot that as well.

Thanks for the help.

JSON Datamonkey R-studio treeio PAML • 186 views
ADD COMMENT

Login before adding your answer.

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