Mercurial > repos > iuc > ncbi_eutils_efetch
changeset 1:0fc65a60436f draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit a4b0969b33a68a0ea9ba12291f6694aec24f13ed
author | iuc |
---|---|
date | Tue, 30 Oct 2018 19:08:30 -0400 |
parents | 71bcf87a7031 |
children | 0977ec0f3ba8 |
files | __efetch_build_options.py __pycache__/eutils.cpython-35.pyc ecitmatch.py efetch.py efetch.xml egquery.py einfo.py elink.py epost.py esearch.py esummary.py eutils.py eutils.pyc macros.xml test-data/egquery.1.xml test-data/esearch.pubmed.2014-01-pnas.xml test-data/esearch.pubmed.xml test-data/esummary.tax.xml test-data/pm-tax-neighbor.xml test-data/pubmed.metadata.xml test-data/viruses.tax.xml tool_dependencies.xml |
diffstat | 22 files changed, 73 insertions(+), 59 deletions(-) [+] |
line wrap: on
line diff
--- a/__efetch_build_options.py Thu Jul 07 02:39:36 2016 -0400 +++ b/__efetch_build_options.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,6 +1,8 @@ #!/usr/bin/env python # Daniel Blankenberg # Creates the options for tool interface +from __future__ import print_function + import re # http://eutils.ncbi.nlm.nih.gov/entrez/eutils/einfo.fcgi @@ -164,7 +166,7 @@ section = None for line in help: - line = re.split('\s{2,}', line.strip()) + line = re.split(r'\s{2,}', line.strip()) # Ignore empties if len(line) == 0: continue @@ -214,9 +216,9 @@ format_names = {} -print ''' <xml name="db"> +print(''' <xml name="db"> <conditional name="db"> - <expand macro="dbselect" />''' + <expand macro="dbselect" />''') for key in sorted(db): format_options = [] @@ -233,13 +235,13 @@ format_names[format_string] = format_modifier - print WHEN_TPL.format( + print(WHEN_TPL.format( format=key, format_options='\n '.join(format_options) - ) + )) -print ''' </conditional> - </xml>''' +print(''' </conditional> + </xml>''') CHANGE_FORMAT_TPL = ''' <xml name="efetch_formats"> @@ -264,4 +266,4 @@ key=k, value=v )) -print CHANGE_FORMAT_TPL.format(formats='\n '.join(whens)) +print(CHANGE_FORMAT_TPL.format(formats='\n '.join(whens)))
--- a/ecitmatch.py Thu Jul 07 02:39:36 2016 -0400 +++ b/ecitmatch.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse + import eutils @@ -48,7 +51,7 @@ 'key': tmp[5], }) except KeyError: - print "Could not parse line: %s" % line + print("Could not parse line: %s" % line) payload = { 'db': 'pubmed', @@ -57,4 +60,4 @@ results = c.citmatch(**payload) # We get data back as pipe separated, so just replace those with tabs - print results.replace('|', '\t') + print(results.replace('|', '\t'))
--- a/efetch.py Thu Jul 07 02:39:36 2016 -0400 +++ b/efetch.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,6 @@ #!/usr/bin/env python import argparse + import eutils
--- a/efetch.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/efetch.xml Tue Oct 30 19:08:30 2018 -0400 @@ -25,7 +25,7 @@ <expand macro="list_or_hist"/> </inputs> <outputs> - <collection type="list" label="NCBI EFetch Results" name="output1"> + <collection name="output1" type="list" label="NCBI EFetch results"> <discover_datasets pattern="__designation_and_ext__" directory="downloads"/> </collection> </outputs> @@ -35,10 +35,9 @@ <param name="output_format" value="full-xml"/> <param name="qss" value="id_list"/> <param name="id_list" value="10239"/> - <output name="default"> - <discovered_dataset designation="EFetch Results Chunk 0" ftype="xml" file="viruses.tax.xml" lines_diff="2"> - </discovered_dataset> - </output> + <output_collection name="output1" type="list" count="1"> + <element name="EFetch Results Chunk 0" ftype="xml" file="viruses.tax.xml" lines_diff="2" /> + </output_collection> </test> </tests> <help><![CDATA[
--- a/egquery.py Thu Jul 07 02:39:36 2016 -0400 +++ b/egquery.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse + import eutils @@ -17,4 +20,4 @@ 'term': args.term, } results = c.gquery(**payload) - print results + print(results)
--- a/einfo.py Thu Jul 07 02:39:36 2016 -0400 +++ b/einfo.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse + import eutils @@ -15,4 +18,4 @@ if args.db is not None: payload['db'] = args.db payload['version'] = '2.0' - print c.info(**payload) + print(c.info(**payload))
--- a/elink.py Thu Jul 07 02:39:36 2016 -0400 +++ b/elink.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,4 +1,6 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse import json @@ -56,4 +58,4 @@ history = c.extract_history(results) args.history_out.write(json.dumps(history, indent=4)) - print results + print(results)
--- a/epost.py Thu Jul 07 02:39:36 2016 -0400 +++ b/epost.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse + import eutils @@ -24,4 +27,4 @@ payload['id'] = ','.join(merged_ids) payload['WebEnv'] = '' - print c.post(args.db, **payload) + print(c.post(args.db, **payload))
--- a/esearch.py Thu Jul 07 02:39:36 2016 -0400 +++ b/esearch.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,6 +1,9 @@ #!/usr/bin/env python +from __future__ import print_function + +import argparse import json -import argparse + import eutils @@ -44,4 +47,4 @@ history = c.extract_history(results) args.history_out.write(json.dumps(history, indent=4)) - print results + print(results)
--- a/esummary.py Thu Jul 07 02:39:36 2016 -0400 +++ b/esummary.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,8 @@ #!/usr/bin/env python +from __future__ import print_function + import argparse + import eutils @@ -26,4 +29,4 @@ else: payload['id'] = ','.join(merged_ids) - print c.summary(**payload) + print(c.summary(**payload))
--- a/eutils.py Thu Jul 07 02:39:36 2016 -0400 +++ b/eutils.py Tue Oct 30 19:08:30 2018 -0400 @@ -1,7 +1,9 @@ +import json import os -import json -import StringIO + from Bio import Entrez +from six import StringIO + Entrez.tool = "GalaxyEutils_1_0" BATCH_SIZE = 200
--- a/macros.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/macros.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,6 +1,6 @@ <?xml version="1.0"?> <macros> - <token name="@WRAPPER_VERSION@">1.1</token> + <token name="@WRAPPER_VERSION@">1.2</token> <token name="@EMAIL_ARGUMENTS@"> --user_email "$__user_email__" #set admin_emails = ';'.join(str($__admin_users__).split(',')) @@ -50,9 +50,9 @@ materials. Please consult your legal counsel. If you wish to do a large data mining project on PubMed data, you can enter into a licensing agreement and lease the data for free from NLM. For more information on -this please see `http://www.nlm.nih.gov/databases/leased.html <http://www.nlm.nih.gov/databases/leased.html>`__ +this please see `https://www.nlm.nih.gov/databases/download/data_distrib_main.html <https://www.nlm.nih.gov/databases/download/data_distrib_main.html>`__ -The `full disclaimer <http://www.ncbi.nlm.nih.gov/About/disclaimer.html>`__ is available on +The `full disclaimer <https://www.ncbi.nlm.nih.gov/home/about/policies/>`__ is available on their website Liability @@ -829,19 +829,19 @@ title = {Entrez Programming Utilities Help}, year = {2010}, publisher = {National Center for Biotechnology Information, Bethesda, Maryland}, - note = {http://ww.ncbi.nlm.nih.gov/books/NBK25500/} + note = {https://www.ncbi.nlm.nih.gov/books/NBK25500/} }</citation> </citations> </xml> <xml name="requirements"> <requirements> - <requirement type="package" version="2.7">python</requirement> - <requirement type="package" version="1.66">biopython</requirement> + <requirement type="package" version="1.68">biopython</requirement> + <requirement type="package" version="1.10">six</requirement> </requirements> </xml> <xml name="linkname"> <param name="linkname" type="select" label="To NCBI Database"> - <!-- TODO: http://eutils.ncbi.nlm.nih.gov/entrez/query/static/entrezlinks.html --> + <!-- TODO: https://eutils.ncbi.nlm.nih.gov/entrez/query/static/entrezlinks.html --> </param> </xml> </macros>
--- a/test-data/egquery.1.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/egquery.1.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE Result PUBLIC "-//NLM//DTD eSearchResult, January 2004//EN" "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/egquery.dtd"> +<!DOCTYPE Result PUBLIC "-//NLM//DTD eSearchResult, January 2004//EN" "https://www.ncbi.nlm.nih.gov/entrez/query/DTD/egquery.dtd"> <Result> <Term>bacteriophage</Term>
--- a/test-data/esearch.pubmed.2014-01-pnas.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/esearch.pubmed.2014-01-pnas.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE eSearchResult PUBLIC "-//NLM//DTD esearch 20060628//EN" "http://eutils.ncbi.nlm.nih.gov/eutils/dtd/20060628/esearch.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE eSearchResult PUBLIC "-//NLM//DTD esearch 20060628//EN" "https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20060628/esearch.dtd"> <eSearchResult><Count>524</Count><RetMax>20</RetMax><RetStart>0</RetStart><IdList> <Id>24620368</Id> <Id>24613929</Id> @@ -21,5 +21,5 @@ <Id>24481252</Id> <Id>24477693</Id> <Id>24477692</Id> -</IdList><TranslationSet><Translation> <From>PNAS[ta]</From> <To>"Proc Natl Acad Sci U S A"[Journal]</To> </Translation></TranslationSet><TranslationStack> <TermSet> <Term>"Proc Natl Acad Sci U S A"[Journal]</Term> <Field>Journal</Field> <Count>124812</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>2014/01/01[PDAT]</Term> <Field>PDAT</Field> <Count>0</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>2014/02/01[PDAT]</Term> <Field>PDAT</Field> <Count>0</Count> <Explode>N</Explode> </TermSet> <OP>RANGE</OP> <OP>AND</OP> </TranslationStack><QueryTranslation>"Proc Natl Acad Sci U S A"[Journal] AND 2014/01/01[PDAT] : 2014/02/01[PDAT]</QueryTranslation></eSearchResult> +</IdList><TranslationSet><Translation> <From>PNAS[ta]</From> <To>"Proc Natl Acad Sci U S A"[Journal]</To> </Translation></TranslationSet><TranslationStack> <TermSet> <Term>"Proc Natl Acad Sci U S A"[Journal]</Term> <Field>Journal</Field> <Count>127235</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>2014/01/01[PDAT]</Term> <Field>PDAT</Field> <Count>0</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>2014/02/01[PDAT]</Term> <Field>PDAT</Field> <Count>0</Count> <Explode>N</Explode> </TermSet> <OP>RANGE</OP> <OP>AND</OP> </TranslationStack><QueryTranslation>"Proc Natl Acad Sci U S A"[Journal] AND 2014/01/01[PDAT] : 2014/02/01[PDAT]</QueryTranslation></eSearchResult>
--- a/test-data/esearch.pubmed.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/esearch.pubmed.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE eSearchResult PUBLIC "-//NLM//DTD esearch 20060628//EN" "http://eutils.ncbi.nlm.nih.gov/eutils/dtd/20060628/esearch.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE eSearchResult PUBLIC "-//NLM//DTD esearch 20060628//EN" "https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20060628/esearch.dtd"> <eSearchResult><Count>2651</Count><RetMax>20</RetMax><RetStart>0</RetStart><IdList> <Id>16578858</Id> <Id>11186225</Id> @@ -21,5 +21,5 @@ <Id>11121066</Id> <Id>11121065</Id> <Id>11121064</Id> -</IdList><TranslationSet><Translation> <From>PNAS[ta]</From> <To>"Proc Natl Acad Sci U S A"[Journal]</To> </Translation></TranslationSet><TranslationStack> <TermSet> <Term>"Proc Natl Acad Sci U S A"[Journal]</Term> <Field>Journal</Field> <Count>124812</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>97[vi]</Term> <Field>vi</Field> <Count>77218</Count> <Explode>N</Explode> </TermSet> <OP>AND</OP> <OP>GROUP</OP> </TranslationStack><QueryTranslation>"Proc Natl Acad Sci U S A"[Journal] AND 97[vi]</QueryTranslation></eSearchResult> +</IdList><TranslationSet><Translation> <From>PNAS[ta]</From> <To>"Proc Natl Acad Sci U S A"[Journal]</To> </Translation></TranslationSet><TranslationStack> <TermSet> <Term>"Proc Natl Acad Sci U S A"[Journal]</Term> <Field>Journal</Field> <Count>127235</Count> <Explode>N</Explode> </TermSet> <TermSet> <Term>97[vi]</Term> <Field>vi</Field> <Count>78776</Count> <Explode>N</Explode> </TermSet> <OP>AND</OP> <OP>GROUP</OP> </TranslationStack><QueryTranslation>"Proc Natl Acad Sci U S A"[Journal] AND 97[vi]</QueryTranslation></eSearchResult>
--- a/test-data/esummary.tax.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/esummary.tax.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE eSummaryResult PUBLIC "-//NLM//DTD esummary v1 20041029//EN" "http://eutils.ncbi.nlm.nih.gov/eutils/dtd/20041029/esummary-v1.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE eSummaryResult PUBLIC "-//NLM//DTD esummary v1 20041029//EN" "https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20041029/esummary-v1.dtd"> <eSummaryResult> <DocSum> <Id>10239</Id> @@ -13,7 +13,7 @@ <Item Name="Genus" Type="String"></Item> <Item Name="Species" Type="String"></Item> <Item Name="Subsp" Type="String"></Item> - <Item Name="ModificationDate" Type="Date">2010/11/23 00:00</Item> + <Item Name="ModificationDate" Type="Date">2017/06/14 00:00</Item> </DocSum> </eSummaryResult>
--- a/test-data/pm-tax-neighbor.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/pm-tax-neighbor.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE eLinkResult PUBLIC "-//NLM//DTD elink 20101123//EN" "http://eutils.ncbi.nlm.nih.gov/eutils/dtd/20101123/elink.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE eLinkResult PUBLIC "-//NLM//DTD elink 20101123//EN" "https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20101123/elink.dtd"> <eLinkResult> <LinkSet>
--- a/test-data/pubmed.metadata.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/pubmed.metadata.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE eInfoResult PUBLIC "-//NLM//DTD einfo 20130322//EN" "http://eutils.ncbi.nlm.nih.gov/eutils/dtd/20130322/einfo.dtd"> +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE eInfoResult PUBLIC "-//NLM//DTD einfo 20130322//EN" "https://eutils.ncbi.nlm.nih.gov/eutils/dtd/20130322/einfo.dtd"> <eInfoResult> <DbInfo> <DbName>pubmed</DbName>
--- a/test-data/viruses.tax.xml Thu Jul 07 02:39:36 2016 -0400 +++ b/test-data/viruses.tax.xml Tue Oct 30 19:08:30 2018 -0400 @@ -1,5 +1,5 @@ -<?xml version="1.0"?> -<!DOCTYPE TaxaSet PUBLIC "-//NLM//DTD Taxon, 14th January 2002//EN" "http://www.ncbi.nlm.nih.gov/entrez/query/DTD/taxon.dtd"> +<?xml version="1.0" ?> +<!DOCTYPE TaxaSet PUBLIC "-//NLM//DTD Taxon, 14th January 2002//EN" "https://www.ncbi.nlm.nih.gov/entrez/query/DTD/taxon.dtd"> <TaxaSet><Taxon> <TaxId>10239</TaxId> <ScientificName>Viruses</ScientificName> @@ -21,9 +21,8 @@ </MitoGeneticCode> <Lineage/> <CreateDate>1995/02/27 09:24:00</CreateDate> - <UpdateDate>2010/11/23 11:40:11</UpdateDate> + <UpdateDate>2017/06/14 10:56:24</UpdateDate> <PubDate>1993/04/20 01:00:00</PubDate> </Taxon> -</TaxaSet> - +</TaxaSet> \ No newline at end of file
--- a/tool_dependencies.xml Thu Jul 07 02:39:36 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,9 +0,0 @@ -<?xml version="1.0"?> -<tool_dependency> - <set_environment version="1.0"> - <environment_variable action="set_to" name="NCBI_EUTILS_CONTACT">/please set the administrator's contact email in the corresponding env.sh file/</environment_variable> - </set_environment> - <package name="biopython" version="1.66"> - <repository changeset_revision="8433ee4531ff" name="package_biopython_1_66" owner="biopython" toolshed="https://toolshed.g2.bx.psu.edu" /> - </package> -</tool_dependency>