simonrharris / pyjar Goto Github PK
View Code? Open in Web Editor NEWA python implementation of the joint ancestral state reconstruction algorithm of Pupko et al
License: GNU General Public License v3.0
A python implementation of the joint ancestral state reconstruction algorithm of Pupko et al
License: GNU General Public License v3.0
Hi Simon,
I know the usual use case for this would probably be either single genes or a SNP alignment, but I want to relate the ancestral SNPs back to genome position. However, when I try to run this for a small tree (~22 taxa) using a full length bacterial genome alignment, I get errors.
File "/nfs/users/nfs_m/mb29/programs/pyjar/pyjar.py", line 416, in <module>
main()
File "/nfs/users/nfs_m/mb29/programs/pyjar/pyjar.py", line 412, in main
jar(args.alignment, args.tree, args.info, args.prefix, args.verbose)
File "/nfs/users/nfs_m/mb29/programs/pyjar/pyjar.py", line 342, in jar
node.r=node.C[i]
KeyError: None```
This is your code sniping that refers to "node.r=node.C[i]"
332 #Traverse the tree from the root in the direction of the OTUs, assigning to each node its most likely ancestral character as follows:
333 threestart=time.clock()
334 for node in tree.preorder_node_iter():
335
336 try:
337 #5a. Visit an unreconstructed internal node x whose father y has already been reconstructed. Denote by i the reconstructed amino acid at node y.
338 i=node.parent_node.r
339 except AttributeError:
340 continue
341 #5b. Reconstruct node x by choosing Cx(i).
342 node.r=node.C[i]
343 #new_alignment[node.taxon.label].append(node.r)
344
If I give pyjar the equivalent multiple sequence alignment preprocessed with sites-sites, it works fine... Can pyjar handle full length sequences?
Thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.