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
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
def test_pubmedstub_bad_pmid(): # invalid pubmed id qid, _, _ = PublicationHelper("999999999", id_type='pmid', source='europepmc').get_or_create(login='******') assert qid is None
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"