Class PubMedSearch
- java.lang.Object
-
- ubic.gemma.core.loader.entrez.pubmed.PubMedSearch
-
public class PubMedSearch extends Object
Search PubMed for terms, retrieve document records.- Author:
- pavlidis
-
-
Constructor Summary
Constructors Constructor Description PubMedSearch(String apiKey)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BibliographicReference
retrieve(String pubMedId)
Retrieve a single PubMed record by ID.Collection<BibliographicReference>
retrieve(Collection<String> pubmedIds)
Retrieve multiple PubMed records by ID.Collection<String>
search(String searchQuery, int maxResults)
Gets all the pubmed ID's that would be returned from a pubmed search string, using two eUtil calls.Collection<String>
search(Collection<String> searchTerms, int maxResults)
Gets all the pubmed ID's that would be returned given a list of input terms, using two eUtil calls.Collection<BibliographicReference>
searchAndRetrieve(String searchQuery, int maxResults)
Search based on terms and retrieve the PubMed records.
-
-
-
Constructor Detail
-
PubMedSearch
public PubMedSearch(String apiKey)
-
-
Method Detail
-
search
public Collection<String> search(Collection<String> searchTerms, int maxResults) throws IOException
Gets all the pubmed ID's that would be returned given a list of input terms, using two eUtil calls.- Parameters:
searchTerms
- search terms- Returns:
- The PubMed ids (as strings) for the search results.
- Throws:
IOException
- IO problems
-
search
public Collection<String> search(String searchQuery, int maxResults) throws IOException
Gets all the pubmed ID's that would be returned from a pubmed search string, using two eUtil calls.- Parameters:
searchQuery
- - what would normally be typed into pubmed search box for example "Neural Pathways"[MeSH]- Returns:
- The PubMed ids (as strings) for the search results.
- Throws:
IOException
-
searchAndRetrieve
public Collection<BibliographicReference> searchAndRetrieve(String searchQuery, int maxResults) throws IOException
Search based on terms and retrieve the PubMed records.This is more efficient than calling
search(String, int)
and thenretrieve(Collection)
as it bypasses the intermediary query to get PubMed IDs.- Parameters:
searchQuery
- search terms- Returns:
- BibliographicReference representing the publication
- Throws:
IOException
-
retrieve
@Nullable public BibliographicReference retrieve(String pubMedId) throws IOException
Retrieve a single PubMed record by ID.
-
retrieve
public Collection<BibliographicReference> retrieve(Collection<String> pubmedIds) throws IOException
Retrieve multiple PubMed records by ID.
-
-