text: user3142: I am working on protein sequence data files for reconstructing phylogenetic tree and I need to generate all NNI-neighbours of the tree (two trees are NNI-neighbours if one can be transformed into another by one nearest neighbour interchange operation). Is there any python package/sorce code I can access to, which can retrieve all NNI neighbors of a tree.
  Earlier I have used biopython 1.72 to generate tree from my dataset. But for now I'm looking for a python package which can do NNI search on my tree and return all NNI-neighbors.
  
  user2841: Both the ETE Toolkit and DendroPy offer methods of node removal and reattachment - I would think it would be easy enough to hack together an NNI movement function with them. 
  You could also investigate the source code of BioPython's NNITreeSearcher() function.
  
original_text: 3142: <p>I am working on protein sequence data files for reconstructing phylogenetic tree and I need to generate all <strong>NNI-neighbours</strong> of the tree (two trees are NNI-neighbours if one can be transformed into another by one nearest neighbour interchange operation). Is there any python <strong>package/sorce code</strong> I can access to, which can retrieve all NNI neighbors of a tree.
  Earlier I have used biopython 1.72 to generate tree from my dataset. But for now I'm looking for a python package which can do NNI search on my tree and return all NNI-neighbors.</p>
   2841: <p>Both the <a href="http://etetoolkit.org/docs/latest/index.html" rel="nofollow noreferrer">ETE Toolkit</a> and <a href="https://dendropy.org/#" rel="nofollow noreferrer">DendroPy</a> offer methods of node removal and reattachment - I would think it would be easy enough to hack together an NNI movement function with them. </p>
  
  <p>You could also investigate the source code of <a href="https://biopython.org/wiki/Phylo" rel="nofollow noreferrer">BioPython's</a> <code>NNITreeSearcher()</code> function.</p>
  