# HG changeset patch
# User iuc
# Date 1467873469 14400
# Node ID e269b3b5185b368d8cc95997d940bfbe05819ccb
# Parent c26d1863f3f3a941aa634aaaee7dfbc5b36b96d0
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ncbi_entrez_eutils commit 15bcc5104c577b4b9c761f2854fc686c07ffa9db
diff -r c26d1863f3f3 -r e269b3b5185b __efetch_build_options.py
--- a/__efetch_build_options.py Fri Jun 10 15:03:49 2016 -0400
+++ b/__efetch_build_options.py Thu Jul 07 02:37:49 2016 -0400
@@ -210,7 +210,7 @@
'''
-FORMAT_OPTION_TPL = ''''''
+FORMAT_OPTION_TPL = ''''''
format_names = {}
diff -r c26d1863f3f3 -r e269b3b5185b ecitmatch.py
--- a/ecitmatch.py Fri Jun 10 15:03:49 2016 -0400
+++ b/ecitmatch.py Thu Jul 07 02:37:49 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 c26d1863f3f3 -r e269b3b5185b efetch.py
--- a/efetch.py Fri Jun 10 15:03:49 2016 -0400
+++ b/efetch.py Thu Jul 07 02:37:49 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 c26d1863f3f3 -r e269b3b5185b efetch.xml
--- a/efetch.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/efetch.xml Thu Jul 07 02:37:49 2016 -0400
@@ -19,18 +19,15 @@
--rettype $rettype
@EMAIL_ARGUMENTS@
-$whole
-> $default]]>
+]]>
-
-
-
-
-
+
+
+
@@ -38,7 +35,9 @@
-
diff -r c26d1863f3f3 -r e269b3b5185b eutils.py
--- a/eutils.py Fri Jun 10 15:03:49 2016 -0400
+++ b/eutils.py Thu Jul 07 02:37:49 2016 -0400
@@ -43,27 +43,23 @@
def post(self, database, **payload):
return json.dumps(Entrez.read(Entrez.epost(database, **payload)), indent=4)
- def fetch(self, db, whole=False, **payload):
- if whole:
- if 'id' in payload:
- summary = self.id_summary(db, payload['id'])
- else:
- summary = self.history_summary(db)
+ def fetch(self, db, ftype=None, **payload):
+ os.makedirs("downloads")
- count = len(summary)
-
- payload['retmax'] = BATCH_SIZE
+ if 'id' in payload:
+ summary = self.id_summary(db, payload['id'])
+ else:
+ summary = self.history_summary(db)
- # Print the first one
- print Entrez.efetch(db, **payload).read()
- # Then write subsequent to files for
- 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 c26d1863f3f3 -r e269b3b5185b eutils.pyc
Binary file eutils.pyc has changed
diff -r c26d1863f3f3 -r e269b3b5185b macros.xml
--- a/macros.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/macros.xml Thu Jul 07 02:37:49 2016 -0400
@@ -835,6 +835,7 @@
+ python
biopython
diff -r c26d1863f3f3 -r e269b3b5185b test
--- a/test Fri Jun 10 15:03:49 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 c26d1863f3f3 -r e269b3b5185b test-data/ecitmatch.results.tsv
--- a/test-data/ecitmatch.results.tsv Fri Jun 10 15:03:49 2016 -0400
+++ b/test-data/ecitmatch.results.tsv Thu Jul 07 02:37:49 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 c26d1863f3f3 -r e269b3b5185b test-data/esearch.pubmed.2014-01-pnas.xml
--- a/test-data/esearch.pubmed.2014-01-pnas.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/test-data/esearch.pubmed.2014-01-pnas.xml Thu Jul 07 02:37:49 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 c26d1863f3f3 -r e269b3b5185b test-data/esearch.pubmed.xml
--- a/test-data/esearch.pubmed.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/test-data/esearch.pubmed.xml Thu Jul 07 02:37:49 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 c26d1863f3f3 -r e269b3b5185b test-data/esummary.tax.xml
--- a/test-data/esummary.tax.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/test-data/esummary.tax.xml Thu Jul 07 02:37:49 2016 -0400
@@ -1,5 +1,5 @@
-
+
10239
diff -r c26d1863f3f3 -r e269b3b5185b test-data/pm-tax-neighbor.xml
--- a/test-data/pm-tax-neighbor.xml Fri Jun 10 15:03:49 2016 -0400
+++ b/test-data/pm-tax-neighbor.xml Thu Jul 07 02:37:49 2016 -0400
@@ -1,24 +1,24 @@
-
-
+
+
-
- taxonomy
-
- 510899
-
-
-
- pubmed
- taxonomy_pubmed_entrez
-
-
+
+ taxonomy
+
+ 510899
+
+
+
+ pubmed
+ taxonomy_pubmed_entrez
+
+
22241621
-
-
-
-
-
+
+
+
+
+
diff -r c26d1863f3f3 -r e269b3b5185b tmp
--- a/tmp Fri Jun 10 15:03:49 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
-
-
-
-