topiary.pastml

topiary.pastml.pastml

Interface to pastml library.

topiary.pastml.pastml.get_ancestral_gaps(alignment_file, tree_file, prediction_method='DOWNPASS')

Get ancestral gaps from an alignment and raxml output tree file. Gaps are reconstructed by parsimony using the DOWNPASS algorithm as implemented in pastml.

Parameters:
  • alignment_file (str) – phy file used to generate ancestors in RAxML

  • tree_file (str) – output tree file with labeled internal nodes

  • prediction_method (str, default="DOWNPASS") – method to reconstruct gaps.

Returns:

gap_anc_dict – dictionary keying internal node names to lists of True (gap), False (no gap), and None (gapping unclear) for each site in that ancestor.

Return type:

dict