Mercurial > repos > fubar > blasttools_search_test
comparison blasttoolssearch/blasttoolssearch.xml @ 4:2051ee2bedc4 draft
Uploaded
author | fubar |
---|---|
date | Wed, 19 Jul 2023 06:45:26 +0000 |
parents | a6593725b728 |
children | 3a499f3ed69c |
comparison
equal
deleted
inserted
replaced
3:a6593725b728 | 4:2051ee2bedc4 |
---|---|
96 | 96 |
97 Wraps https://github.com/schmidda/blast-tools/tree/master as a Galaxy tool as a demonstration for Roberto Barrero | 97 Wraps https://github.com/schmidda/blast-tools/tree/master as a Galaxy tool as a demonstration for Roberto Barrero |
98 | 98 |
99 | 99 |
100 | 100 |
101 ------ | |
102 | |
103 | |
104 Script:: | |
105 | |
106 ## eResearch Office, QUT | |
107 ## Created: 31 March 2021 | |
108 ## Last modified: 28 September 2022 | |
109 ## Script: Processes Galaxy Australia generated blastN outputs to summarise and report hits to REGULATED and ENDEMIC viruses/viroids. | |
110 ## Usage: ./run_VirReport_Summary.sh | |
111 ## changed to accept a single input file name passed as $1 | |
112 ## Ross Lazarus for a ToolFactory wrapper for Robert Barrero | |
113 ## July 18 2023 | |
114 dataPath=${PWD} | |
115 # Requirement: One or more GA-VSD .tabular outputs need to be in the folder where the command above (Usage)is executed. | |
116 # The script will Look for all files with the suffix *.tabular | |
117 #Processing tabular files | |
118 file=$1 | |
119 var=$(basename $file) | |
120 #STEP0: fetch Top 1 Hits | |
121 cat $file | awk '{print $1}' | sort | uniq > ${var}.top1.ids | |
122 for i in `cat ${var}.top1.ids` | |
123 do | |
124 echo "fetching top hits..." $i; | |
125 grep $i $file | head -1 >> ${var}.top1Hits.txt; | |
126 done | |
127 #STEP1: modify the columns of Galaxy Australia (GA) blast output to the expected format by the BlastTools.jar tool | |
128 ###### 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 | |
129 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 | |
130 #STEP2: summarise the GA blastN files | |
131 #java -jar /mnt/c/Users/lelwala/HTS/BlastTools.jar -t blastn ${var}.txt | |
132 java -jar $3 -t blastn ${var}.txt | |
133 #filter virus/viroid/endo | |
134 cat summary_${var}.txt | grep "virus\|viroid\|endo" > summary_${var}_filtered.txt | |
135 #STEP3: fetch unique names from Blast summary reports | |
136 cat summary_${var}_filtered.txt | awk '{print $7}' | awk -F "|" '{print $2}'| sort | uniq | sed 's/Species://' > ${var}_uniq.ids | |
137 #STEP4: retrieve the best hit for each virus/viroid | |
138 echo "processing top hits ..." | |
139 touch ${var}_filtered.txt | |
140 for id in `cat ${var}_uniq.ids` | |
141 do | |
142 #print on the screen the name of the virus/viroids to search | |
143 #echo "fetching species matches ..." $id | |
144 #fetch the virus name on the summary_blastn file by selecting the longest alignment (column 3) and highest genome coverage (column 5) | |
145 grep $id summary_${var}.txt | sort -k3,3nr -k5,5nr | head -1 >> ${var}_filtered.txt | |
146 done | |
147 #print the header of the inital summary_blastn file | |
148 cat summary_${var}.txt | head -1 > header | |
149 #report 1 | |
150 cat header ${var}_filtered.txt > $2 | |
151 #removing intermediate files | |
152 rm summary_${file}.txt ${file}.txt ${file}.top1.ids ${file}_uniq.ids summary_${file}_filtered.txt header* ${var}_filtered.txt *top1Hits.txt | |
153 | |
154 ]]></help> | 101 ]]></help> |
155 <citations> | 102 <citations> |
156 <citation type="doi">10.1093/bioinformatics/bts573</citation> | 103 <citation type="doi">10.1093/bioinformatics/bts573</citation> |
157 </citations> | 104 </citations> |
158 </tool> | 105 </tool> |