/usr/lib/cd-hit/clstr2tree.pl is in cd-hit 4.6.1-2012-08-27-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 | #!/usr/bin/perl
$clstr = shift;
$fr = shift; # for nr80.clstr $fr = 0.8
$fra = 1 - $fr;
print "(\n";
open(TMP, $clstr) || die;
my $ll;
my $no = 0;
my @ids = ();
my $rep = "";
while($ll=<TMP>) {
if ($ll =~ /^>/) {
if ($no) {
if ($no ==1 ) { print "$rep:1.0,\n";}
else {
my @mms = ();
foreach my $tid (@ids) {
push(@mms, "$tid:$fra");
}
my $mm = join(",\n", @mms);
print "(\n$mm\n):$fr,\n";
}
}
$no = 0;
@ids = ();
$rep = "";
}
else {
my $tid= "";
if ($ll =~ /(aa|nt), >(.+)\.\.\./) { $tid=$2;}
push(@ids,$tid);
if ($ll =~ /\*/) {$rep = $tid;}
$no++;
}
}
if ($no) {
if ($no ==1 ) { print "$rep:1.0\n";}
else {
my @mms = ();
foreach my $tid (@ids) {
push(@mms, "$tid:$fra");
}
my $mm = join(",\n", @mms);
print "(\n$mm\n):$fr\n";
}
}
close(TMP);
print ");\n";
|