aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan DeMasi <jonathan.demasi@colorado.edu>2019-06-18 10:57:13 -0600
committerJonathan DeMasi <jonathan.demasi@colorado.edu>2019-06-18 10:57:13 -0600
commit2575a1d00baf1a5f6f27490730d3caf186418193 (patch)
tree581f458c3d876056e34370fff5a8e3aa21aab329
parent417275248b1a779e94f9362341dfbbf28cc4f86f (diff)
downloadsnippets-2575a1d00baf1a5f6f27490730d3caf186418193.tar
snippets-2575a1d00baf1a5f6f27490730d3caf186418193.tar.gz
snippets-2575a1d00baf1a5f6f27490730d3caf186418193.tar.bz2
snippets-2575a1d00baf1a5f6f27490730d3caf186418193.tar.xz
snippets-2575a1d00baf1a5f6f27490730d3caf186418193.zip
first attempt at actually grabbing abstracts
-rwxr-xr-xncbi/dbsnp/dbsnp.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/ncbi/dbsnp/dbsnp.py b/ncbi/dbsnp/dbsnp.py
index 491fce9..9878df7 100755
--- a/ncbi/dbsnp/dbsnp.py
+++ b/ncbi/dbsnp/dbsnp.py
@@ -41,7 +41,7 @@ def get_pmids(interm):
usehistory="y"))
print("Found a total of " +
search_results["Count"] + " results using search string '" + interm + "'")
- return search_results
+ return(search_results)
elif isinstance(interm, list):
searchstring = " OR ".join(interm)
@@ -77,6 +77,7 @@ def get_abstracts(results):
for abst in root.iter('Abstract'):
for sec in abst.iter('AbstractText'):
abstracts_list.append(sec.text)
+ print(abstracts_list)
return(abstracts_list)
@@ -98,10 +99,11 @@ def main():
for x in rsids:
print(x)
for x in rsids:
- get_pmids(x)
- time.sleep(0.5)
+ pmids = get_pmids(x)
+ abstracts = get_abstracts_from_list(pmids)
+ for thing in abstracts:
+ print(thing)
return()
if __name__ == '__main__':
- main()
-
+ main() \ No newline at end of file