/usr/bin/bp_tree2pag is in bioperl 1.7.1-2.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 | #!/usr/bin/perl
=head1 NAME
bp_tree2pag - convert Bio::TreeIO parseable format trees to pagel format
=head1 SYNOPSIS
bp_tree2pag -if nexus -i file.nexus > file.pag
# OR pipe in through STDIN, and use newick format instead
cat file.newick | bp_tree2pag -if newick > file.nh
# OR specify an output and input
bp_tree2pag -o file.pag -i file.newick
=head1 DESCRIPTION
Convert TreeIO parseable files into Pagel format tree files. Be
warned that pagel format only really supports a single tree per file
so. Also Pagel parsing is not yet available in bioperl.
=cut
use strict;
use warnings;
use Bio::TreeIO;
use Getopt::Long;
my ($iformat,$oformat) = ('newick', 'pag');
my ($outfile,$infile);
GetOptions(
'if|informat:s' => \$iformat,
'of|outformat:s' => \$oformat,
'i|in:s' => \$infile,
'o|out:s' => \$outfile,
'h|help' => sub { exec('perldoc', $0);
exit(0); },
);
my $in;
if( ! $infile ) {
$in = Bio::TreeIO->new(-format => $iformat,
-fh => \*ARGV);
} else {
$in = Bio::TreeIO->new(-format => $iformat,
-file => $infile);
}
my $out;
if( $outfile) {
$out = Bio::TreeIO->new(-format => $oformat,
-file => ">$outfile");
} else {
$out = Bio::TreeIO->new(-format => $oformat); #print to STDOUT instead
}
while( my $t = $in->next_tree ) {
$out->write_tree($t);
}
|