예제 #1
0
def test_get_pubmed_item():
    # this one exists
    qid, _, _ = PublicationHelper("27528457", id_type="pmid", source="europepmc").get_or_create(None)
    assert qid == "Q27098545", qid
    qid, _, _ = PublicationHelper("4986259", id_type="pmcid", source="europepmc").get_or_create(None)
    assert qid == "Q27098545", qid
    qid, _, _ = PublicationHelper("10.1186/S12864-016-2855-3", id_type="doi", source="crossref").get_or_create(None)
    assert qid == "Q27098545", qid
예제 #2
0
 def create_reference(omim, pmid, login=None):
     """
     Reference is:
     retrieved: date
     stated in: links to pmid items
     optional reference URL
     """
     #
     ref = [
         wdi_core.WDItemID(ITEMS['MitoDB'],
                           PROPS['curator'],
                           is_reference=True)
     ]
     t = strftime("+%Y-%m-%dT00:00:00Z", gmtime())
     ref.append(
         wdi_core.WDTime(t, prop_nr=PROPS['retrieved'], is_reference=True))
     pmid_qid, _, success = PublicationHelper(
         ext_id=pmid, id_type='pmid',
         source="europepmc").get_or_create(login)
     if success is True:
         ref.append(
             wdi_core.WDItemID(pmid_qid,
                               PROPS['stated in'],
                               is_reference=True))
     ref_url = "http://mitodb.com/symptoms.php?oid={}&symptoms=Show"
     ref.append(
         wdi_core.WDUrl(ref_url.format(omim),
                        PROPS['reference URL'],
                        is_reference=True))
     return ref
예제 #3
0
def test_pubmedstub_bad_pmid():
    # invalid pubmed id
    qid, _, _ = PublicationHelper("999999999", id_type='pmid', source='europepmc').get_or_create(login='******')
    assert qid is None
예제 #4
0
def test_get_pmc_item():
    # only has a pmc id
    qid, _, _ = PublicationHelper("3425984", id_type='pmcid', source="europepmc").get_or_create(None)
    assert qid == "Q42758027"