Mercurial > repos > fubar > blasttools_search_test
comparison blast_tools_search/blasttoolssearch.xml @ 8:186734f1d63c draft default tip
Replace plotly_blast_tool content with blasttools_search. :(
author | fubar |
---|---|
date | Fri, 04 Aug 2023 01:57:51 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
7:bb99f2c0e358 | 8:186734f1d63c |
---|---|
1 <tool name="blasttoolssearch" id="blasttoolssearch" version="3.0"> | |
2 <!--Source in git at: https://github.com/fubar2/galaxy_tf_overlay--> | |
3 <!--Created by toolfactory@galaxy.org at 04/08/2023 10:36:33 using the Galaxy Tool Factory.--> | |
4 <description>Runs a legacy Java jar called blasttools from https://github.com/schmidda/blast-tools/tree/master</description> | |
5 <requirements> | |
6 <requirement version="0.26.0" type="package">csvtk</requirement> | |
7 <requirement version="11.0.13" type="package">openjdk</requirement> | |
8 </requirements> | |
9 <stdio> | |
10 <exit_code range="1:" level="fatal"/> | |
11 </stdio> | |
12 <version_command><![CDATA[echo "3.0"]]></version_command> | |
13 <command><![CDATA[bash $runme "$blastn_search_outputs" "$__tool_directory__/BlastTools.jar" "$summary_viruses_viroids" "$all_blasttools_output"]]></command> | |
14 <configfiles> | |
15 <configfile name="runme"><![CDATA[#raw | |
16 | |
17 ## eResearch Office, QUT | |
18 ## Created: 31 March 2021 | |
19 ## Last modified: 28 September 2022 | |
20 ## Script: Processes Galaxy Australia generated blastN outputs to summarise and report hits to REGULATED and ENDEMIC viruses/viroids. | |
21 ## Usage: ./run_VirReport_Summary.sh | |
22 ## changed to accept a single input file name passed as $1 | |
23 ## Ross Lazarus for a ToolFactory wrapper for Robert Barrero | |
24 ## July 18 2023 | |
25 | |
26 | |
27 # Requirement: One or more GA-VSD .tabular outputs need to be in the folder where the command above (Usage)is executed. | |
28 # The script will Look for all files with the suffix *.tabular | |
29 | |
30 #Processing tabular files | |
31 file=$1 | |
32 var=$(basename $file) | |
33 | |
34 #STEP1: modify the columns of Galaxy Australia (GA) blast output to the expected format by the BlastTools.jar tool | |
35 ###### namely: qseqid sgi sacc length pident mismatch gapopen qstart qend qlen sstart send slen sstrand evalue bitscore qcovhsp stitle staxids qseq sseq sseqid qcovs qframe sframe | |
36 cat $file |csvtk cut -H -t -f 1,19,20,4,3,5,6,7,8,17,9,10,18,22,11,12,24,21,25,15,16,2,23,13,14 | sed 's/ /_/g' > ${var}_all.txt | |
37 java -jar $2 -t blastn ${var}_all.txt | |
38 cat summary_${var}_all.txt | grep "virus\|viroid\|endo" > $4 | |
39 | |
40 | |
41 #STEP0: fetch Top 1 Hits | |
42 cat $file | awk '{print $1}' | sort | uniq > ${var}.top1.ids | |
43 for i in `cat ${var}.top1.ids` | |
44 do | |
45 echo "fetching top hits..." $i 1>&2 ; | |
46 grep $i $file | head -1 >> ${var}.top1Hits.txt; | |
47 done | |
48 | |
49 #STEP1: modify the columns of Galaxy Australia (GA) blast output to the expected format by the BlastTools.jar tool | |
50 ###### namely: qseqid sgi sacc length pident mismatch gapopen qstart qend qlen sstart send slen sstrand evalue bitscore qcovhsp stitle staxids qseq sseq sseqid qcovs qframe sframe | |
51 cat ${var}.top1Hits.txt |csvtk cut -H -t -f 1,19,20,4,3,5,6,7,8,17,9,10,18,22,11,12,24,21,25,15,16,2,23,13,14 | sed 's/ /_/g' > ${var}.txt | |
52 | |
53 #STEP2: summarise the GA blastN files | |
54 java -jar $2 -t blastn ${var}.txt | |
55 #filter virus/viroid/endo | |
56 cat summary_${var}.txt | grep "virus\|viroid\|endo" > summary_${var}_filtered.txt | |
57 | |
58 #STEP3: fetch unique names from Blast summary reports | |
59 cat summary_${var}_filtered.txt | awk '{print $7}' | awk -F "|" '{print $2}'| sort | uniq | sed 's/Species://' > ${var}_uniq.ids | |
60 | |
61 #STEP4: retrieve the best hit for each virus/viroid | |
62 echo "processing top hits ..." 1>&2 | |
63 touch ${var}_filtered.txt | |
64 for id in `cat ${var}_uniq.ids` | |
65 do | |
66 #print on the screen the name of the virus/viroids to search | |
67 #echo "fetching species matches ..." $id 1>&2 | |
68 | |
69 #fetch the virus name on the summary_blastn file by selecting the longest alignment (column 3) and highest genome coverage (column 5) | |
70 grep $id summary_${var}.txt | sort -k3,3nr -k5,5nr | head -1 >> ${var}_filtered.txt | |
71 done | |
72 | |
73 #print the header of the inital summary_blastn file | |
74 cat summary_${var}.txt | head -1 > header | |
75 #report 1 | |
76 cat header ${var}_filtered.txt > $3 | |
77 | |
78 | |
79 | |
80 | |
81 | |
82 #end raw]]></configfile> | |
83 </configfiles> | |
84 <inputs> | |
85 <param name="blastn_search_outputs" type="data" optional="false" label="blastn_search_outputs" help="Nucleotide blast search output from a Galaxy blast search" format="tabular" multiple="false"/> | |
86 </inputs> | |
87 <outputs> | |
88 <data name="summary_viruses_viroids" format="tabular" label="summary_viruses_viroids" hidden="false"/> | |
89 <data name="all_blasttools_output" format="tabular" label="all_blasttools_output" hidden="false"/> | |
90 </outputs> | |
91 <tests> | |
92 <test> | |
93 <output name="summary_viruses_viroids" value="summary_viruses_viroids_sample" compare="diff" lines_diff="0"/> | |
94 <output name="all_blasttools_output" value="all_blasttools_output_sample" compare="diff" lines_diff="0"/> | |
95 <param name="blastn_search_outputs" value="blastn_search_outputs_sample"/> | |
96 </test> | |
97 </tests> | |
98 <help><![CDATA[ | |
99 | |
100 **What it Does** | |
101 | |
102 Wraps https://github.com/schmidda/blast-tools/tree/master as a Galaxy tool as a demonstration for Roberto Barrero | |
103 | |
104 | |
105 | |
106 ------ | |
107 | |
108 | |
109 Script:: | |
110 | |
111 ## eResearch Office, QUT | |
112 ## Created: 31 March 2021 | |
113 ## Last modified: 28 September 2022 | |
114 ## Script: Processes Galaxy Australia generated blastN outputs to summarise and report hits to REGULATED and ENDEMIC viruses/viroids. | |
115 ## Usage: ./run_VirReport_Summary.sh | |
116 ## changed to accept a single input file name passed as $1 | |
117 ## Ross Lazarus for a ToolFactory wrapper for Robert Barrero | |
118 ## July 18 2023 | |
119 # Requirement: One or more GA-VSD .tabular outputs need to be in the folder where the command above (Usage)is executed. | |
120 # The script will Look for all files with the suffix *.tabular | |
121 #Processing tabular files | |
122 file=$1 | |
123 var=$(basename $file) | |
124 #STEP1: modify the columns of Galaxy Australia (GA) blast output to the expected format by the BlastTools.jar tool | |
125 ###### namely: qseqid sgi sacc length pident mismatch gapopen qstart qend qlen sstart send slen sstrand evalue bitscore qcovhsp stitle staxids qseq sseq sseqid qcovs qframe sframe | |
126 cat $file |csvtk cut -H -t -f 1,19,20,4,3,5,6,7,8,17,9,10,18,22,11,12,24,21,25,15,16,2,23,13,14 | sed 's/ /_/g' > $ {var}_all.txt | |
127 java -jar $2 -t blastn $ {var}_all.txt | |
128 cat summary_$ {var}_all.txt | grep "virus\|viroid\|endo" > $4 | |
129 #STEP0: fetch Top 1 Hits | |
130 cat $file | awk '{print $1}' | sort | uniq > $ {var}.top1.ids | |
131 for i in `cat $ {var}.top1.ids` | |
132 do | |
133 echo "fetching top hits..." $i 1>&2 ; | |
134 grep $i $file | head -1 >> $ {var}.top1Hits.txt; | |
135 done | |
136 #STEP1: modify the columns of Galaxy Australia (GA) blast output to the expected format by the BlastTools.jar tool | |
137 ###### namely: qseqid sgi sacc length pident mismatch gapopen qstart qend qlen sstart send slen sstrand evalue bitscore qcovhsp stitle staxids qseq sseq sseqid qcovs qframe sframe | |
138 cat $ {var}.top1Hits.txt |csvtk cut -H -t -f 1,19,20,4,3,5,6,7,8,17,9,10,18,22,11,12,24,21,25,15,16,2,23,13,14 | sed 's/ /_/g' > $ {var}.txt | |
139 #STEP2: summarise the GA blastN files | |
140 java -jar $2 -t blastn $ {var}.txt | |
141 #filter virus/viroid/endo | |
142 cat summary_$ {var}.txt | grep "virus\|viroid\|endo" > summary_$ {var}_filtered.txt | |
143 #STEP3: fetch unique names from Blast summary reports | |
144 cat summary_$ {var}_filtered.txt | awk '{print $7}' | awk -F "|" '{print $2}'| sort | uniq | sed 's/Species://' > $ {var}_uniq.ids | |
145 #STEP4: retrieve the best hit for each virus/viroid | |
146 echo "processing top hits ..." 1>&2 | |
147 touch $ {var}_filtered.txt | |
148 for id in `cat $ {var}_uniq.ids` | |
149 do | |
150 #print on the screen the name of the virus/viroids to search | |
151 #echo "fetching species matches ..." $id 1>&2 | |
152 #fetch the virus name on the summary_blastn file by selecting the longest alignment (column 3) and highest genome coverage (column 5) | |
153 grep $id summary_$ {var}.txt | sort -k3,3nr -k5,5nr | head -1 >> $ {var}_filtered.txt | |
154 done | |
155 #print the header of the inital summary_blastn file | |
156 cat summary_$ {var}.txt | head -1 > header | |
157 #report 1 | |
158 cat header $ {var}_filtered.txt > $3 | |
159 | |
160 ]]></help> | |
161 <citations> | |
162 <citation type="doi">10.1093/bioinformatics/bts573</citation> | |
163 </citations> | |
164 </tool> | |
165 |