Commit d91a5b41 authored by Marwan ELKREWI's avatar Marwan ELKREWI
Browse files

Upload New File

parent 8bc41e6a
#!/usr/bin/perl
print "make sure your input file is sorted by scaffoldname! sort -k 10";
my $input = $ARGV[0];
open (INPUT, "$input");
open (RESULTS, ">$input.besthit");
print RESULTS "1match\tmismatch\trep\tNs\tQgapcount\tQgapbases\tTgapcount\tTgapbases\tstrand\tQname\tQsize\tQstart\tQend\tTname\tTsize\tTstart\tTend\tblockcount\tblockSizes\tqStarts\ttStarts\n";
$name0="";
$score0=0;
$line0="";
while ($line = <INPUT>) {
($match, $mismatch, $rep, $Ns, $Qgapcount, $Qgapbases, $Tgapcount, $Tgapbases, $strand, $Qname, $Qsize, $Qstart, $Qend, $Tname, $Tsize, $Tstart, $Tend, $blockcount, $blockSizes, $qStarts, $tStarts)=split(/\t/, $line);
if ($Qname eq $name0)
{
if ($match > $score0)
{
$name0=$Qname;
$score0=$match;
$line0=$line;
}
else
{
}
}
else
{
print RESULTS $line0;
$name0=$Qname;
$score0=$match;
$line0=$line;
}
}
print RESULTS $line0;
system "perl -pi -e 's/^[^0-9].*//gi' $input.besthit";
system "perl -pi -e 's/1match/match/gi' $input.besthit";
system "perl -pi -e 's/^\n//gi' $input.besthit";
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment