Code Monkey home page Code Monkey logo

pyjar's People

Contributors

simonrharris avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pyjar's Issues

Reconstruction for full length sequences

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.