[Biopython] Deprecating and renaming some keyword args in Phylo/NewickIO

Eric Talevich eric.talevich at gmail.com
Fri Jun 10 16:33:00 UTC 2011


Folks,

I'd like to rename several optional arguments used for the Newick parser and
writer in Bio.Phylo. The old argument names will be supported in Biopython
1.58, but trigger a deprecation warning, and then be removed in version
1.59.

The changed functions are in Bio.Phylo.NewickIO.

Parser.parse:
  values_are_support  =>  values_are_confidence
(This isn't currently accessible through Phylo.read/parse or
NewickIO.read/parse, but I will enable that in the next release.)

Writer.write:
  support_as_branchlengths  =>  confidence_as_branch_length
  max_support  =>  max_confidence
  branchlengths_only  =>  branch_length_only


Example:

tree = Phylo.read(infile, 'newick', values_are_support=True)
Phylo.write(tree, outfile, 'newick', support_as_branchlengths=True,
max_support=100)

becomes:

tree = Phylo.read(infile, 'newick', values_are_confidence=True)
Phylo.write(tree, outfile, 'newick', confidence_as_branch_length=True,
max_confidence=100)


Why? NewickIO was originally ported from Bio.Nexus.Trees, where tree node
objects have an attribute called 'support', equivalent to clade.confidence.
Since this attribute is called 'confidence' in Bio.Phylo, these original
argument names no longer make sense. Oops. Also, branch_length grew an
underscore in Bio.Phylo.

So, does anyone have a problem with deprecating these arguments in the next
release, and removing them after that?

Thanks,
Eric



More information about the Biopython mailing list