Content deleted Content added
Julialturner (talk | contribs) Fixed suppression of Drug section title when not present |
Julialturner (talk | contribs) Changed disease section and drug to link references to the reference section on the wikipedia page |
||
Line 171:
p.renderIdentifiers(aliases, hgnc_id, gene_symbol, homologene_id, omim_id, mgi_id, ChEMBL_id, IUPHAR_id, ec_no, entrez_gene)
if (disease ~= "" and dis_ref ~= "") then --removes section from those items without disease info
p.renderDiseases(frame, disease, dis_ref)
end
if (drug ~= "" ) then --removes section from those items without drug info
p.renderDrug(frame,drug)
end
Line 184:
p.renderRNAexpression(expression_images, entrez_gene)
end
p.renderOrthologs(frame, entrez_gene, entrez_gene_mm, ensembl, ensembl_mm, uniprotID_hs, uniprotID_mm, refseq_mRNA, refseq_mRNA_mm, refseq_prot, refseq_prot_mm, db, chr, gstart, gend, db_mm, chr_mm, gstart_mm, gend_mm)
p.renderFooter(root_qid, mm_qid)
return tostring(root)
Line 532:
end
p.renderDiseases = function(frame, disease, dis_ref)
local title = "Genetically Related Diseases"
local disease_title = "Disease Name"
Line 581:
for index,value in ipairs(disease) do
local i = 0
--local ref_collapse = ""
local ref_default = ""
local ref_link = ""
Line 589:
ref_link_list = mw.text.split(dis_ref[index], ",")
end
abbr_url = string.gsub(ref_url, "http://", '')
else ▼
if i > 1 then --not sure why indexing off, but renders empty value if don't do this
ref_link = ref_link..frame:extensionTag("ref",frame:expandTemplate{ title = 'cite_web', args = { title = abbr_url, url = ref_url} })
▲ local br_count = 0
for i =1, table.getn(ref_link_list) do --get at most 4 elements to display▼
else
br_count = 0▼
ref_link = ref_link ..'<br>'▼
end▼
end▼
end
root
:tag('tr')
Line 634 ⟶ 626:
:tag('table')
:css('padding', '0')
:css('border', 'none')
Line 640 ⟶ 631:
:css('width', '100%')
:css('text-align', 'right')
:tag('tr')
:tag('td')
Line 670 ⟶ 650:
--p.renderDrug = function(drug, drug_ref)
p.renderDrug = function(frame,drug)
local title = "Targeted by Drug"
local drug_title = "Drug Name"
Line 717 ⟶ 697:
for key,value in pairs(drug) do
local i = 0
--local ref_collapse = ""
local ref_default = ""
local ref_link = ""
Line 730 ⟶ 710:
end
end
abbr_url = string.gsub(ref_url, "http://", '')
if i > 1 then --not sure why indexing off, but renders empty value if don't do this
ref_link = ref_link..frame:extensionTag("ref",frame:expandTemplate{ title = 'cite_web', args = { title = abbr_url, url = ref_url} })
br_count = br_count -1
if br_count < 3 then
br_count = br_count + 1
▲ end
▲ local br_count = 0
▲ ref_link = ref_link..table.remove(ref_link_list, 1) .. ' '
▲ if br_count < 5 then
▲ br_count = br_count + 1
▲ else
▲ br_count = 0
▲ end
:tag('tr')
:attr('colspan', 4)
Line 783 ⟶ 754:
:css('width', '100%')
:css('text-align', 'right')
:tag('tr')
:tag('td')
Line 933 ⟶ 893:
end
p.renderOrthologs = function(frame, entrez_gene, entrez_gene_mm, ensembl, ensembl_mm, uniprot, uniprot_mm, refseq_mRNA, refseq_mRNA_mm, refseq_prot, refseq_prot_mm, db, chr, gstart, gend, db_mm, chr_mm,gstart_mm, gend_mm)
local title = "Orthologs"
--to do make the list creation a function
Line 1,313 ⟶ 1,273:
local pubmed_link = entrez_gene
if string.match(entrez_gene, '%w+') and entrez_gene ~= "n/a" then
pubmed_link = frame:extensionTag("ref",frame:expandTemplate{ title = 'cite_web', args = { title ="Human PubMed Reference:" , url = "
end
local pubmed_mm_link = entrez_gene_mm
if string.match(entrez_gene_mm, '%w+') and entrez_gene_mm ~= "n/a" then
pubmed_mm_link = frame:extensionTag("ref",frame:expandTemplate{ title = 'cite_web', args = { title ="Mouse PubMed Reference:" , url ="
end
Line 2,424 ⟶ 2,384:
ref = getReference("", k, entity, "P2293", i)
if (ref ~= nil and ref ~= '') then
refLink = refLink..",
end
end
Line 2,474 ⟶ 2,434:
ref = getReference(protein_id, k, entity, "P129", i)
if (ref ~= nil and ref ~= '') then
refLink = refLink..",
end
end
|