# HG changeset patch # User iuc # Date 1467873525 14400 # Node ID 02c7d63c7240d69d8b45a17b55fed8971edfc483 # Parent 258f8ed9a08bd3e8310bcf5337df13c23162e552 planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 15bcc5104c577b4b9c761f2854fc686c07ffa9db diff -r 258f8ed9a08b -r 02c7d63c7240 __efetch_build_options.py --- a/__efetch_build_options.py Fri Jun 10 15:04:04 2016 -0400 +++ b/__efetch_build_options.py Thu Jul 07 02:38:45 2016 -0400 @@ -210,7 +210,7 @@ ''' -FORMAT_OPTION_TPL = '''''' +FORMAT_OPTION_TPL = '''''' format_names = {} diff -r 258f8ed9a08b -r 02c7d63c7240 ecitmatch.py --- a/ecitmatch.py Fri Jun 10 15:04:04 2016 -0400 +++ b/ecitmatch.py Thu Jul 07 02:38:45 2016 -0400 @@ -5,7 +5,7 @@ if __name__ == '__main__': parser = argparse.ArgumentParser(description='ECitMatch', epilog='') - parser.add_argument('--file', help='Tabular file containing citations to search') + parser.add_argument('--file', type=argparse.FileType('r'), help='Tabular file containing citations to search') parser.add_argument('--key', nargs='*', help='Citation Key') parser.add_argument('--journal_title', nargs='*', help='Journal Title') @@ -35,6 +35,7 @@ }) else: for line in args.file: + line = line.strip() if not line.startswith('#'): tmp = line.split('\t') try: diff -r 258f8ed9a08b -r 02c7d63c7240 efetch.py --- a/efetch.py Fri Jun 10 15:04:04 2016 -0400 +++ b/efetch.py Thu Jul 07 02:38:45 2016 -0400 @@ -17,8 +17,6 @@ # Output parser.add_argument('--retmode', help='Retmode') parser.add_argument('--rettype', help='Rettype') - parser.add_argument('--whole', action='store_true', - help='Download all records associated with query') args = parser.parse_args() c = eutils.Client(history_file=args.history_file, user_email=args.user_email, admin_email=args.admin_email) @@ -34,4 +32,4 @@ if getattr(args, attr, None) is not None: payload[attr] = getattr(args, attr) - c.fetch(args.db, whole=args.whole, **payload) + c.fetch(args.db, ftype=args.retmode, **payload) diff -r 258f8ed9a08b -r 02c7d63c7240 esearch.xml --- a/esearch.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/esearch.xml Thu Jul 07 02:38:45 2016 -0400 @@ -78,7 +78,7 @@ - + @@ -87,7 +87,7 @@ - + - for i in range(BATCH_SIZE, count, BATCH_SIZE): - payload['retstart'] = i - # TODO: output multiple files??? Collection? - with open('%s.out' % i, 'w') as handle: - handle.write(Entrez.efetch(db, **payload).read()) - else: - print Entrez.efetch(db, **payload).read() + count = len(summary) + payload['retmax'] = BATCH_SIZE + + # This may be bad. I'm not sure yet. I think it will be ... but UGH. + for i in range(0, count, BATCH_SIZE): + payload['retstart'] = i + file_path = os.path.join('downloads', 'EFetch Results Chunk %s.%s' % (i, ftype)) + with open(file_path, 'w') as handle: + handle.write(Entrez.efetch(db, **payload).read()) def id_summary(self, db, id_list): payload = { @@ -108,7 +104,7 @@ return Entrez.egquery(**kwargs).read() def citmatch(self, **kwargs): - return Entrez.ECitMatch(**kwargs).read() + return Entrez.ecitmatch(**kwargs).read() @classmethod def parse_ids(cls, id_list, id, history_file): diff -r 258f8ed9a08b -r 02c7d63c7240 eutils.pyc Binary file eutils.pyc has changed diff -r 258f8ed9a08b -r 02c7d63c7240 macros.xml --- a/macros.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/macros.xml Thu Jul 07 02:38:45 2016 -0400 @@ -835,6 +835,7 @@ + python biopython diff -r 258f8ed9a08b -r 02c7d63c7240 test --- a/test Fri Jun 10 15:04:04 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,4 +0,0 @@ -{ - "QueryKey": "1", - "WebEnv": "NCID_1_29968407_130.14.22.215_9001_1465585167_557791559_0MetA0_S_MegaStore_F_1" -} \ No newline at end of file diff -r 258f8ed9a08b -r 02c7d63c7240 test-data/ecitmatch.results.tsv --- a/test-data/ecitmatch.results.tsv Fri Jun 10 15:04:04 2016 -0400 +++ b/test-data/ecitmatch.results.tsv Thu Jul 07 02:38:45 2016 -0400 @@ -1,1 +1,2 @@ -proc natl acad sci u s a 1991 88 3248 mann bj citation_1 2014248 + 1991 88 3248 mann bj citation_1 2014248 + diff -r 258f8ed9a08b -r 02c7d63c7240 test-data/esearch.pubmed.2014-01-pnas.xml --- a/test-data/esearch.pubmed.2014-01-pnas.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/test-data/esearch.pubmed.2014-01-pnas.xml Thu Jul 07 02:38:45 2016 -0400 @@ -21,5 +21,5 @@ 24481252 24477693 24477692 - PNAS[ta] "Proc Natl Acad Sci U S A"[Journal] "Proc Natl Acad Sci U S A"[Journal] Journal 120385 N 2014/01/01[PDAT] PDAT 0 N 2014/02/01[PDAT] PDAT 0 N RANGE AND "Proc Natl Acad Sci U S A"[Journal] AND 2014/01/01[PDAT] : 2014/02/01[PDAT] + PNAS[ta] "Proc Natl Acad Sci U S A"[Journal] "Proc Natl Acad Sci U S A"[Journal] Journal 124812 N 2014/01/01[PDAT] PDAT 0 N 2014/02/01[PDAT] PDAT 0 N RANGE AND "Proc Natl Acad Sci U S A"[Journal] AND 2014/01/01[PDAT] : 2014/02/01[PDAT] diff -r 258f8ed9a08b -r 02c7d63c7240 test-data/esearch.pubmed.xml --- a/test-data/esearch.pubmed.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/test-data/esearch.pubmed.xml Thu Jul 07 02:38:45 2016 -0400 @@ -21,5 +21,5 @@ 11121066 11121065 11121064 - PNAS[ta] "Proc Natl Acad Sci U S A"[Journal] "Proc Natl Acad Sci U S A"[Journal] Journal 120385 N 97[vi] vi 74742 N AND GROUP "Proc Natl Acad Sci U S A"[Journal] AND 97[vi] + PNAS[ta] "Proc Natl Acad Sci U S A"[Journal] "Proc Natl Acad Sci U S A"[Journal] Journal 124812 N 97[vi] vi 77218 N AND GROUP "Proc Natl Acad Sci U S A"[Journal] AND 97[vi] diff -r 258f8ed9a08b -r 02c7d63c7240 test-data/esummary.tax.xml --- a/test-data/esummary.tax.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/test-data/esummary.tax.xml Thu Jul 07 02:38:45 2016 -0400 @@ -1,5 +1,5 @@ - + 10239 diff -r 258f8ed9a08b -r 02c7d63c7240 test-data/pm-tax-neighbor.xml --- a/test-data/pm-tax-neighbor.xml Fri Jun 10 15:04:04 2016 -0400 +++ b/test-data/pm-tax-neighbor.xml Thu Jul 07 02:38:45 2016 -0400 @@ -1,24 +1,24 @@ - - + + - - taxonomy - - 510899 - - - - pubmed - taxonomy_pubmed_entrez - - + + taxonomy + + 510899 + + + + pubmed + taxonomy_pubmed_entrez + + 22241621 - - - - - + + + + + diff -r 258f8ed9a08b -r 02c7d63c7240 tmp --- a/tmp Fri Jun 10 15:04:04 2016 -0400 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +0,0 @@ - - - - 10239 - Viruses - - viruses - Vira - Viridae - - 1 - superkingdom - Viruses - - 1 - Standard - - - 0 - Unspecified - - - 1995/02/27 09:24:00 - 2010/11/23 11:40:11 - 1993/04/20 01:00:00 - - - -