Repository 'blastxml_to_top_descr'
hg clone https://toolshed.g2.bx.psu.edu/repos/peterjc/blastxml_to_top_descr

Changeset 13:8dc4ba7eba5d (2023-09-17)
Previous changeset 12:fe1ed74793c9 (2014-07-30)
Commit message:
v0.1.2 with Python 3.9 declaration
modified:
test-data/blastp_four_human_vs_rhodopsin.xml
test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular
test-data/blastp_four_human_vs_rhodopsin_top3.tabular
test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular
tools/blastxml_to_top_descr/README.rst
tools/blastxml_to_top_descr/blastxml_to_top_descr.py
tools/blastxml_to_top_descr/blastxml_to_top_descr.xml
removed:
tools/blastxml_to_top_descr/repository_dependencies.xml
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d test-data/blastp_four_human_vs_rhodopsin.xml
--- a/test-data/blastp_four_human_vs_rhodopsin.xml Wed Jul 30 05:36:52 2014 -0400
+++ b/test-data/blastp_four_human_vs_rhodopsin.xml Sun Sep 17 13:01:56 2023 +0000
[
b'@@ -2,10 +2,10 @@\n <!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd">\n <BlastOutput>\n   <BlastOutput_program>blastp</BlastOutput_program>\n-  <BlastOutput_version>BLASTP 2.2.29+</BlastOutput_version>\n+  <BlastOutput_version>BLASTP 2.10.1+</BlastOutput_version>\n   <BlastOutput_reference>Stephen F. Altschul, Thomas L. Madden, Alejandro A. Sch&amp;auml;ffer, Jinghui Zhang, Zheng Zhang, Webb Miller, and David J. Lipman (1997), &quot;Gapped BLAST and PSI-BLAST: a new generation of protein database search programs&quot;, Nucleic Acids Res. 25:3389-3402.</BlastOutput_reference>\n   <BlastOutput_db></BlastOutput_db>\n-  <BlastOutput_query-ID>sp|Q9BS26|ERP44_HUMAN</BlastOutput_query-ID>\n+  <BlastOutput_query-ID>Q9BS26</BlastOutput_query-ID>\n   <BlastOutput_query-def>Endoplasmic reticulum resident protein 44 OS=Homo sapiens GN=ERP44 PE=1 SV=1</BlastOutput_query-def>\n   <BlastOutput_query-len>406</BlastOutput_query-len>\n   <BlastOutput_param>\n@@ -20,7 +20,7 @@\n <BlastOutput_iterations>\n <Iteration>\n   <Iteration_iter-num>1</Iteration_iter-num>\n-  <Iteration_query-ID>sp|Q9BS26|ERP44_HUMAN</Iteration_query-ID>\n+  <Iteration_query-ID>Q9BS26</Iteration_query-ID>\n   <Iteration_query-def>Endoplasmic reticulum resident protein 44 OS=Homo sapiens GN=ERP44 PE=1 SV=1</Iteration_query-def>\n   <Iteration_query-len>406</Iteration_query-len>\n <Iteration_hits>\n@@ -29,8 +29,8 @@\n     <Statistics>\n       <Statistics_db-num>0</Statistics_db-num>\n       <Statistics_db-len>0</Statistics_db-len>\n-      <Statistics_hsp-len>30</Statistics_hsp-len>\n-      <Statistics_eff-space>119568</Statistics_eff-space>\n+      <Statistics_hsp-len>42</Statistics_hsp-len>\n+      <Statistics_eff-space>657748</Statistics_eff-space>\n       <Statistics_kappa>0.041</Statistics_kappa>\n       <Statistics_lambda>0.267</Statistics_lambda>\n       <Statistics_entropy>0.14</Statistics_entropy>\n@@ -40,17 +40,17 @@\n </Iteration>\n <Iteration>\n   <Iteration_iter-num>2</Iteration_iter-num>\n-  <Iteration_query-ID>sp|Q9BS26|ERP44_HUMAN</Iteration_query-ID>\n-  <Iteration_query-def>Endoplasmic reticulum resident protein 44 OS=Homo sapiens GN=ERP44 PE=1 SV=1</Iteration_query-def>\n-  <Iteration_query-len>406</Iteration_query-len>\n+  <Iteration_query-ID>Q9NSY1</Iteration_query-ID>\n+  <Iteration_query-def>BMP-2-inducible protein kinase OS=Homo sapiens GN=BMP2K PE=1 SV=2</Iteration_query-def>\n+  <Iteration_query-len>1161</Iteration_query-len>\n <Iteration_hits>\n </Iteration_hits>\n   <Iteration_stat>\n     <Statistics>\n       <Statistics_db-num>0</Statistics_db-num>\n       <Statistics_db-len>0</Statistics_db-len>\n-      <Statistics_hsp-len>30</Statistics_hsp-len>\n-      <Statistics_eff-space>119568</Statistics_eff-space>\n+      <Statistics_hsp-len>50</Statistics_hsp-len>\n+      <Statistics_eff-space>1954249</Statistics_eff-space>\n       <Statistics_kappa>0.041</Statistics_kappa>\n       <Statistics_lambda>0.267</Statistics_lambda>\n       <Statistics_entropy>0.14</Statistics_entropy>\n@@ -60,17 +60,17 @@\n </Iteration>\n <Iteration>\n   <Iteration_iter-num>3</Iteration_iter-num>\n-  <Iteration_query-ID>sp|Q9BS26|ERP44_HUMAN</Iteration_query-ID>\n-  <Iteration_query-def>Endoplasmic reticulum resident protein 44 OS=Homo sapiens GN=ERP44 PE=1 SV=1</Iteration_query-def>\n-  <Iteration_query-len>406</Iteration_query-len>\n+  <Iteration_query-ID>P06213</Iteration_query-ID>\n+  <Iteration_query-def>Insulin receptor OS=Homo sapiens GN=INSR PE=1 SV=4</Iteration_query-def>\n+  <Iteration_query-len>1382</Iteration_query-len>\n <Iteration_hits>\n </Iteration_hits>\n   <Iteration_stat>\n     <Statistics>\n       <Statistics_db-num>0</Statistics_db-num>\n       <Statistics_db-len>0</Statistics_db-len>\n-      <Statistics_hsp-len>30</Statistics_hsp-len>\n-      <Statistics_eff-space>119568</Statistics_eff-space>\n+      <Statistics_hsp-len>51</Statistics_hsp-len>\n+      <Statistics_eff-space>2333243</Statistics_eff-space>\n       <Statistics_kappa>0.041</Statistics_kappa>\n       '..b'    <Hsp_positive>336</Hsp_positive>\n+      <Hsp_identity>290</Hsp_identity>\n+      <Hsp_positive>322</Hsp_positive>\n       <Hsp_gaps>1</Hsp_gaps>\n-      <Hsp_align-len>348</Hsp_align-len>\n-      <Hsp_qseq>MNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVSKTETSQVAPA</Hsp_qseq>\n-      <Hsp_hseq>MNGTEGPNFYVPFSNKTGVVRSPFEAPQYYLAEPWQFSMLAAYMFLLIMLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFGGFTTTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLVGWSRYIPEGMQCSCGID-YTPHEETNNESFVIYMFVVHFIIPLIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWLPYAGVAFYIFTHQGSDFGPIFMTIPAFFAKTSAVYNPVIYIMMNKQFRNCMVTTLCCGKNPLGDDEASTTVSKTETSQVAPA</Hsp_hseq>\n-      <Hsp_midline>MNGTEGPNFYVPFSN TGVVRSPFE PQYYLAEPWQFSMLAAYMFLLI+LGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMV GGFT+TLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPL GWSRYIPEG+QCSCGID YT   E NNESFVIYMFVVHF IP+I+IFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICW+PYA VAFYIFTHQGS+FGPIFMTIPAFFAK++A+YNPVIYIMMNKQFRNCM+TT+CCGKNPLGDDEAS TVSKTETSQVAPA</Hsp_midline>\n+      <Hsp_align-len>342</Hsp_align-len>\n+      <Hsp_qseq>MNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEA-SATVSKTE</Hsp_qseq>\n+      <Hsp_hseq>MNGTEGPNFYIPMSNKTGVVRSPFEYPQYYLAEPWQYSILCAYMFLLILLGFPINFMTLYVTIQHKKLRTPLNYILLNLAFANHFMVLCGFTVTMYSSMNGYFILGATGCYVEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFSENHAVMGVAFTWIMALSCAVPPLLGWSRYIPEGMQCSCGVDYYTLKPEVNNESFVIYMFVVHFTIPLIIIFFCYGRLVCTVKEAAAQQQESATTQKAEKEVTRMVIIMVVFFLICWVPYASVAFFIFSNQGSEFGPIFMTVPAFFAKSSSIYNPVIYIMLNKQFRNCMITTLCCGKNPFGEDDASSAATSKTE</Hsp_hseq>\n+      <Hsp_midline>MNGTEGPNFY+P SN TGVVRSPFEYPQYYLAEPWQ+S+L AYMFLLI+LGFPINF+TLYVT+QHKKLRTPLNYILLNLA A+ FMVL GFT T+Y+S++GYF+ G TGC +EGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRF ENHA+MGVAFTW+MAL+CA PPL GWSRYIPEG+QCSCG+DYYTLKPEVNNESFVIYMFVVHFTIP+IIIFFCYG+LV TVKEAAAQQQESATTQKAEKEVTRMVIIMV+ FLICWVPYASVAF+IF++QGS FGPIFMT+PAFFAKS++IYNPVIYIM+NKQFRNCM+TT+CCGKNP G+D+A SA  SKTE</Hsp_midline>\n     </Hsp>\n   </Hit_hsps>\n </Hit>\n-</Iteration_hits>\n-  <Iteration_stat>\n-    <Statistics>\n-      <Statistics_db-num>0</Statistics_db-num>\n-      <Statistics_db-len>0</Statistics_db-len>\n-      <Statistics_hsp-len>29</Statistics_hsp-len>\n-      <Statistics_eff-space>101761</Statistics_eff-space>\n-      <Statistics_kappa>0.041</Statistics_kappa>\n-      <Statistics_lambda>0.267</Statistics_lambda>\n-      <Statistics_entropy>0.14</Statistics_entropy>\n-    </Statistics>\n-  </Iteration_stat>\n-</Iteration>\n-<Iteration>\n-  <Iteration_iter-num>24</Iteration_iter-num>\n-  <Iteration_query-ID>sp|P08100|OPSD_HUMAN</Iteration_query-ID>\n-  <Iteration_query-def>Rhodopsin OS=Homo sapiens GN=RHO PE=1 SV=1</Iteration_query-def>\n-  <Iteration_query-len>348</Iteration_query-len>\n-<Iteration_hits>\n <Hit>\n-  <Hit_num>1</Hit_num>\n+  <Hit_num>6</Hit_num>\n   <Hit_id>gi|12583665|dbj|BAB21486.1|</Hit_id>\n   <Hit_def>fresh water form rod opsin [Conger myriaster]</Hit_def>\n   <Hit_accession>BAB21486</Hit_accession>\n@@ -652,8 +257,8 @@\n     <Statistics>\n       <Statistics_db-num>0</Statistics_db-num>\n       <Statistics_db-len>0</Statistics_db-len>\n-      <Statistics_hsp-len>29</Statistics_hsp-len>\n-      <Statistics_eff-space>101761</Statistics_eff-space>\n+      <Statistics_hsp-len>41</Statistics_hsp-len>\n+      <Statistics_eff-space>556591</Statistics_eff-space>\n       <Statistics_kappa>0.041</Statistics_kappa>\n       <Statistics_lambda>0.267</Statistics_lambda>\n       <Statistics_entropy>0.14</Statistics_entropy>\n'
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular
--- a/test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular Wed Jul 30 05:36:52 2014 -0400
+++ b/test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular Sun Sep 17 13:01:56 2023 +0000
[
b'@@ -1,6 +1,6 @@\n-sp|P08100|OPSD_HUMAN\tgi|57163783|ref|NP_001009242.1|\t96.55\t348\t12\t0\t1\t348\t1\t348\t0.0\t701\tgi|57163783|ref|NP_001009242.1|\t1808\t336\t343\t0\t98.56\t1\t1\tMNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVSKTETSQVAPA\tMNGTEGPNFYVPFSNKTGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFGGFTTTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLVGWSRYIPEGMQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTLPAFFAKSSSIYNPVIYIMMNKQFRNCMLTTLCCGKNPLGDDEASTTGSKTETSQVAPA\t348\t348\trhodopsin [Felis catus]\n-sp|P08100|OPSD_HUMAN\tgi|3024260|sp|P56514.1|OPSD_BUFBU\t84.80\t342\t51\t1\t1\t341\t1\t342\t0.0\t619\tgi|3024260|sp|P56514.1|OPSD_BUFBU\t1595\t290\t322\t1\t94.15\t1\t1\tMNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEA-SATVSKTE\tMNGTEGPNFYIPMSNKTGVVRSPFEYPQYYLAEPWQYSILCAYMFLLILLGFPINFMTLYVTIQHKKLRTPLNYILLNLAFANHFMVLCGFTVTMYSSMNGYFILGATGCYVEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFSENHAVMGVAFTWIMALSCAVPPLLGWSRYIPEGMQCSCGVDYYTLKPEVNNESFVIYMFVVHFTIPLIIIFFCYGRLVCTVKEAAAQQQESATTQKAEKEVTRMVIIMVVFFLICWVPYASVAFFIFSNQGSEFGPIFMTVPAFFAKSSSIYNPVIYIMLNKQFRNCMITTLCCGKNPFGEDDASSAATSKTE\t348\t354\tRecName: Full=Rhodopsin\n-sp|P08100|OPSD_HUMAN\tgi|283855846|gb|ADB45242.1|\t94.82\t328\t17\t0\t11\t338\t1\t328\t0.0\t653\tgi|283855846|gb|ADB45242.1|\t1684\t311\t321\t0\t97.87\t1\t1\tVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVS\tVPFSNKTGVVRSPFEHPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFGGFTTTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGLALTWVMALACAAPPLVGWSRYIPEGMQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWLPYAGVAFYIFTHQGSNFGPIFMTLPAFFAKSSSIYNPVIYIMMNKQFRNCMLTTLCCGKNPLGDDEASTTAS\t348\t328\trhodopsin [Cynopterus brachyotis]\n-sp|P08100|OPSD_HUMAN\tgi|283855823|gb|ADB45229.1|\t94.82\t328\t17\t0\t11\t338\t1\t328\t0.0\t631\tgi|283855823|gb|ADB45229.1|\t1627\t311\t323\t0\t98.48\t1\t1\tVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVS\tVPFSNKTGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVANLFMVFGGFTTTLYTSMHGYFVFGATGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGLAFTWVMALACAAPPLAGWSRYIPEGMQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVVAFLICWLPYASVAFYIFTHQGSNFGPVFMTIPAFFAKSSSIYNPVIYIMMNKQFRNCMLTTLCCGKNPLGDDEASTTAS\t348\t328\trhodopsin [Myotis pilosus]\n-sp|P08100|OPSD_HUMAN\tgi|223523|prf||0811197A\t93.10\t348\t23\t1\t1\t348\t1\t347\t0.0\t673\tgi|223523|prf||0811197A\t1736\t324\t336\t1\t96.55\t1\t1\tMNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVSKTETSQVAPA\tMNGTEGPNFYVPFSNKTGVVRSPFEAPQYYLAEPWQFSMLAAYMFLLIMLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFG'..b'YTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVSKTETSQVAPA\tMNGTEGPNFYVPFSNKTGVVRSPFEAPQYYLAEPWQFSMLAAYMFLLIMLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFGGFTTTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLVGWSRYIPEGMQCSCGID-YTPHEETNNESFVIYMFVVHFIIPLIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWLPYAGVAFYIFTHQGSDFGPIFMTIPAFFAKTSAVYNPVIYIMMNKQFRNCMVTTLCCGKNPLGDDEASTTVSKTETSQVAPA\t348\t347\trhodopsin [Bos taurus]\n+P08100\tgi|283855846|gb|ADB45242.1|\t94.817\t328\t17\t0\t11\t338\t1\t328\t0.0\t653\tgi|283855846|gb|ADB45242.1|\t1684\t311\t321\t0\t97.87\t1\t1\tVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVS\tVPFSNKTGVVRSPFEHPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVFGGFTTTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGLALTWVMALACAAPPLVGWSRYIPEGMQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWLPYAGVAFYIFTHQGSNFGPIFMTLPAFFAKSSSIYNPVIYIMMNKQFRNCMLTTLCCGKNPLGDDEASTTAS\t348\t328\trhodopsin [Cynopterus brachyotis]\n+P08100\tgi|283855823|gb|ADB45229.1|\t94.817\t328\t17\t0\t11\t338\t1\t328\t0.0\t631\tgi|283855823|gb|ADB45229.1|\t1627\t311\t323\t0\t98.48\t1\t1\tVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEASATVS\tVPFSNKTGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVANLFMVFGGFTTTLYTSMHGYFVFGATGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGLAFTWVMALACAAPPLAGWSRYIPEGMQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIVIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVVAFLICWLPYASVAFYIFTHQGSNFGPVFMTIPAFFAKSSSIYNPVIYIMMNKQFRNCMLTTLCCGKNPLGDDEASTTAS\t348\t328\trhodopsin [Myotis pilosus]\n+P08100\tgi|3024260|sp|P56514.1|OPSD_BUFBU\t84.795\t342\t51\t1\t1\t341\t1\t342\t0.0\t619\tgi|3024260|sp|P56514.1|OPSD_BUFBU\t1595\t290\t322\t1\t94.15\t1\t1\tMNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPLGDDEA-SATVSKTE\tMNGTEGPNFYIPMSNKTGVVRSPFEYPQYYLAEPWQYSILCAYMFLLILLGFPINFMTLYVTIQHKKLRTPLNYILLNLAFANHFMVLCGFTVTMYSSMNGYFILGATGCYVEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFSENHAVMGVAFTWIMALSCAVPPLLGWSRYIPEGMQCSCGVDYYTLKPEVNNESFVIYMFVVHFTIPLIIIFFCYGRLVCTVKEAAAQQQESATTQKAEKEVTRMVIIMVVFFLICWVPYASVAFFIFSNQGSEFGPIFMTVPAFFAKSSSIYNPVIYIMLNKQFRNCMITTLCCGKNPFGEDDASSAATSKTE\t348\t354\tRecName: Full=Rhodopsin\n+P08100\tgi|12583665|dbj|BAB21486.1|\t82.164\t342\t60\t1\t1\t341\t1\t342\t0.0\t599\tgi|12583665|dbj|BAB21486.1|\t1544\t281\t314\t1\t91.81\t1\t1\tMNGTEGPNFYVPFSNATGVVRSPFEYPQYYLAEPWQFSMLAAYMFLLIVLGFPINFLTLYVTVQHKKLRTPLNYILLNLAVADLFMVLGGFTSTLYTSLHGYFVFGPTGCNLEGFFATLGGEIALWSLVVLAIERYVVVCKPMSNFRFGENHAIMGVAFTWVMALACAAPPLAGWSRYIPEGLQCSCGIDYYTLKPEVNNESFVIYMFVVHFTIPMIIIFFCYGQLVFTVKEAAAQQQESATTQKAEKEVTRMVIIMVIAFLICWVPYASVAFYIFTHQGSNFGPIFMTIPAFFAKSAAIYNPVIYIMMNKQFRNCMLTTICCGKNPL-GDDEASATVSKTE\tMNGTEGPNFYIPMSNATGVVRSPFEYPQYYLAEPWAFSALSAYMFFLIIAGFPINFLTLYVTIEHKKLRTPLNYILLNLAVADLFMVFGGFTTTMYTSMHGYFVFGPTGCNIEGFFATLGGEIALWCLVVLAIERWMVVCKPVTNFRFGESHAIMGVMVTWTMALACALPPLFGWSRYIPEGLQCSCGIDYYTRAPGINNESFVIYMFTCHFSIPLAVISFCYGRLVCTVKEAAAQQQESETTQRAEREVTRMVVIMVISFLVCWVPYASVAWYIFTHQGSTFGPIFMTIPSFFAKSSALYNPMIYICMNKQFRHCMITTLCCGKNPFEEEDGASATSSKTE\t348\t354\tfresh water form rod opsin [Conger myriaster]\n'
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d test-data/blastp_four_human_vs_rhodopsin_top3.tabular
--- a/test-data/blastp_four_human_vs_rhodopsin_top3.tabular Wed Jul 30 05:36:52 2014 -0400
+++ b/test-data/blastp_four_human_vs_rhodopsin_top3.tabular Sun Sep 17 13:01:56 2023 +0000
[
@@ -1,5 +1,5 @@
 #Query BLAST hit 1 BLAST hit 2 BLAST hit 3
-sp|Q9BS26|ERP44_HUMAN
-sp|Q9NSY1|BMP2K_HUMAN
-sp|P06213|INSR_HUMAN
-sp|P08100|OPSD_HUMAN gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus] gi|3024260|sp|P56514.1|OPSD_BUFBU RecName: Full=Rhodopsin gi|283855846|gb|ADB45242.1| rhodopsin [Cynopterus brachyotis]
+Q9BS26
+Q9NSY1
+P06213
+P08100 gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus] gi|223523|prf||0811197A rhodopsin [Bos taurus] gi|283855846|gb|ADB45242.1| rhodopsin [Cynopterus brachyotis]
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular
--- a/test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular Wed Jul 30 05:36:52 2014 -0400
+++ b/test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular Sun Sep 17 13:01:56 2023 +0000
[
@@ -1,2 +1,2 @@
 #Query BLAST hit 1 BLAST hit 2 BLAST hit 3
-sp|P08100|OPSD_HUMAN gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus] gi|3024260|sp|P56514.1|OPSD_BUFBU RecName: Full=Rhodopsin gi|283855846|gb|ADB45242.1| rhodopsin [Cynopterus brachyotis]
+P08100 gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus] gi|223523|prf||0811197A rhodopsin [Bos taurus] gi|283855846|gb|ADB45242.1| rhodopsin [Cynopterus brachyotis]
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d tools/blastxml_to_top_descr/README.rst
--- a/tools/blastxml_to_top_descr/README.rst Wed Jul 30 05:36:52 2014 -0400
+++ b/tools/blastxml_to_top_descr/README.rst Sun Sep 17 13:01:56 2023 +0000
b
@@ -1,7 +1,7 @@
 Galaxy tool to extract top BLAST hit descriptions from BLAST XML
 ================================================================
 
-This tool is copyright 2012-2013 by Peter Cock, The James Hutton Institute
+This tool is copyright 2012-2015 by Peter Cock, The James Hutton Institute
 (formerly SCRI, Scottish Crop Research Institute), UK. All rights reserved.
 See the licence text below.
 
@@ -12,38 +12,39 @@
 It is available from the Galaxy Tool Shed at:
 http://toolshed.g2.bx.psu.edu/view/peterjc/blastxml_to_top_descr
 
-This requires the 'blast_datatypes' repository from the Galaxy Tool Shed
-to provide the 'blastxml' file format definition.
+This requires the ``blast_datatypes`` repository from the Galaxy Tool Shed
+to provide the ``blastxml`` file format definition.
 
 
 Automated Installation
 ======================
 
 This should be straightforward, Galaxy should automatically install the
-'blast_datatypes' dependency.
+``blast_datatypes`` dependency.
 
 
 Manual Installation
 ===================
 
-If you haven't done so before, first install the 'blast_datatypes' repository.
+If you haven't done so before, first install the ``blast_datatypes`` repository.
 
 There are just two files to install (if doing this manually):
 
-* blastxml_to_top_descr.py (the Python script)
-* blastxml_to_top_descr.xml (the Galaxy tool definition)
+- ``blastxml_to_top_descr.py`` (the Python script)
+- ``blastxml_to_top_descr.xml`` (the Galaxy tool definition)
 
-The suggested location is in the Galaxy folder tools/ncbi_blast_plus next to
-the NCBI BLAST+ tool wrappers.
+The suggested location is in the Galaxy folder ``tools/ncbi_blast_plus/``
+next to the NCBI BLAST+ tool wrappers.
 
-You will also need to modify the tools_conf.xml file to tell Galaxy to offer
+You will also need to modify the ``tools_conf.xml`` file to tell Galaxy to offer
 the tool. e.g. next to the NCBI BLAST+ tools. Simply add the line::
 
     <tool file="ncbi_blast_plus/blastxml_to_top_descr.xml" />
 
-To run the tool's tests, also add this line to tools_conf.xml.sample then::
+If you wish to run the unit tests, alsomove/copy the ``test-data/`` files
+under Galaxy's ``test-data/`` folder. Then::
 
-    $ sh run_functional_tests.sh -id blastxml_to_top_descr
+    $ sh run_tests.sh -id blastxml_to_top_descr
 
 
 History
@@ -54,13 +55,13 @@
 ------- ----------------------------------------------------------------------
 v0.0.1  - Initial version.
 v0.0.2  - Since BLAST+ was moved out of the Galaxy core, now have a dependency
-          on the 'blast_datatypes' repository in the Tool Shed.
+          on the ``blast_datatypes`` repository in the Tool Shed.
 v0.0.3  - Include the test files required to run the unit tests
 v0.0.4  - Quote filenames in case they contain spaces (internal change)
 v0.0.5  - Include number of queries with BLAST matches in stdout (peek text)
 v0.0.6  - Check for errors via the script's return code (internal change)
 v0.0.7  - Link to Tool Shed added to help text and this documentation.
-        - Tweak dependency on blast_datatypes to also work on Test Tool Shed
+        - Tweak dependency on ``blast_datatypes`` to also work on Test Tool Shed
         - Adopt standard MIT License.
 v0.0.8  - Development moved to GitHub, https://github.com/peterjc/galaxy_blast
 v0.0.9  - Updated citation information (Cock et al. 2013).
@@ -70,6 +71,11 @@
         - Support BLAST XML with multiple ``<Iteration>`` blocks per query.
         - Support the default 25 column extended tabular BLAST output.
 v0.1.1  - Embed citation information in the tool XML (new Galaxy feature).
+v0.1.2  - Reorder XML elements (internal change only).
+        - Planemo for Tool Shed upload (``.shed.yml``, internal change only).
+        - Use ``<command detect_errors="aggressive">`` (internal change only).
+        - Single quote command line arguments (internal change only).
+        - Python 3 compatible syntax.
 ======= ======================================================================
 
 
@@ -89,22 +95,31 @@
 As of July 2013, development is continuing on a dedicated GitHub repository:
 https://github.com/peterjc/galaxy_blast
 
-For making the "Galaxy Tool Shed" http://toolshed.g2.bx.psu.edu/ tarball use
-the following command from the GitHub repository root folder::
+For pushing a release to the test or main "Galaxy Tool Shed", use the following
+Planemo commands (which requires you have set your Tool Shed access details in
+``~/.planemo.yml`` and that you have access rights on the Tool Shed)::
+
+    $ planemo shed_update -t testtoolshed --check_diff ~/repositories/galaxy_blast/tools/blastxml_to_top_descr/
+    ...
+
+or::
 
-    $ tar -czf blastxml_to_top_descr.tar.gz tools/blastxml_to_top_descr/README.rst tools/blastxml_to_top_descr/blastxml_to_top_descr.* tools/blastxml_to_top_descr/repository_dependencies.xml test-data/blastp_four_human_vs_rhodopsin.xml test-data/blastp_four_human_vs_rhodopsin_top3.tabular test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular
+    $ planemo shed_update -t toolshed --check_diff ~/repositories/galaxy_blast/tools/blastxml_to_top_descr/
+    ...
+
+To just build and check the tar ball, use::
 
-Check this worked::
-
-    $ tar -tzf blastxml_to_top_descr.tar.gz
+    $ planemo shed_upload --tar_only  ~/repositories/galaxy_blast/tools/blastxml_to_top_descr/
+    ...
+    $ tar -tzf shed_upload.tar.gz
+    test-data/blastp_four_human_vs_rhodopsin.xml
+    test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular
+    test-data/blastp_four_human_vs_rhodopsin_top3.tabular
+    test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular
     tools/blastxml_to_top_descr/README.rst
     tools/blastxml_to_top_descr/blastxml_to_top_descr.py
     tools/blastxml_to_top_descr/blastxml_to_top_descr.xml
     tools/blastxml_to_top_descr/repository_dependencies.xml
-    test-data/blastp_four_human_vs_rhodopsin.xml
-    test-data/blastp_four_human_vs_rhodopsin_top3.tabular
-    test-data/blastp_four_human_vs_rhodopsin_converted_ext.tabular
-    test-data/blastp_four_human_vs_rhodopsin_top3_positive.tabular
 
 
 Licence (MIT)
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d tools/blastxml_to_top_descr/blastxml_to_top_descr.py
--- a/tools/blastxml_to_top_descr/blastxml_to_top_descr.py Wed Jul 30 05:36:52 2014 -0400
+++ b/tools/blastxml_to_top_descr/blastxml_to_top_descr.py Sun Sep 17 13:01:56 2023 +0000
[
b'@@ -6,25 +6,26 @@\n \n Assumes the hits are pre-sorted, so "best" 3 hits gives first 3 hits.\n """\n+from __future__ import print_function\n+\n import os\n+import re\n import sys\n-import re\n from optparse import OptionParser\n \n if "-v" in sys.argv or "--version" in sys.argv:\n-    print "v0.1.0"\n+    print("v0.1.2")\n     sys.exit(0)\n \n-if sys.version_info[:2] >= ( 2, 5 ):\n+if sys.version_info[:2] >= (2, 5):\n     import xml.etree.cElementTree as ElementTree\n else:\n-    from galaxy import eggs\n-    import pkg_resources; pkg_resources.require( "elementtree" )\n+    from galaxy import eggs  # noqa - ignore flake8 F401\n+    import pkg_resources\n+\n+    pkg_resources.require("elementtree")\n     from elementtree import ElementTree\n \n-def stop_err( msg ):\n-    sys.stderr.write("%s\\n" % msg)\n-    sys.exit(1)\n \n usage = """Use as follows:\n \n@@ -39,23 +40,54 @@\n """\n \n parser = OptionParser(usage=usage)\n-parser.add_option("-t", "--topN", dest="topN", default=3,\n-                  help="Number of descriptions to collect (in order from file)")\n-parser.add_option("-o", "--output", dest="out_file", default=None,\n-                  help="Output filename for tabular file",\n-                  metavar="FILE")\n-parser.add_option("-f", "--format", dest="format", default="blastxml",\n-                  help="Input format (blastxml or tabular)")\n-parser.add_option("-q", "--qseqid", dest="qseqid", default="1",\n-                  help="Column for query \'qseqid\' (for tabular input; default 1)")\n-parser.add_option("-s", "--sseqid", dest="sseqid", default="2",\n-                  help="Column for subject \'sseqid\' (for tabular input; default 2)")\n-parser.add_option("-d", "--salltitles", dest="salltitles", default="25",\n-                  help="Column for descriptions \'salltitles\' (for tabular input; default 25)")\n+parser.add_option(\n+    "-t",\n+    "--topN",\n+    dest="topN",\n+    default=3,\n+    help="Number of descriptions to collect (in order from file)",\n+)\n+parser.add_option(\n+    "-o",\n+    "--output",\n+    dest="out_file",\n+    default=None,\n+    help="Output filename for tabular file",\n+    metavar="FILE",\n+)\n+parser.add_option(\n+    "-f",\n+    "--format",\n+    dest="format",\n+    default="blastxml",\n+    help="Input format (blastxml or tabular)",\n+)\n+parser.add_option(\n+    "-q",\n+    "--qseqid",\n+    dest="qseqid",\n+    default="1",\n+    help="Column for query \'qseqid\' (for tabular input; default 1)",\n+)\n+parser.add_option(\n+    "-s",\n+    "--sseqid",\n+    dest="sseqid",\n+    default="2",\n+    help="Column for subject \'sseqid\' (for tabular input; default 2)",\n+)\n+parser.add_option(\n+    "-d",\n+    "--salltitles",\n+    dest="salltitles",\n+    default="25",\n+    help="Column for descriptions \'salltitles\' (for tabular input; default 25)",\n+)\n (options, args) = parser.parse_args()\n \n if len(sys.argv) == 4 and len(args) == 3 and not options.out_file:\n-    stop_err("""The API has changed, replace this:\n+    sys.exit(\n+        """The API has changed, replace this:\n \n $ python blastxml_to_top_descr.py input.xml output.tab 3\n \n@@ -64,12 +96,13 @@\n $ python blastxml_to_top_descr.py -o output.tab -t 3 input.xml\n \n Sorry.\n-""")\n+"""\n+    )\n \n if not args:\n-    stop_err("Input filename missing, try -h")\n+    sys.exit("Input filename missing, try -h")\n if len(args) > 1:\n-    stop_err("Expects a single argument, one input filename")\n+    sys.exit("Expects a single argument, one input filename")\n in_file = args[0]\n out_file = options.out_file\n topN = options.topN\n@@ -77,12 +110,12 @@\n try:\n     topN = int(topN)\n except ValueError:\n-    stop_err("Number of hits  argument should be an integer (at least 1)")\n+    sys.exit("Number of hits  argument should be an integer (at least 1)")\n if topN < 1:\n-    stop_err("Number of hits  argument should be an integer (at least 1)")\n+    sys.exit("Number of hits  argument should be an integer (at least 1)")\n \n if not os.path.isfile(in_file):\n-    stop_err("Missing input file: %r" % in_file)\n+    sys.exit("Missing input file: %r" % in_fil'..b'         # <Iteration_query-def>Endoplasmic reticulum resident protein 44 OS=Homo sapiens GN=ERP44 PE=1 SV=1</Iteration_query-def>\n+            # <Iteration_query-def>Endoplasmic reticulum resident protein 44\n+            # OS=Homo sapiens GN=ERP44 PE=1 SV=1</Iteration_query-def>\n             # <Iteration_query-len>406</Iteration_query-len>\n             # <Iteration_hits></Iteration_hits>\n             #\n@@ -177,10 +216,12 @@\n             # <Iteration_hits>...\n             qseqid = elem.findtext("Iteration_query-ID")\n             if qseqid is None:\n-                stop_err("Missing <Iteration_query-ID> (could be really old BLAST XML data?)")\n+                sys.exit(\n+                    "Missing <Iteration_query-ID> (could be really old BLAST XML data?)"\n+                )\n             if re_default_query_id.match(qseqid):\n-                #Place holder ID, take the first word of the query definition\n-                qseqid = elem.findtext("Iteration_query-def").split(None,1)[0]\n+                # Place holder ID, take the first word of the query definition\n+                qseqid = elem.findtext("Iteration_query-def").split(None, 1)[0]\n             if current_query is None:\n                 # First hit\n                 current_query = qseqid\n@@ -203,17 +244,19 @@\n                 # <Hit_accession>P56514</Hit_accession>\n                 # or,\n                 # <Hit_id>Subject_1</Hit_id>\n-                # <Hit_def>gi|57163783|ref|NP_001009242.1| rhodopsin [Felis catus]</Hit_def>\n+                # <Hit_def>gi|57163783|ref|NP_001009242.1|\n+                # rhodopsin [Felis catus]</Hit_def>\n                 # <Hit_accession>Subject_1</Hit_accession>\n                 #\n-                #apparently depending on the parse_deflines switch\n-                sseqid = hit.findtext("Hit_id").split(None,1)[0]\n+                # apparently depending on the parse_deflines switch\n+                sseqid = hit.findtext("Hit_id").split(None, 1)[0]\n                 hit_def = sseqid + " " + hit.findtext("Hit_def")\n-                if re_default_subject_id.match(sseqid) \\\n-                and sseqid == hit.findtext("Hit_accession"):\n-                    #Place holder ID, take the first word of the subject definition\n+                if re_default_subject_id.match(sseqid) and sseqid == hit.findtext(\n+                    "Hit_accession"\n+                ):\n+                    # Place holder ID, take the first word of the subject definition\n                     hit_def = hit.findtext("Hit_def")\n-                    sseqid = hit_def.split(None,1)[0]\n+                    sseqid = hit_def.split(None, 1)[0]\n                 assert hit_def not in hit_descrs\n                 hit_descrs.append(hit_def)\n             # prevents ElementTree from growing large datastructure\n@@ -223,6 +266,7 @@\n         # Final query\n         yield current_query, hit_descrs\n \n+\n if options.format == "blastxml":\n     hits = blastxml_hits(in_file)\n elif options.format == "tabular":\n@@ -231,21 +275,23 @@\n     salltitles = get_column(options.salltitles)\n     hits = tabular_hits(in_file, qseqid, sseqid, salltitles)\n else:\n-    stop_err("Unsupported format: %r" % options.format)\n+    sys.exit("Unsupported format: %r" % options.format)\n \n \n def best_hits(descriptions, topN):\n+    """Truncate given descriptions list to at most N entries."""\n     if len(descriptions) < topN:\n-        return descriptions +  [""] * (topN - len(descriptions))\n+        return descriptions + [""] * (topN - len(descriptions))\n     else:\n         return descriptions[:topN]\n \n+\n count = 0\n if out_file is None:\n     outfile = sys.stdout\n else:\n-    outfile = open(out_file, \'w\')\n-outfile.write("#Query\\t%s\\n" % "\\t".join("BLAST hit %i" % (i+1) for i in range(topN)))\n+    outfile = open(out_file, "w")\n+outfile.write("#Query\\t%s\\n" % "\\t".join("BLAST hit %i" % (i + 1) for i in range(topN)))\n for query, descrs in hits:\n     count += 1\n     outfile.write("%s\\t%s\\n" % (query, "\\t".join(best_hits(descrs, topN))))\n'
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d tools/blastxml_to_top_descr/blastxml_to_top_descr.xml
--- a/tools/blastxml_to_top_descr/blastxml_to_top_descr.xml Wed Jul 30 05:36:52 2014 -0400
+++ b/tools/blastxml_to_top_descr/blastxml_to_top_descr.xml Sun Sep 17 13:01:56 2023 +0000
b
@@ -1,27 +1,27 @@
-<tool id="blastxml_to_top_descr" name="BLAST top hit descriptions" version="0.1.1">
+<tool id="blastxml_to_top_descr" name="BLAST top hit descriptions" version="0.1.2" profile="16.10">
     <description>Make a table from BLAST output</description>
-    <version_command interpreter="python">blastxml_to_top_descr.py --version</version_command>
-    <command interpreter="python">
-blastxml_to_top_descr.py
--f "$input.in_format"
+    <requirements>
+        <requirement type="package" version="3.9">python</requirement>
+    </requirements>
+    <version_command>
+python $__tool_directory__/blastxml_to_top_descr.py --version
+    </version_command>
+    <command detect_errors="aggressive">
+python $__tool_directory__/blastxml_to_top_descr.py
+-f '$input.in_format'
 #if $input.in_format == "tabular":
     --qseqid $input.qseqid
     --sseqid $input.sseqid
     --salltitles $input.salltitles
 #end if
--o "${tabular_file}"
+-o '${tabular_file}'
 -t ${topN}
-"${in_file}"
+'${in_file}'
     </command>
-    <stdio>
-        <!-- Assume anything other than zero is an error -->
-        <exit_code range="1:" />
-        <exit_code range=":-1" />
-    </stdio>
     <inputs>
         <conditional name="input">
             <param name="in_format" type="select" label="Input format">
-                <option value="blastxml" select="True">BLAST XML</option>
+                <option value="blastxml" selected="true">BLAST XML</option>
                 <option value="tabular">Tabular</option>
             </param>
             <when value="blastxml">
@@ -30,17 +30,17 @@
             <when value="tabular">
                 <param name="in_file" type="data" format="tabular" label="BLAST results as tabular"/>
                 <param name="qseqid" type="data_column" data_ref="in_file"
-        multiple="False" numerical="False" default_value="1" value="1"
-        label="Column containing query ID (qseqid)"
-        help="This is column 1 in standard BLAST tabular output" />
- <param name="sseqid" type="data_column" data_ref="in_file"
-        multiple="False" numerical="False" default_value="2" value="2"
-        label="Column containing match ID (sseqid)"
-        help="This is column 2 in standard BLAST tabular output"/>
+                       multiple="false" numerical="false" default_value="1" value="1"
+                       label="Column containing query ID (qseqid)"
+                       help="This is column 1 in standard BLAST tabular output" />
+                <param name="sseqid" type="data_column" data_ref="in_file"
+                       multiple="false" numerical="false" default_value="2" value="2"
+                       label="Column containing match ID (sseqid)"
+                       help="This is column 2 in standard BLAST tabular output"/>
                 <param name="salltitles" type="data_column" data_ref="in_file"
-        multiple="False" numerical="False" default_value="25" value="25"
+                       multiple="false" numerical="false" default_value="25" value="25"
                        label="Column containing containing descriptions (salltitles)"
-        help="This is column 25 in the default extended BLAST tabular output"/>
+                       help="This is column 25 in the default extended BLAST tabular output"/>
             </when>
         </conditional>
         <param name="topN" type="integer" min="1" max="100" optional="false" label="Number of descriptions" value="3"/>
@@ -48,8 +48,6 @@
     <outputs>
         <data name="tabular_file" format="tabular" label="Top $topN descriptions from $input.in_file.name" />
     </outputs>
-    <requirements>
-    </requirements>
     <tests>
         <test>
             <param name="in_format" value="blastxml" />
@@ -102,7 +100,7 @@
 Peter J.A. Cock, Björn A. Grüning, Konrad Paszkiewicz and Leighton Pritchard (2013).
 Galaxy tools and workflows for sequence analysis with applications
 in molecular plant pathology. PeerJ 1:e167
-http://dx.doi.org/10.7717/peerj.167
+https://doi.org/10.7717/peerj.167
 
 This wrapper is available to install into other Galaxy Instances via the Galaxy
 Tool Shed at http://toolshed.g2.bx.psu.edu/view/peterjc/blastxml_to_top_descr
b
diff -r fe1ed74793c9 -r 8dc4ba7eba5d tools/blastxml_to_top_descr/repository_dependencies.xml
--- a/tools/blastxml_to_top_descr/repository_dependencies.xml Wed Jul 30 05:36:52 2014 -0400
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,4 +0,0 @@
-<?xml version="1.0"?>
-<repositories description="Requires BLAST XML and database datatype definitions.">
-<repository changeset_revision="de11e1a921c4" name="blast_datatypes" owner="devteam" toolshed="https://toolshed.g2.bx.psu.edu" />
-</repositories>