Repository 'uniprot_rest_interface'
hg clone https://toolshed.g2.bx.psu.edu/repos/bgruening/uniprot_rest_interface

Changeset 1:cd2a41c65447 (2016-10-14)
Previous changeset 0:48522382b6a4 (2015-10-09) Next changeset 2:fe94765e8814 (2017-04-10)
Commit message:
planemo upload for repository https://github.com/bgruening/galaxytools/tree/master/tools/uniprot_rest_interface commit fb201f32a92466c2bd8086e91bbf777401f1b489
modified:
test-data/test1_map.tab
test-data/test1_retrieve.fasta
test-data/test2_retrieve.gff
tool_dependencies.xml
uniprot.py
uniprot.xml
b
diff -r 48522382b6a4 -r cd2a41c65447 test-data/test1_map.tab
--- a/test-data/test1_map.tab Fri Oct 09 16:42:22 2015 -0400
+++ b/test-data/test1_map.tab Fri Oct 14 17:59:02 2016 -0400
b
@@ -4,7 +4,7 @@
 A0A077ZFY8 TTRE_0000758701
 M5B8V9 CMN_01519
 M5BAG7 cydC
-S0DS17 FFUJ_00006
+S0DS17 apf8
 A0A077Z587 TTRE_0000309301
 Q13685 AAMP
 O14639 ABLIM1
b
diff -r 48522382b6a4 -r cd2a41c65447 test-data/test1_retrieve.fasta
--- a/test-data/test1_retrieve.fasta Fri Oct 09 16:42:22 2015 -0400
+++ b/test-data/test1_retrieve.fasta Fri Oct 14 17:59:02 2016 -0400
b
@@ -1,4 +1,4 @@
->tr|S0DS17|S0DS17_GIBF5 Related to cytochrom P450 OS=Gibberella fujikuroi (strain CBS 195.34 / IMI 58289 / NRRL A-6831) GN=FFUJ_00006 PE=3 SV=1
+>sp|S0DS17|APF8_GIBF5 Cytochrome P450 momooxygenase apf8 OS=Gibberella fujikuroi (strain CBS 195.34 / IMI 58289 / NRRL A-6831) GN=apf8 PE=1 SV=1
 MSYQSILLRQVNSLCDNLEEVARDENGGLIDMAMQSDYFTFDVMSEVIFGMAYNALKDTS
 YRFVTGALGSSNIRIGTLVQSPLPAMCRIDKYLFPESIQGRNKFLGFIGSLLRDRSKASF
 AGNGNVFSFLETAKDPDGGNQLSKSEIRAECATLVAAGTDTSSSTLAATLFYLSRNSKCY
@@ -6,7 +6,7 @@
 LTLPAGVDVGTGIYSLHHNAAYHPEPFKYLPERWLVGEGSSTSESVELARSAFAPFSRGP
 RSCVGKGFAYHELTLTIAHILHRFDFSATEEDFALRHGSEGPGGINEFLLHDHVTGARSG
 PLLQFSMRR
->tr|M5BAG7|M5BAG7_9MICO ABC transporter, fused permease/ABC transporter involved in the biosynthesis of cytochrom bd, fused permease/ATP-binding protein OS=Clavibacter michiganensis subsp. nebraskensis NCPPB 2581 GN=cydC PE=3 SV=1
+>tr|M5BAG7|M5BAG7_9MICO ABC transporter, fused permease/ABC transporter involved in the biosynthesis of cytochrom bd, fused permease/ATP-binding protein OS=Clavibacter michiganensis subsp. nebraskensis NCPPB 2581 GN=cydC PE=4 SV=1
 MNRDGVLRLAQPPTRRTLPGLLAGLASAVGAVALLATSAWLITRASEQPPILFLGMAIVG
 VRAFALGRAAFRYLERITSHDAAFRALATLRVGVFERLLPFAPAGLRDTRRGDLLARLVG
 DVDRLQDLPLRVVQPLAVSVVVQAASVAVVGAVLPAAGIALAVVLGVALVVGIGATTALA
@@ -31,7 +31,7 @@
 SASFALILPAGALWALYKSARVTKQKKSGGWTMTHTIAQTCGMVIVAAGAVCSIQAKRDN
 GKHFGSVHGVLGIIVIALLCVQVALGFSKSLIRTEAQRRTINRVHFWLAIVLLPLAFLNI
 ILGLQLIAVPVGLLLGFFVHIFCLLAALGLILPILRFRKANRSVAFPPPNDD
->tr|A0A077ZFY8|A0A077ZFY8_TRITR PmbA TldD and Mur ligase M and Mur ligase and Mur ligase C and Cytochrom B562 domain containing protein OS=Trichuris trichiura GN=TTRE_0000758701 PE=4 SV=1
+>tr|A0A077ZFY8|A0A077ZFY8_TRITR PmbA TldD and Mur ligase M and Mur ligase and Mur ligase C and Cytochrom B562 domain containing protein OS=Trichuris trichiura GN=TTRE_0000758701 PE=3 SV=1
 MGGLAMLARQLGHEVTGSDANVYPPMSTLLEKQGIELIQGYDASQLDPQPDLVIIGNAMT
 RGNPCVEAVLEKNIPYMSGPQWLHDFVLRDRWVLAVAGTHGKTTTAGMATWILEQCGYKP
 GFVIGGVPGNFEVSARLGESNFFVIEADEYDCAFFDKRSKFVHYCPRTLILNNLEFDHAD
@@ -63,7 +63,7 @@
 QLQEEQLMKLNSGLGQLILKEEMEKESRERSSLLASRYDSPINSASHIPSSKTASLPGYG
 RNGLHRPVSTDFAQYNSYGDVSGGVRDYQTLPDGHMPAMRMDRGVSMPNMLEPKIFPYEM
 LMVTNRGRNKILREVDRTRLERHLAPEVFREIFGMSIQEFDRLPLWRRNDMKKKAKLF
->tr|M5B8V9|M5B8V9_9MICO ABC transporter involved in the biosynthesis of cytochrom bd, fused permease/ATP-binding protein OS=Clavibacter michiganensis subsp. nebraskensis NCPPB 2581 GN=CMN_01519 PE=3 SV=1
+>tr|M5B8V9|M5B8V9_9MICO ABC transporter involved in the biosynthesis of cytochrom bd, fused permease/ATP-binding protein OS=Clavibacter michiganensis subsp. nebraskensis NCPPB 2581 GN=CMN_01519 PE=4 SV=1
 MKPLDPRLLRHSASARTMLAVGAVVSVVQTAALVAFCWSLTQLVVRAIGGADQAALAPVL
 ALAVGSAVVRGAAAWLLDVTGARGAARVTAELRRRALRAIADLGPAWTAARSRGRLATIV
 GPGLDALDPYFARYVPQLILTALATPIVVAVLLLSDPLTGVTVLVTLPVIPVFMVLVGWA
@@ -86,7 +86,7 @@
 EAARAGEQGRGFAVVASEVRTLASRSAQAAKEIEGLISESVRLIDLGSDEVATAGKTMST
 IVDAVASVTHIMQEIAAASDEQSRGITQVSQAISEMDKVTQQNASLVEEASAAAVSLEEQ
 AARLTEAVDVFRLHKHSVSAEPRGAGEPVSFATV
->tr|Q0P8A9|Q0P8A9_CAMJE Putative formate dehydrogenase, cytochrom B subunit OS=Campylobacter jejuni subsp. jejuni serotype O:2 (strain NCTC 11168) GN=fdhC PE=4 SV=1
+>tr|Q0P8A9|Q0P8A9_CAMJE Putative formate dehydrogenase, cytochrom B subunit OS=Campylobacter jejuni subsp. jejuni serotype O:2 (strain ATCC 700819 / NCTC 11168) GN=fdhC PE=4 SV=1
 MRKVFVTLLLSVVSLFAYGSERMGQDTQIWDFHRITNIPNYDTFGKLWTTLQGEYIATIA
 LIAVIAVLSAFALHYMVIGPKQFSHDGKKIYAFTLFERLFHFIAAISWVILVPTGFVMMF
 GEVFGGGVFVRVCKNLHAFATILFIISIIPMFLCWIKRMLPASYDIRWMMIVGGYLSKIK
b
diff -r 48522382b6a4 -r cd2a41c65447 test-data/test2_retrieve.gff
--- a/test-data/test2_retrieve.gff Fri Oct 09 16:42:22 2015 -0400
+++ b/test-data/test2_retrieve.gff Fri Oct 14 17:59:02 2016 -0400
b
b'@@ -1,45 +1,91 @@\n ##gff-version 3\n ##sequence-region S0DS17 1 369\n+S0DS17\tUniProtKB\tChain\t1\t369\t.\t.\t.\tID=PRO_0000437163;Note=Cytochrome P450 momooxygenase apf8\t\n+S0DS17\tUniProtKB\tMetal binding\t303\t303\t.\t.\t.\tNote=Iron (heme axial ligand);Ontology_term=ECO:0000250;evidence=ECO:0000250|UniProtKB:P04798\t\n ##sequence-region M5BAG7 1 563\n+M5BAG7\tUniProtKB\tTransmembrane\t21\t43\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tTransmembrane\t49\t71\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tTransmembrane\t132\t153\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tTransmembrane\t159\t181\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tTransmembrane\t236\t259\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tTransmembrane\t274\t296\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5BAG7\tUniProtKB\tDomain\t20\t301\t.\t.\t.\tNote=ABC transmembrane type-1;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50929\t\n+M5BAG7\tUniProtKB\tDomain\t345\t559\t.\t.\t.\tNote=ABC transporter;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50893\t\n ##sequence-region A0A077Z587 1 772\n+A0A077Z587\tUniProtKB\tTransmembrane\t593\t617\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077Z587\tUniProtKB\tTransmembrane\t637\t656\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077Z587\tUniProtKB\tTransmembrane\t668\t692\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077Z587\tUniProtKB\tTransmembrane\t704\t727\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077Z587\tUniProtKB\tTransmembrane\t733\t755\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077Z587\tUniProtKB\tDomain\t20\t94\t.\t.\t.\tNote=PDZ (DHR);Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50106\t\n+A0A077Z587\tUniProtKB\tDomain\t552\t761\t.\t.\t.\tNote=Cytochrome b561;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50939\t\n ##sequence-region A0A077ZFY8 1 973\n+A0A077ZFY8\tUniProtKB\tDomain\t1\t89\t.\t.\t.\tNote=Mur_ligase;Ontology_term=ECO:0000259;evidence=ECO:0000259|Pfam:PF01225\t\n+A0A077ZFY8\tUniProtKB\tDomain\t96\t279\t.\t.\t.\tNote=Mur_ligase_M;Ontology_term=ECO:0000259;evidence=ECO:0000259|Pfam:PF08245\t\n+A0A077ZFY8\tUniProtKB\tDomain\t300\t349\t.\t.\t.\tNote=Mur_ligase_C;Ontology_term=ECO:0000259;evidence=ECO:0000259|Pfam:PF02875\t\n ##sequence-region O14639 1 778\n O14639\tUniProtKB\tChain\t1\t778\t.\t.\t.\tID=PRO_0000075697;Note=Actin-binding LIM protein 1\t\n-O14639\tUniProtKB\tDomain\t97\t156\t.\t.\t.\tNote=LIM zinc-binding 1;evidence=ECO:0000255|PROSITE-ProRule:PRU00125\t\n-O14639\tUniProtKB\tDomain\t156\t216\t.\t.\t.\tNote=LIM zinc-binding 2;evidence=ECO:0000255|PROSITE-ProRule:PRU00125\t\n-O14639\tUniProtKB\tDomain\t224\t283\t.\t.\t.\tNote=LIM zinc-binding 3;evidence=ECO:0000255|PROSITE-ProRule:PRU00125\t\n-O14639\tUniProtKB\tDomain\t283\t343\t.\t.\t.\tNote=LIM zinc-binding 4;evidence=ECO:0000255|PROSITE-ProRule:PRU00125\t\n-O14639\tUniProtKB\tDomain\t710\t778\t.\t.\t.\tNote=HP;evidence=ECO:0000255|PROSITE-ProRule:PRU00595\t\n-O14639\tUniProtKB\tCoiled coil\t590\t614\t.\t.\t.\tevidence=ECO:0000255\t\n-O14639\tUniProtKB\tModified residue\t367\t367\t.\t.\t.\tNote=Phosphoserine;evidence=ECO:0000244|PubMed:19690332\t\n-O14639\tUniProtKB\tModified residue\t373\t373\t.\t.\t.\tNote=Phosphotyrosine;evidence=ECO:0000244|PubMed:19690332\t\n-O14639\tUniProtKB\tModified residue\t396\t396\t.\t.\t.\tNote=Phosphotyrosine;evidence=ECO:0000244|PubMed:15592455\t\n-O14639\tUniProtKB\tModified residue\t426\t426\t.\t.\t.\tNote=Phosphoserine;evidence=ECO:0000244|PubMed:19690332,ECO:0000244|PubMed:24275569\t\n-O14639\tUniProtKB\tModified residue\t431\t431\t.\t.\t.\tNote=Phosphoserine;evidence=ECO:0000244|PubMed:18669648,ECO:0000244|PubMed:19690332\t\n-O14639\tUniProtKB\tModified residue\t433\t433\t.\t.\t.\tNote=Phosphothreonine;evidence=ECO:0000244|Pu'..b'34\t.\t.\t.\tID=VAR_050141;Note=P->T;Dbxref=dbSNP:rs11593544\t\n+O14639\tUniProtKB\tNatural variant\t637\t637\t.\t.\t.\tID=VAR_050142;Note=R->G;Dbxref=dbSNP:rs7091419\t\n+O14639\tUniProtKB\tSequence conflict\t499\t499\t.\t.\t.\tNote=R->L;Ontology_term=ECO:0000305;evidence=ECO:0000305\t\n+O14639\tUniProtKB\tSequence conflict\t532\t532\t.\t.\t.\tNote=A->R;Ontology_term=ECO:0000305;evidence=ECO:0000305\t\n+O14639\tUniProtKB\tSequence conflict\t563\t563\t.\t.\t.\tNote=K->E;Ontology_term=ECO:0000305;evidence=ECO:0000305\t\n+O14639\tUniProtKB\tSequence conflict\t578\t578\t.\t.\t.\tNote=V->I;Ontology_term=ECO:0000305;evidence=ECO:0000305\t\n ##sequence-region M5B8V9 1 582\n+M5B8V9\tUniProtKB\tTransmembrane\t20\t43\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5B8V9\tUniProtKB\tTransmembrane\t55\t77\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5B8V9\tUniProtKB\tTransmembrane\t134\t154\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5B8V9\tUniProtKB\tTransmembrane\t161\t180\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5B8V9\tUniProtKB\tTransmembrane\t236\t260\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+M5B8V9\tUniProtKB\tDomain\t20\t302\t.\t.\t.\tNote=ABC transmembrane type-1;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50929\t\n+M5B8V9\tUniProtKB\tDomain\t340\t570\t.\t.\t.\tNote=ABC transporter;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50893\t\n ##sequence-region A0A077ZHN8 1 634\n+A0A077ZHN8\tUniProtKB\tTransmembrane\t14\t36\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077ZHN8\tUniProtKB\tTransmembrane\t56\t80\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077ZHN8\tUniProtKB\tTransmembrane\t113\t132\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077ZHN8\tUniProtKB\tTransmembrane\t290\t310\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+A0A077ZHN8\tUniProtKB\tDomain\t312\t364\t.\t.\t.\tNote=HAMP;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50885\t\n+A0A077ZHN8\tUniProtKB\tDomain\t369\t598\t.\t.\t.\tNote=Methyl-accepting transducer;Ontology_term=ECO:0000259;evidence=ECO:0000259|PROSITE:PS50111\t\n+A0A077ZHN8\tUniProtKB\tCoiled coil\t170\t204\t.\t.\t.\tOntology_term=ECO:0000256;evidence=ECO:0000256|SAM:Coils\t\n+A0A077ZHN8\tUniProtKB\tCoiled coil\t569\t607\t.\t.\t.\tOntology_term=ECO:0000256;evidence=ECO:0000256|SAM:Coils\t\n ##sequence-region Q0P8A9 1 310\n+Q0P8A9\tUniProtKB\tTransmembrane\t55\t78\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+Q0P8A9\tUniProtKB\tTransmembrane\t99\t124\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+Q0P8A9\tUniProtKB\tTransmembrane\t136\t156\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+Q0P8A9\tUniProtKB\tTransmembrane\t195\t216\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+Q0P8A9\tUniProtKB\tTransmembrane\t244\t264\t.\t.\t.\tNote=Helical;Ontology_term=ECO:0000256;evidence=ECO:0000256|SAM:Phobius\t\n+Q0P8A9\tUniProtKB\tDomain\t93\t274\t.\t.\t.\tNote=Ni_hydr_CYTB;Ontology_term=ECO:0000259;evidence=ECO:0000259|Pfam:PF01292\t\n ##sequence-region Q13685 1 434\n Q13685\tUniProtKB\tChain\t1\t434\t.\t.\t.\tID=PRO_0000050832;Note=Angio-associated migratory cell protein\t\n Q13685\tUniProtKB\tRepeat\t89\t129\t.\t.\t.\tNote=WD 1\t\n@@ -51,5 +97,5 @@\n Q13685\tUniProtKB\tRepeat\t356\t395\t.\t.\t.\tNote=WD 7\t\n Q13685\tUniProtKB\tRepeat\t398\t433\t.\t.\t.\tNote=WD 8\t\n Q13685\tUniProtKB\tCompositional bias\t53\t59\t.\t.\t.\tNote=Poly-Glu\t\n-Q13685\tUniProtKB\tModified residue\t20\t20\t.\t.\t.\tNote=Phosphoserine;evidence=ECO:0000244|PubMed:24275569\t\n-Q13685\tUniProtKB\tNatural variant\t250\t250\t.\t.\t.\tID=VAR_037061;Dbxref=dbSNP:rs2305835\t\n+Q13685\tUniProtKB\tModified residue\t20\t20\t.\t.\t.\tNote=Phosphoserine;Ontology_term=ECO:0000244;evidence=ECO:0000244|PubMed:24275569;Dbxref=PMID:24275569\t\n+Q13685\tUniProtKB\tNatural variant\t250\t250\t.\t.\t.\tID=VAR_037061;Note=I->V;Dbxref=dbSNP:rs2305835\t\n'
b
diff -r 48522382b6a4 -r cd2a41c65447 tool_dependencies.xml
--- a/tool_dependencies.xml Fri Oct 09 16:42:22 2015 -0400
+++ b/tool_dependencies.xml Fri Oct 14 17:59:02 2016 -0400
b
@@ -1,6 +1,6 @@
 <?xml version="1.0"?>
 <tool_dependency>
     <package name="requests" version="2.7">
-        <repository changeset_revision="ad6b0c21d92b" name="package_python_2_7_requests_2_7" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
+        <repository changeset_revision="7e330b122c8c" name="package_python_2_7_requests_2_7" owner="iuc" toolshed="https://toolshed.g2.bx.psu.edu" />
     </package>
 </tool_dependency>
b
diff -r 48522382b6a4 -r cd2a41c65447 uniprot.py
--- a/uniprot.py Fri Oct 09 16:42:22 2015 -0400
+++ b/uniprot.py Fri Oct 14 17:59:02 2016 -0400
[
@@ -8,12 +8,14 @@
     map
     retrieve
 """
+import argparse
+import sys
 
 import requests
-import sys, argparse
 
 url = 'http://www.uniprot.org/'
 
+
 def _retrieve(query, format='txt'):
     """_retrieve is not meant for use with the python interface, use `retrieve`
     instead"""
@@ -22,25 +24,12 @@
     query = list(set(query.split('\n')))
     queries = [query[i:i+100] for i in range(0, len(query), 100)]
 
-    data = {'format':format}
+    data = {'format': format}
 
-    responses = [requests.post(url + tool, data=data, files={'file':' '.join(query)}) for query in queries]
-    page = ''.join([response.text for response in responses])
+    responses = [requests.post(url + tool, data=data, files={'file': ' '.join(_)}) for _ in queries]
+    page = ''.join(response.text for response in responses)
     return page
 
-def retrieve(ids, format='txt'):
-    """ request entries by uniprot acc using batch retrieval
-
-    Args:
-        query: list of ids to retrieve
-        format: txt by default
-
-    Help:
-        possible formats:
-        txt, xml, rdf, fasta, gff"""
-    if type(ids) is not list:
-        ids = [ids]
-    return _retrieve(' '.join(ids), format)
 
 def _map(query, f, t, format='tab'):
     """ _map is not meant for use with the python interface, use `map` instead
@@ -48,44 +37,17 @@
     tool = 'mapping/'
 
     data = {
-            'from':f,
-            'to':t,
-            'format':format,
+            'from': f,
+            'to': t,
+            'format': format,
             'query': query
             }
     response = requests.post(url + tool, data=data)
     page = response.text
     return page
 
-def map(ids, f, t, format='tab'):
-    """ map a list of ids from one format onto another using uniprots mapping api
-    
-    Args:
-        query: id or list of ids to be mapped
-        f: from ACC | P_ENTREZGENEID | ...
-        t: to ...
-        format: tab by default
-
-    Help:
-        for a list of all possible mappings visit
-        'http://www.uniprot.org/faq/28'
-    """
-    if type(ids) is not list:
-        ids = [ids]
-    page = _map(' '.join(ids), f, t, format)
-    result = dict()
-    for row in page.splitlines()[1:]:
-        key, value = row.split('\t')
-        if key in result:
-            result[key].add(value)
-        else:
-            result[key] = set([value])
-    return result
 
 if __name__ == '__main__':
-    import argparse
-    import sys
-
     parser = argparse.ArgumentParser(description='retrieve uniprot mapping')
     subparsers = parser.add_subparsers(dest='tool')
 
@@ -93,16 +55,16 @@
     mapping.add_argument('f', help='from')
     mapping.add_argument('t', help='to')
     mapping.add_argument('inp', nargs='?', type=argparse.FileType('r'),
-            default=sys.stdin, help='input file (default: stdin)')
+                         default=sys.stdin, help='input file (default: stdin)')
     mapping.add_argument('out', nargs='?', type=argparse.FileType('w'),
-            default=sys.stdout, help='output file (default: stdout)')
+                         default=sys.stdout, help='output file (default: stdout)')
     mapping.add_argument('--format', default='tab', help='output format')
 
     retrieve = subparsers.add_parser('retrieve')
-    retrieve.add_argument('inp', metavar = 'in', nargs='?', type=argparse.FileType('r'),
-            default=sys.stdin, help='input file (default: stdin)')
+    retrieve.add_argument('inp', metavar='in', nargs='?', type=argparse.FileType('r'),
+                          default=sys.stdin, help='input file (default: stdin)')
     retrieve.add_argument('out', nargs='?', type=argparse.FileType('w'),
-            default=sys.stdout, help='output file (default: stdout)')
+                          default=sys.stdout, help='output file (default: stdout)')
     retrieve.add_argument('-f', '--format', help='specify output format', default='txt')
 
     args = parser.parse_args()
@@ -113,5 +75,3 @@
 
     elif args.tool == 'retrieve':
         args.out.write(_retrieve(query, format=args.format))
-
-
b
diff -r 48522382b6a4 -r cd2a41c65447 uniprot.xml
--- a/uniprot.xml Fri Oct 09 16:42:22 2015 -0400
+++ b/uniprot.xml Fri Oct 14 17:59:02 2016 -0400
[
@@ -24,68 +24,68 @@
         #elif $tool.tool_choice == "map":
             map
 
-            #if $tool.from.category_FROM == "uniprot":
-                $tool.from.db_uniprot_FROM
-            #elif $tool.from.category_FROM == "oseqdb":
-                $tool.from.db_oseqdb
-            #elif $tool.from.category_FROM == "3Dstrdb":
-                $tool.from.db_3Dstrdb
-            #elif $tool.from.category_FROM == "ppidb":
-                $tool.from.db_ppidb
-            #elif $tool.from.category_FROM == "chemistry":
-                $tool.from.db_chemistry
-            #elif $tool.from.category_FROM == "protfgdb":
-                $tool.from.db_protfgdb
-            #elif $tool.from.category_FROM == "polymorphismANDmutation":
-                $tool.from.db_polymorphismANDmutation
-            #elif $tool.from.category_FROM == "db_2DgelDB":
-                $tool.from.db_2DgelDB
-            #elif $tool.from.category_FROM == "ProtocolsMaterialsDB":
-                $tool.from.ProtocolsMaterialsDB
-            #elif $tool.from.category_FROM == "db_GenomeAnnotationDB":
-                $tool.from.db_GenomeAnnotationDB
-            #elif $tool.from.category_FROM == "db_OrganismSpecificGeneDB":
-                $tool.from.db_OrganismSpecificGeneDB
-            #elif $tool.from.category_FROM == "db_phylogenomic":
-                $tool.from.db_phylogenomic
-            #elif $tool.from.category_FROM == "db_EnzymePathwayDB":
-                $tool.from.db_EnzymePathwayDB
-            #elif $tool.from.category_FROM == "db_GeneExpression":
-                $tool.from.db_GeneExpression
-            #elif $tool.from.category_FROM == "db_other":
-                $tool.from.db_other
+            #if $tool.from.category_FROM == "uniprot"
+                '${tool.from.db_uniprot_FROM}'
+            #elif $tool.from.category_FROM == "oseqdb"
+                ${tool.from.db_oseqdb}
+            #elif $tool.from.category_FROM == "3Dstrdb"
+                ${tool.from.db_3Dstrdb}
+            #elif $tool.from.category_FROM == "ppidb"
+                ${tool.from.db_ppidb}
+            #elif $tool.from.category_FROM == "chemistry"
+                ${tool.from.db_chemistry}
+            #elif $tool.from.category_FROM == "protfgdb"
+                ${tool.from.db_protfgdb}
+            #elif $tool.from.category_FROM == "polymorphismANDmutation"
+                ${tool.from.db_polymorphismANDmutation}
+            #elif $tool.from.category_FROM == "2DgelDB"
+                ${tool.from.db_2DgelDB}
+            #elif $tool.from.category_FROM == "ProtocolsMaterialsDB"
+                ${tool.from.db_ProtocolsMaterialsDB}
+            #elif $tool.from.category_FROM == "GenomeAnnotationDB"
+                ${tool.from.db_GenomeAnnotationDB}
+            #elif $tool.from.category_FROM == "OrganismSpecificGeneDB"
+                ${tool.from.db_OrganismSpecificGeneDB}
+            #elif $tool.from.category_FROM == "phylogenomic"
+                ${tool.from.db_phylogenomic}
+            #elif $tool.from.category_FROM == "EnzymePathwayDB"
+                ${tool.from.db_EnzymePathwayDB}
+            #elif $tool.from.category_FROM == "GeneExpression"
+                ${tool.from.db_GeneExpression}
+            #elif $tool.from.category_FROM == "other"
+                ${tool.from.db_other}
             #end if
 
-            #if $tool.to.category_TO == "uniprot":
-                $tool.to.db_uniprot_TO
-            #elif $tool.to.category_TO == "oseqdb":
-                $tool.to.db_oseqdb
-            #elif $tool.to.category_TO == "3Dstrdb":
-                $tool.to.db_3Dstrdb
-            #elif $tool.to.category_TO == "ppidb":
-                $tool.to.db_ppidb
-            #elif $tool.to.category_TO == "chemistry":
-                $tool.to.db_chemistry
-            #elif $tool.to.category_TO == "protfgdb":
-                $tool.to.db_protfgdb
-            #elif $tool.to.category_TO == "polymorphismANDmutation":
-                $tool.to.db_polymorphismANDmutation
-            #elif $tool.to.category_TO == "db_2DgelDB":
-                $tool.to.db_2DgelDB
-            #elif $tool.to.category_TO == "ProtocolsMaterialsDB":
-                $tool.to.ProtocolsMaterialsDB
-            #elif $tool.to.category_TO == "db_GenomeAnnotationDB":
-                $tool.to.db_GenomeAnnotationDB
-            #elif $tool.frtoom.category_TO == "db_OrganismSpecificGeneDB":
-                $tool.to.db_OrganismSpecificGeneDB
-            #elif $tool.to.category_TO == "db_phylogenomic":
-                $tool.to.db_phylogenomic
-            #elif $tool.to.category_TO == "db_EnzymePathwayDB":
-                $tool.to.db_EnzymePathwayDB
-            #elif $tool.to.category_TO == "db_GeneExpression":
-                $tool.to.db_GeneExpression
-            #elif $tool.to.category_TO == "db_other":
-                $tool.to.db_other
+            #if $tool.to.category_TO == "uniprot"
+                ${tool.to.db_uniprot_TO}
+            #elif $tool.to.category_TO == "oseqdb"
+                ${tool.to.db_oseqdb}
+            #elif $tool.to.category_TO == "3Dstrdb"
+                ${tool.to.db_3Dstrdb}
+            #elif $tool.to.category_TO == "ppidb"
+                ${tool.to.db_ppidb}
+            #elif $tool.to.category_TO == "chemistry"
+                ${tool.to.db_chemistry}
+            #elif $tool.to.category_TO == "protfgdb"
+                ${tool.to.db_protfgdb}
+            #elif $tool.to.category_TO == "polymorphismANDmutation"
+                ${tool.to.db_polymorphismANDmutation}
+            #elif $tool.to.category_TO == "2DgelDB"
+                ${tool.to.db_2DgelDB}
+            #elif $tool.to.category_TO == "ProtocolsMaterialsDB"
+                ${tool.to.db_ProtocolsMaterialsDB}
+            #elif $tool.to.category_TO == "GenomeAnnotationDB"
+                ${tool.to.db_GenomeAnnotationDB}
+            #elif $tool.to.category_TO == "OrganismSpecificGeneDB"
+                ${tool.to.db_OrganismSpecificGeneDB}
+            #elif $tool.to.category_TO == "phylogenomic"
+                ${tool.to.db_phylogenomic}
+            #elif $tool.to.category_TO == "EnzymePathwayDB"
+                ${tool.to.db_EnzymePathwayDB}
+            #elif $tool.to.category_TO == "GeneExpression"
+                ${tool.to.db_GeneExpression}
+            #elif $tool.to.category_TO == "other"
+                ${tool.to.db_other}
             #end if
 
             id_file.tabular
@@ -205,10 +205,10 @@
                 <param name="format" type="select" label="Choose format of output file" help="">
                     <option value="fasta">fasta</option>
                     <option value="gff">gff</option>
+                    <option value="txt">Text</option>
                 </param>
             </when>
         </conditional>
-
     </inputs>
     <outputs>
             <data name="outfile_retrieve_fasta" format="fasta" from_work_dir="./output"
@@ -221,6 +221,11 @@
                 <filter>tool['tool_choice'] == 'retrieve'</filter>
                 <filter>tool['format'] == 'gff'</filter>
             </data>
+            <data name="outfile_retrieve_txt" format="txt" from_work_dir="./output"
+                label="${tool.name} on ${on_string} (retrieve output)">
+                <filter>tool['tool_choice'] == 'retrieve'</filter>
+                <filter>tool['format'] == 'txt'</filter>
+            </data>
             <data name="outfile_map" format="tabular" from_work_dir="./output"
                 label="${tool.name} on ${on_string} (map output)">
                 <filter>tool['tool_choice'] == 'map'</filter>
@@ -278,15 +283,15 @@
 
 The input is a list of IDs.
 
-*example*:
+*Example*::
 
-Q0P8A9
-A0A077ZHN8
-A0A077ZFY8
-M5B8V9
-M5BAG7
-S0DS17
-....
+    Q0P8A9
+    A0A077ZHN8
+    A0A077ZFY8
+    M5B8V9
+    M5BAG7
+    S0DS17
+    ....
 
 -----