# HG changeset patch # User dfornika # Date 1568259138 14400 # Node ID a56a5519d60a9d3b7b1d9deaa22a1343385d6e47 # Parent 18b097eb1a51a06ce3ad2f83176ac0657549aea4 planemo upload for repository https://github.com/dfornika/galaxy/tree/master/tools/blast_report commit bf63225facccd1b6fcf39681ee5fe0bc887b1695-dirty diff -r 18b097eb1a51 -r a56a5519d60a blast_report.py diff -r 18b097eb1a51 -r a56a5519d60a blast_report.xml --- a/blast_report.xml Tue Sep 10 12:51:57 2019 -0400 +++ b/blast_report.xml Wed Sep 11 23:32:18 2019 -0400 @@ -29,7 +29,7 @@ - + diff -r 18b097eb1a51 -r a56a5519d60a blast_report_bins.loc.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blast_report_bins.loc.sample Wed Sep 11 23:32:18 2019 -0400 @@ -0,0 +1,7 @@ +# Expect three columns, tab separated, as follows: +# - value (Galaxy records this in the Galaxy DB) +# - name (Galaxy shows this in the UI) +# - path (folder name containing the Kraken DB) +# +# e.g. +# rdpRDP/path/to/bins/rdp.csv diff -r 18b097eb1a51 -r a56a5519d60a blast_report_bins.xml.sample --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/blast_report_bins.xml.sample Wed Sep 11 23:32:18 2019 -0400 @@ -0,0 +1,8 @@ + + + + + value, name, path + +
+
\ No newline at end of file diff -r 18b097eb1a51 -r a56a5519d60a templates/template1.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/template1.tmpl Wed Sep 11 23:32:18 2019 -0400 @@ -0,0 +1,108 @@ +#silent import time +#set $display_m = 20 +#set $header = 'AccessionDescriptionScore% Coverage% Identity' + + + + + + + #set $q = 0 + #for $query in $queries + #set $bin_symbols = dict([($bin,$i) for $i, $bin in enumerate($query.bins, 1)]) + #set $m = 0 +

$query.query_id

+
+ + #if len($query.matches) == 0: + +
No matches to report
+ #else: + $header + #for $match in $query.matches: + #if $m == $display_m + + #end if + + $match.subject_acc #echo ', '.join(sorted([str($bin_symbols[$bin]) for $bin in $match.bins]))# + $match.subject_descr + $match.score + $match.p_cov + $match.p_ident + + #set $m += 1 + #end for + #if $m >= $display_m + + Displaying ${display_m}/$m matches. Show the remaining results. + Hide the last #echo $m - $display_m # results. + + + #end if + + #if len($bin_symbols) > 0: +

#echo ', '.join(['%s %s'%($bin_symbols[$bin],$bin) for $bin in $query.bins])#

+ #end if + #end if + #if $query.pident_filtered > 0: +

$query.pident_filtered results filtered by % Identity.

+ #end if + #if $query.kw_filtered > 0: +

$query.kw_filtered results filtered by description keywords: #echo ', '.join(list(["%s matches to '%s'" % (str($query.kw_filtered_breakdown[$kw]),$kw) for $kw in $query.kw_filtered_breakdown])) #.

+ #end if +

Report produced on #echo time.strftime("%d/%m/%Y") #.

+
+ #set $q += 1 + #end for + + diff -r 18b097eb1a51 -r a56a5519d60a templates/template2.tmpl --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/templates/template2.tmpl Wed Sep 11 23:32:18 2019 -0400 @@ -0,0 +1,127 @@ +#silent import time +#set $display_m = 20 +#set $header = 'AccessionDescriptionScore% Coverage% Identity' + + + + + + + #set $q = 0 + #for $query in $queries + #set $bin_symbols = dict([($bin,$i) for $i, $bin in enumerate($query.bins, 1)]) + #set $m = 0 +

$query.query_id

+
+ + #set $num_of_euzby = -1 + #if len($query.matches) == 0: + +
No matches to report
+ #else: + $header + #try + #set $priority = $query.bins['Euzby'] + #set $front = [] + #for $i in reversed($priority) + #silent $front.append($query.matches.pop($i)) + #end for + #set $num_of_euzby = len($front) + #silent $front.reverse() + #silent $front.extend($query.matches) + #set $query.matches = $front + #except + #pass + #end try + #for $match in $query.matches: + #if $m == $display_m + + #end if + ##if $m>0 and set($match.bins)!=set($query.matches[m-1].bins) + ##put an empty line to separate Euzby records from other records + #if $m==$num_of_euzby and $m>0 +   + #end if + + $match.subject_acc #echo ', '.join(sorted([str($bin_symbols[$bin]) for $bin in $match.bins]))# + $match.subject_descr + $match.score + $match.p_cov + $match.p_ident + + #set $m += 1 + #end for + #if $m >= $display_m + + Displaying ${display_m}/$m matches. Show the remaining results. + Hide the last #echo $m - $display_m # results. + + + #end if + + #if len($bin_symbols) > 0: +

#echo ', '.join(['%s %s'%($bin_symbols[$bin],$bin) for $bin in $query.bins])#

+ #end if + #end if + #if $query.pident_filtered > 0: +

$query.pident_filtered results filtered by % Identity.

+ #end if + #if $query.kw_filtered > 0: +

$query.kw_filtered results filtered by description keywords: #echo ', '.join(list(["%s matches to '%s'" % (str($query.kw_filtered_breakdown[$kw]),$kw) for $kw in $query.kw_filtered_breakdown])) #.

+ #end if +

Report produced on #echo time.strftime("%d/%m/%Y") #.

+
+ #set $q += 1 + #end for + +