/usr/bin/bp_run_protdist.pl is in bioperl-run 1.6.9-1.
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 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 | #!/usr/bin/perl -w
use strict;
#!/usr/bin/perl -w
use strict;
=head1 NAME
run_neighbor - run Phylip's 'protdist' program through Bioperl
=head1 SYNOPSIS
run_protdist [-i inputfile] [-o outfilename]
=head1 DESCRIPTION
Provide an alignment file to run protdist on. File should be named
either .aln or .phy. This is required so that we can determine if we
need to convert a clustalw alignment into phylip. You are welcome to
extend the script to work on other MSA formats which bioperl supports.
This is intended to be used in very simple manual pipelines.
The input file should be named in the form of file.phy or file.aln
the program expects a file in the form of (\S+)\.(\S+).
This will run the application 'protdist' using the 'KIMURA' formula to
build a a protein distance matrix. Those with phylip3.6 will want to
make some changes if they want to use JTT. I'm happy to help add this
in as a cmd-line argument if it is requested.
=head1 AUTHOR
Jason Stajich, jason-AT-open-bio-DOT-org
=cut
use Bio::AlignIO;
use Bio::Tools::Run::Phylo::Phylip::ProtDist;
use Getopt::Long;
my @params = ( 'MODEL' => 'KIMURA',
'quiet' => 1,
);
my ($out,$file);
GetOptions(
'o|out:s' => \$out,
'i|in:s' => \$file,
'h|help' => sub { exec('perldoc',$0); exit(0) }
);
($file) ||= shift @ARGV;
my ($stem,$ext) = ($file =~ /(\S+)\.(\S+)$/);
$stem ||= $file;
my $outfh;
if( $out ) {
open($outfh, ">$out") || die($!);
} else {
open($outfh, ">$stem.matrix") || die($!);
}
if( $ext eq 'aln' ) {
my $inaln = new Bio::AlignIO(-file => $file,
-format => 'clustalw');
$file = "$stem.phy";
my $outreformat = new Bio::AlignIO(-file => ">$file",
-interleaved => 1,
-format => 'phylip');
while( my $aln = $inaln->next_aln ) {
$outreformat->write_aln($aln);
}
$outreformat->close();
$outreformat = undef;
$inaln = undef;
}
my $factory = new Bio::Tools::Run::Phylo::Phylip::ProtDist(@params);
my (@matrix) = $factory->create_distance_matrix($file);
foreach my $mat ( @matrix ) {
print $outfh $mat->print_matrix;
}
|