Content deleted Content added
Julialturner (talk | contribs) Undid revision 726603242 by Julialturner (talk) |
Julialturner (talk | contribs) added checks for values to catch lua error messages |
||
Line 5:
local infoboxImage = require('Module:InfoboxImage').InfoboxImage
local function check_values(f,args)
--local u= table.upack(args)
local exist, val = pcall(f, unpack(args))
if exist and val ~= nil then
return(val)
else
return("'''VALUE_ERROR'''")
end
end
--on a page {{#invoke:Sandbox/genewiki/alllua|getTemplateData|QID=Q14865053}}
Line 112 ⟶ 121:
if entity then --only require the main gene entity
--a list variables of all the data in the info box
local name = check_values(p.getLabel
local entrez_gene = check_values(p.getValue
local entrez_gene_mm = check_values(p.getValue
local image = check_values( p.getImage
local uniprotID_hs = check_values(p.getValueProtein
local uniprotID_mm = check_values(p.getValueProtein
local pdbIDs = check_values(p.getPDB
local aliases = check_values(p.getAliases
local gene_symbol = check_values(p.getValue
local hgnc_id = check_values(p.getValue
local homologene_id = check_values(p.getValue
local omim_id = check_values(p.getValue
local mgi_id = check_values(p.getValue
local ChEMBL_id = check_values(p.getValue
local IUPHAR_id = check_values(p.getValue
local ec_no = check_values(p.getValueProtein
local mol_funct = check_values(p.getGO
local cell_comp = check_values(p.getGO
local bio_process = check_values(p.getGO
local expression_images = check_values(p.getImage
local ensembl = check_values(p.getValue
local ensembl_mm = check_values(p.getValue
local refseq_mRNA = check_values(p.getRefseq_mRNA
local refseq_mRNA_mm = check_values(p.getRefseq_mRNA
local refseq_prot = check_values(p.getRefseq_protein
local refseq_prot_mm = check_values(p.getRefseq_protein
local gstart = check_values(p.getChromosomeLoc
local gend = check_values(p.getChromosomeLoc
local chr = check_values(p.trimChromosome
local db = check_values(p.getAliasFromGenomeAssembly
local gstart_mm = check_values(p.getChromosomeLoc
local gend_mm = check_values(p.getChromosomeLoc
local db_mm = check_values(p.getAliasFromGenomeAssembly
local chr_mm = check_values( p.trimChromosome
local disease, dis_ref =
if p.getDisease(entity, "P2293") then disease, dis_ref = p.getDisease(entity, "P2293") else disease, dis_ref = {"'''VALUE_ERROR'''","'''VALUE_ERROR'''" } end
local drug = check_values(p.getDrug
--define Global Color Scheme
|