Guide to Accessing NLM Data: Using Variables in Xtract

Slide Note
Embed
Share

Learn how to efficiently access NLM data using variables in xtract statements. This guide covers the basics of storing and retrieving information, with practical examples and tips on refining search queries.


Uploaded on Oct 01, 2024 | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. Download presentation by click this link. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

E N D

Presentation Transcript


  1. The Insiders Guide to Accessing NLM Data EDirect Office Hours April 2018: Variables in xtract Mike Davidson, MLS National Library of Medicine National Institutes of Health U.S. Department of Health and Human Services

  2. Todays Agenda Using variables in xtract What s New with EDirect? Your Questions! 2

  3. Variables: Overview A method of storing information in one part of an xtract statement and retrieving it in another part. Often used with -block and -if 3

  4. Example Goal: Analyze the different affiliations associated with an author. Tracking an author s career Useful for disambiguation 4

  5. One approach esearch db pubmed query "smith bh[Author]" \ -datetype PDAT mindate 2014 maxdate 2017 | \ efetch format xml | \ xtract pattern PubmedArticle element MedlineCitation/PMID \ block Author if LastName equals Smith \ and Initials equals BH \ element LastName Initials Affiliation But what if we only want to see rows that have affiliation data? 5

  6. Second try esearch db pubmed query "smith bh[Author]" \ -datetype PDAT mindate 2014 maxdate 2017 | \ efetch format xml | \ xtract pattern PubmedArticle element MedlineCitation/PMID \ block Author if LastName equals Smith \ and Initials equals BH -and Affiliation \ element LastName Initials Affiliation But this still gives us PMIDs with blank rows 6

  7. Third try esearch db pubmed query "smith bh[Author]" \ -datetype PDAT mindate 2014 maxdate 2017 | \ efetch format xml | \ xtract pattern PubmedArticle if Affiliation \ element MedlineCitation/PMID \ block Author if LastName equals Smith \ and Initials equals BH \ element LastName Initials Affiliation But this stillgives us PMIDs with blank rows 7

  8. This should do it! esearch db pubmed query "smith bh[Author]" \ -datetype PDAT mindate 2014 maxdate 2017 | \ efetch format xml | \ xtract pattern PubmedArticle VAR1 MedlineCitation/PMID \ block Author if LastName equals Smith \ and Initials equals BH -and Affiliation \ element "&VAR1" LastName Initials Affiliation 8

  9. Variables: Nuts and Bolts Any combination of digits and capital letters e.g. VAR1, PMID, UID, VARIABLE, BOB, etc. Declare them in place of an -element e.g. Be mindful of where you declare them! Output them in an -element with "&NAME" e.g. element "&VAR1" VAR1 MedlineCitation/PMID 9

  10. Variables: Tips and Tricks Putting a multi-value string in a single variable e.g. Output multiple variables e.g. Output a variable multiple times e.g. element "&DATE" "&PMID" "&DATE" DATE PubDate/Year,PubDate/Month element "&PMID" "&DATE" 10

  11. Whats New with EDirect? A new tool for users who require a lot of data 10,000 or more records Combines EDirect with the NLM Data Distribution program 11

  12. Create a local copy of PubMed Available in EDirect ver. 8.00 or later Requires some specialized hardware Takes some time to setup For more information: https://dataguide.nlm.nih.gov/edirect/archive.html NCBI Minute webinar, coming May 9. 12

  13. Questions? 13

  14. Affiliation Searching with Variables How can we find papers written by researchers at a specific institution? For example: Center for Translational Medicine, Thomas Jefferson University, Philadelphia, PA 14

  15. Affiliation Searching is Hard, Part 1 Center for Translational Medicine, Thomas Jefferson University Center of Translational Medicine, Thomas Jefferson University Center for Translational Medicine, Department of Medicine, Thomas Jefferson University Thomas Jefferson University, Center for Translational Medicine Center for Translational Medicine, Sidney Kimmel Medical College, Thomas Jefferson University Center for Translational Medicine, Sidney Kimmel Medical College of Thomas Jefferson University Center for Translational Medicine, Jane and Leonard Korman Lung Center, Thomas Jefferson University 15

  16. Affiliation Searching is Hard, Part 2 If you search for translational medicine[ad] AND thomas jefferson[ad] you ll also get some irrelevant records, like: PMID 29423461: Research Center for Translational Medicine, East Hospital, Tongji University School of Medicine, Shanghai, China. Department of Microbiology, Thomas Jefferson University 16

Related