[Bioperl-l] PhyloXML
Fields, Christopher J
cjfields at illinois.edu
Wed Feb 13 12:08:21 EST 2013
On Feb 13, 2013, at 10:21 AM, Moretti Sébastien <sebastien.moretti at unil.ch> wrote:
>>>>> # Add annotation
>>>>> $treeio->add_phyloXML_annotation(-obj => $tree,
>>>>> -xml => '<name>SUMF family</name>',
>>>>> );
>>>>
>>>> If you really have $treeio in your script in this line and not $tree, then that's at least one problem. But the stack suggests that the above isn't the exact line in your script - can you confirm that?
>>>>
>>>> -hilmar
>>>
>>> I replaced $treeio by $tree in the above line but still get an error.
>>> Don't see what you mean by "the stack suggests that the above isn't the exact line in your script"
>>>
>>> The only think I changed is the length of the xml string I try to insert. But get the same error with an empty xml string.
>>>
>>>
>>>
>>> my $treeio = new Bio::TreeIO(-file => "$infile",
>>> -format => 'phyloxml',
>>> );
>>> my $tree = $treeio->next_tree;
>>>
>>> # Add annotation
>>> $tree->add_phyloXML_annotation(-obj => $tree,
>>> -xml => '<name>SUMF family</name>',
>>> );
>>>
>>> Can't locate object method "add_phyloXML_annotation" via package
>>> "Bio::Tree::Tree" at ./add_annotation_to_phyloxml.pl line 40, <GEN0> line 1 (#1)
>>> (F) You called a method correctly, and it correctly indicated a package
>>> functioning as a class, but that package doesn't define that particular
>>> method, nor does any of its base classes. See perlobj.
>>>
>>> Uncaught exception from user code:
>>>
>>> at ./add_annotation_to_phyloxml.pl line 40
>>
>> Will have to look into this. One problem we have is that phyloXML support has dwindled, so if anyone wants to take this on I would be more than happy to help them get started.
>>
>> chris
>
> You mean that BioPerl 1.6.901 has not a full support of PhyloXML ?
> The problem I have is "expected" ?
>
> --
> Sébastien Moretti
I think it handles most of phyloXML fine, but the implementation of the parser is a little tricky. I tried cleaning this up a few years back but didn't make much progress.
The function is in Bio::TreeIO::phyloxml, so the correct call should be (as you previously had it):
$treeio->add_phyloXML_annotation(-obj => $tree,
-xml => '<name>SUMF family</name>',
);
My guess is that Bio::Tree::Tree was AnnotatableI at one point but that was removed, will have to trace that back. Can you file a bug on this?
https://redmine.open-bio.org/
chris
More information about the Bioperl-l
mailing list