| 1 | #!/usr/bin/env perl | ||
| 2 | # PODNAME: tree2list.pl | ||
| 3 | # ABSTRACT: Generate id lists from tree tips | ||
| 4 | |||
| 5 | use Modern::Perl '2011'; | ||
| 6 | use autodie; | ||
| 7 | |||
| 8 | use Getopt::Euclid qw(:vars); | ||
| 9 | use Smart::Comments; | ||
| 10 | |||
| 11 | use Bio::MUST::Core; | ||
| 12 | use Bio::MUST::Core::Utils qw(change_suffix); | ||
| 13 | use aliased 'Bio::MUST::Core::Tree'; | ||
| 14 | |||
| 15 | |||
| 16 | for my $infile (@ARGV_infiles) { | ||
| 17 | |||
| 18 | ### Processing: $infile | ||
| 19 | my $tree = Tree->load($infile); | ||
| 20 | my $list = $ARGV_sort ? $tree->alphabetical_list : $tree->std_list; | ||
| 21 | my $outfile = change_suffix($infile, '.idl'); | ||
| 22 | $list->store($outfile); | ||
| 23 | } | ||
| 24 | |||
| 25 | __END__ |