Module:Infobox gene: Difference between revisions

Content deleted Content added
// Edit via Wikiplus
added checks for additional orthologs doesn't assume mouse
Line 35:
local checkOrtholog = "" --flag used to see if mouse data avaliable
local mouse_propertyID = "P684" --actually ortholog property additional orthologs can exist
local protein_propertyID = "P688"
 
Line 92:
claims = entity.claims[mouse_propertyID]
end
local qualifierID = "P703" --found in taxon
if claims then
local mouse_tax = "Mus musculus"
if claims then
if (claims[1] and claims[1].mainsnak.snaktype == "value" and claims[1].mainsnak.datavalue.type == "wikibase-entityid") then
for k, v in pairs(claims) do
local mouse_itemID = "Q" .. claims[1]v.mainsnak.datavalue.value["numeric-id"]
mm_qid local = mouse_itemIDquals
if v.qualifiers then
entity_mouse = mw.wikibase.getEntity(mouse_itemID)
quals = v.qualifiers.P703
checkOrtholog = 1
end
if quals then
for qk, qv in pairs(quals) do
--get the taxon name in qualifier
local qual_obj_id = "Q"..qv.datavalue.value["numeric-id"]
mw.wikibase.label(qual_obj_id)
local qual_obj = mw.wikibase.label(qual_obj_id)
if string.match(qual_obj, mouse_tax) then --check if this is mouse or other
mm_qid = mouse_itemID
entity_mouse = mw.wikibase.getEntity(mouse_itemID)
checkOrtholog = 1
end
end
end
end
end --will return nothing if no claims are found
else