Module talk:Infobox gene/Archive 2
This is an archive of past discussions about Module:Infobox gene. Do not edit the contents of this page. If you wish to start a new discussion or revive an old one, please do so on the current talk page. |
Archive 1 | Archive 2 |
Rendering of bgee_default is broken at SPI1
The rendering of bgee_default is broken at SPI1. Something in the logic is creating a URL link that attempts to wrap around a five-element bulleted list. This problem is also observable at Allograft inflammatory factor 1. – Jonesey95 (talk) 17:42, 11 February 2022 (UTC)
- This appears to be due to an edit I did for Tarsmf, alias BgeeDB, back in October. Looking at the code, I don't know enough Lua to figure out how to unwrap the Bgee link from around the bulleted list. Hopeful that Tarsmf will be able to fix this. P.I. Ellsworth - ed. put'r there 14:22, 12 February 2022 (UTC)
- To editor Jonesey95: in addition, there are two Linter errors, apparently identical and caused by Ibox gene, on the two pages you mention above. P.I. Ellsworth - ed. put'r there 16:36, 12 February 2022 (UTC)
- Yes, that is why I reported the bug. – Jonesey95 (talk) 19:53, 12 February 2022 (UTC)
- Okay, the October edits that added Bgee have been removed until editor Tarsmf can test them further. And btw, the Linter errors have disappeared from those two articles. P.I. Ellsworth - ed. put'r there 22:38, 12 February 2022 (UTC)
- Yes, that is why I reported the bug. – Jonesey95 (talk) 19:53, 12 February 2022 (UTC)
Bgee edit request from October 2021
| ||||
---|---|---|---|---|
Template-protected edit request on 13 October 2021
Changes to include gene expression calls via "expressed in" statements from Wikidata / Bgee databaseThe code below adds into the Wikipedia "infobox gene" the "expressed in" assertions of human genes available in Wikidata from the Bgee database (www.bgee.org) to the "RNA expression pattern" section in the infobox. These assertions per gene are at most the top 10 anatomic entities (tissues) where a gene is expressed. The code is available in the sandbox at https://en.wikipedia.org/wiki/Module:Infobox_gene/sandbox and tested in https://en.wikipedia.org/w/index.php?title=Module_talk:Infobox_gene/testcases infobox gene testcase talk.
BgeeDB (talk) 14:13, 13 October 2021 (UTC)
References
|
To make it a little easier for editor Tarsmf the October edit request has been included above in the collapsed section. P.I. Ellsworth - ed. put'r there 22:56, 12 February 2022 (UTC)
To editor Tarsmf: the Bgee code has been re-added to Module:Infobox gene/sandbox and the SPI1 & AIF1 infoboxes have been set up as test cases at Module talk:Infobox gene/testcases so you can see what was happening in the "RNA expression pattern" sections of the iboxes. P.I. Ellsworth - ed. put'r there 05:33, 14 February 2022 (UTC)
- To editor Paine Ellsworth: and To editor Jonesey95: Thanks for reporting the issues. I have corrected them, please let me know if there is any other concern. The latest code is available in the sandbox at Module:Infobox gene/sandbox and tested with the reported examples at Module talk:Infobox gene/testcases. Sorry for not being able to correct it promptly, I have just seen this bug report today (I have to check why I am not receiving email notifications from Wikipedia). Tarsmf (talk) 16:48, 18 February 2022 (UTC)
To editors Tarsmf and Jonesey95: looks like this has been repaired, so the Bgee edits have been reinstated in this template. Testing should continue so that any future anomalies will be quickly fixed. P.I. Ellsworth - ed. put'r there 00:47, 20 February 2022 (UTC)
ensembl_id is nil
A few articles (examples: C2orf16, MKKS) are showing: "Lua error in Module:Infobox_gene at line 1153: attempt to concatenate local 'ensembl_id' (a nil value)."
That is because line 1150 is:
local ensembl_id = string.match(ensembl,"%a+%d+")
but the pattern was not found so nil
was returned. Line 167 set ensembl:
local ensembl = check_values(p.getValue, {entity, "P594", localNotApplicableStr})
That's probably because MKKS (Q18032762) has no Ensembl gene ID (P594) entry. At any rate, if there is a default ensembl value that would help, it could easily be added by appending or "WHATEVER"
to line 167.
By the way, the module has 18 global variables due to missing "local". I could fix them if wanted as they are undesirable. Johnuniq (talk) 02:57, 20 February 2022 (UTC)
- To editors Johnuniq and Paine Ellsworth: thanks for reporting it, this issue is now corrected (latest code at Module:Infobox gene/sandbox) and tested at Module talk:Infobox gene/testcases Tarsmf (talk) 08:09, 20 February 2022 (UTC)
- I changed your edit because it is much better to use Lua's conventions. Then I couldn't resist cleaning up some whitespace issues: using tabs for indents, omit trailing space. I'll leave the globals for now but they should be fixed. Johnuniq (talk) 08:49, 20 February 2022 (UTC)
- thanks but now it is producing a new error for AIF1 see Module talk:Infobox gene/testcases "Lua error in Module:Infobox_gene/sandbox at line 753: attempt to perform arithmetic on local 'gend' (a string value)." Tarsmf (talk) 08:52, 20 February 2022 (UTC)
- I'll have a look at that soon, I hope, but the problem has been there a while. I just edited two old revisions of Module:Infobox gene/sandbox (at 07:55, 20 February 2022 and at 16:31, 18 February 2022) and previewed them with Module talk:Infobox gene/testcases. They both show "Lua error in Module:Infobox_gene/sandbox at line 753: attempt to perform arithmetic on local 'gend' (a string value)". Johnuniq (talk) 09:06, 20 February 2022 (UTC)
- Wow this is strange, because the latest version at Module talk:Infobox gene based on 16:31, 18 February 2022 does not show this error. Moreover, the variable "gend" was never edited by me Tarsmf (talk) 09:17, 20 February 2022 (UTC)
- I don't follow that. Your permalink is the same as mine and I just tried it again. It gives the gend error for the testcases. Johnuniq (talk) 09:29, 20 February 2022 (UTC)
- Sorry, what I was trying to say is that the deployed version for the Module:Infobox_gene 00:41, 20 February 2022 seems to be based on 16:31, 18 February 2022 and it is not showing the "gend" error for the Wikipedia gene page AIF1. Tarsmf (talk) 09:42, 20 February 2022 (UTC)
- The reason gend is giving an error is that its value is a non-numeric string, namely "VALUE_ERROR (too many expensive function calls)". There might be some inefficiency in the module, or more likely, there are too many calls on the testcases page and it is blowing up. I noticed check_values and wondered if it mightn't be better to raise an error to make it clear there is a problem. Regarding gstart and gend, what should happen is that they get converted to numbers with an error displayed if that fails. Currently the code relies on Lua's quirk of silently converting numeric strings to numbers when asked to do arithmetic. That's fine, but it leads to weird error messages like this one. Johnuniq (talk) 09:47, 20 February 2022 (UTC)
- Sorry, what I was trying to say is that the deployed version for the Module:Infobox_gene 00:41, 20 February 2022 seems to be based on 16:31, 18 February 2022 and it is not showing the "gend" error for the Wikipedia gene page AIF1. Tarsmf (talk) 09:42, 20 February 2022 (UTC)
- I don't follow that. Your permalink is the same as mine and I just tried it again. It gives the gend error for the testcases. Johnuniq (talk) 09:29, 20 February 2022 (UTC)
- Wow this is strange, because the latest version at Module talk:Infobox gene based on 16:31, 18 February 2022 does not show this error. Moreover, the variable "gend" was never edited by me Tarsmf (talk) 09:17, 20 February 2022 (UTC)
- I'll have a look at that soon, I hope, but the problem has been there a while. I just edited two old revisions of Module:Infobox gene/sandbox (at 07:55, 20 February 2022 and at 16:31, 18 February 2022) and previewed them with Module talk:Infobox gene/testcases. They both show "Lua error in Module:Infobox_gene/sandbox at line 753: attempt to perform arithmetic on local 'gend' (a string value)". Johnuniq (talk) 09:06, 20 February 2022 (UTC)
- thanks but now it is producing a new error for AIF1 see Module talk:Infobox gene/testcases "Lua error in Module:Infobox_gene/sandbox at line 753: attempt to perform arithmetic on local 'gend' (a string value)." Tarsmf (talk) 08:52, 20 February 2022 (UTC)
- I changed your edit because it is much better to use Lua's conventions. Then I couldn't resist cleaning up some whitespace issues: using tabs for indents, omit trailing space. I'll leave the globals for now but they should be fixed. Johnuniq (talk) 08:49, 20 February 2022 (UTC)
The sandbox works better at the two articles cited, C2orf16 & MKKS. Question is, what might be broken elsewhere? Sandbox seems to be okay at the AIF1 article as well, which is curious as to why it gives the Lua error on the test cases page, but not in the article? P.I. Ellsworth - ed. put'r there 09:55, 20 February 2022 (UTC)
- As figured out by Johnuniq, the arithmetic issue happens because of too many calls in the test cases page, therefore this issue will not happen in the wikipedia articles (just one call). Then, in my opinion, we can deploy the latest version edited by Johnuniq at Module:Infobox gene/sandbox, mainly to solve the issue "ensembl_id is nil". Thanks! Tarsmf (talk) 10:29, 20 February 2022 (UTC)
- Then let's give it a good shot. Looks so much better at C2orf16 & MKKS! noties to Johnuniq & Tarsmf. The AIF1 test case has been split off to Module talk:Infobox gene/testcases 2. P.I. Ellsworth - ed. put'r there 19:32, 20 February 2022 (UTC)
Global variables
I've done some more cleaning in Module:Infobox gene/sandbox. Please let me know if anyone really likes how it was before but I think the whitespace changes accord with how most modules are written.
I mentioned that global variables are a problem. As an example, search to find:
uniprot__mm_collapse = "none"
That has a typo (double underscore) which means the line effectively does nothing. I'm not sure if the line should be deleted or if the typo should be fixed.
I fixed a couple of easy globals but there are several others that require knowledge of the logic of the module. For example, see p.getPDB = function(protein_entities)
which uses the undefined propertyID
. Presumably that should be a function parameter?
Another problem is in p.getAliasFromGenomeAssembly = function(entity, prefix)
which has the line
else output = location
where location
is undefined.
There are a few variables which appear to be intended as global to the module. For example, root
and titleBGcolor
. I assume that no other module needs access to these globals, so there should be some lines at the top (before any functions) with
local root, titleBGcolor
(or put them on separate lines with a comment on each indicating its purpose). Johnuniq (talk) 02:42, 21 February 2022 (UTC)
- I have finished cleaning Module:Infobox gene/sandbox and there are no longer any global variables. The behavior of the module should be unchanged but the testcases are very hard to check in detail—they look ok. I'll leave this for a short while but will return to copy the changes to Module:Infobox gene because that's the only real test. Johnuniq (talk) 06:36, 23 February 2022 (UTC)
- For me it sounds quite good! I think it is ready for deployment too, I did a quick inspection and I did not notice any change in the code logic/behaviour. Tarsmf (talk) 08:37, 23 February 2022 (UTC)
- Agree. Well, editor Uzume wrote of several issues with this module plus a lot of hard work, and I know I appreciate what you've done here, Johnuniq! Appears to be ready to go. P.I. Ellsworth - ed. put'r there 14:01, 23 February 2022 (UTC)
- Thanks for checking. I have updated the module from the sandbox. Johnuniq (talk) 00:31, 24 February 2022 (UTC)
- Agree. Well, editor Uzume wrote of several issues with this module plus a lot of hard work, and I know I appreciate what you've done here, Johnuniq! Appears to be ready to go. P.I. Ellsworth - ed. put'r there 14:01, 23 February 2022 (UTC)
- For me it sounds quite good! I think it is ready for deployment too, I did a quick inspection and I did not notice any change in the code logic/behaviour. Tarsmf (talk) 08:37, 23 February 2022 (UTC)
Including mouse gene expression and updating Bgee links
The code available at Module:Infobox_gene/sandbox includes gene expression data into the "RNA expression pattern section" for the orthologous gene in Mouse of a given Human gene.
At the code level, mainly the following functions in the code had changes:
function p.renderRNAexpression(...)
...
end
function p.renderExpressionList(bgee_expression, bgee_default)
...
end
Tests were successfully performed according to the use cases at Module_talk:Infobox_gene/testcases.
All changes comparing the sandbox and the deployed Wikipedia gene article pages can be visualised at https://en.wikipedia.org/w/index.php?title=Module%3AInfobox_gene%2Fsandbox&type=revision&diff=1088153740&oldid=1074398347 Tarsmf (talk) 13:48, 16 May 2022 (UTC)
- Hi @Paine Ellsworth, since I did not get any reply, I am directly contacting you for help to see if there is any chance for this update to be considered. In summary there are two main aspects:
- - Update Bgee links (that will be broken by next year)
- - Provide gene expression information of the corresponding Mouse gene (model organism for human). Note that the orthologous gene (corresponding gene) in Mouse is already provided in the infobox "Orthologs section" and with this update we also provide the gene expression for the corresponding mouse gene.
- Thanks for your help! Tarsmf (talk) 15:40, 19 July 2022 (UTC)
- Working on it. P.I. Ellsworth , ed. put'r there 16:35, 19 July 2022 (UTC)
- Okay, editor Tarsmf, the sandbox has been synched to the live template. Since the changes were involved, let's be vigilant and hope that no other editors find problems with the edits. If there is any update needed to the template documentation, please see to that also. P.I. Ellsworth , ed. put'r there 21:35, 19 July 2022 (UTC)
- Thank you very much for the prompt reply! Tarsmf (talk) 08:06, 20 July 2022 (UTC)
- my pleasure! Paine 15:51, 20 July 2022 (UTC)
- Thank you very much for the prompt reply! Tarsmf (talk) 08:06, 20 July 2022 (UTC)
Template-protected edit request on 21 July 2022
This edit request to Module:Infobox gene has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Change Line 2833 from
result_GOID = entity:formatPropertyValues(propertyID_child, mw.wikibase.entity.claimRanks).value
to
result_GOID = entity:formatPropertyValues(propertyID_child, {mw.wikibase.entity.claimRanks.RANK_NORMAL}).value
This should fix an issue where items with depreciated GOIDs listed in Wikidata generate non-functional links with unexpected display text, such as what is visible on Lactoferrin. WelpThatWorked (talk) 15:17, 21 July 2022 (UTC)
- You say "should fix an issue..." This module is used on thousands of pages. Has this been tested? P.I. Ellsworth , ed. put'r there 22:01, 21 July 2022 (UTC)
- I've tested the change with the sandbox console to generate infoboxes for several pages that currently use it, and it has generated the output I expected each time, with the only change being that entities with depreciated GOID entries display correctly, linking to the "normal" ranked GOID, rather than generating a broken link. It relies on the GOID rankings on wikidata being set properly, but they're already set correctly for every entity I've checked so far, and if there are any that aren't, the resulting output would not be more broken than it already is. Is there any other testing I should do? WelpThatWorked (talk) 23:57, 21 July 2022 (UTC)
- That should do it, hopefully, and done. P.I. Ellsworth , ed. put'r there 05:09, 22 July 2022 (UTC)
- I've tested the change with the sandbox console to generate infoboxes for several pages that currently use it, and it has generated the output I expected each time, with the only change being that entities with depreciated GOID entries display correctly, linking to the "normal" ranked GOID, rather than generating a broken link. It relies on the GOID rankings on wikidata being set properly, but they're already set correctly for every entity I've checked so far, and if there are any that aren't, the resulting output would not be more broken than it already is. Is there any other testing I should do? WelpThatWorked (talk) 23:57, 21 July 2022 (UTC)
Request to uncollapse ""Orthologs" data
@Paine Ellsworth: Thanks for including the mouse gene expression and updating Bgee links. A side effect of these edits is that the "RNA expression pattern" is displayed uncollapsed and the "Orthologs" data is displayed collapsed. In my opinion, the "RNA expression pattern" data, while useful is probably of lower importance than the external links to Entrez, UniProt, etc. contained in the "Orthologs" table. Furthermore, the "Orthologs" data in the past has never been collapsed. I have been able to collapse the "RNA expression pattern" table in this edit. But I cannot figure out how to uncollapse the "Orthologs" table. (Your edits did not seem to involve this table, so I am really puzzled why this table is now collapsed). I would appreciate if you could restore the "Orthologs" data to its default uncollapsed state. Thanks. Boghog (talk) 09:24, 24 July 2022 (UTC)
- Opps! Never mind. I figured it out and implemented in this edit. Boghog (talk) 09:35, 24 July 2022 (UTC)
- Acknowledged. P.I. Ellsworth , ed. put'r there 09:46, 24 July 2022 (UTC)
Request to add Expression Atlas links
Initial disclaimer: I am the Lead Developer of Expression Atlas and Single Cell Expression Atlas web applications (https://www.ebi.ac.uk/people/person/alfonso-munoz-pomer-fuentes/).
A couple of years ago a proposal to add Expression Atlas to the infobox was briefly discussed. I’d like to bring the topic back, and gauge how much interest there is in the community. I’ve been hacking around the Lua code and I got to add three useful links for a given gene: bulk baseline expression (e.g. mRNA-seq experiments), bulk differential expression (e.g. microarray experiments) and single-cell expression (single cell RNA-seq).
See an example below. Feel free to offer any suggestions. I’m not very knowledgeable in Lua, but I tried to follow the conventions I saw in the module.
File:Infobox gene (sandbox) with Expression Atlas links.png – Alfonso Muñoz-Pomer Fuentes (talk) 16:44, 4 August 2022 (UTC)
Template-protected edit request on 2 March 2023
This edit request to Module:Infobox gene has been answered. Set the |answered= or |ans= parameter to no to reactivate your request. |
Error: [778:86] invalid escape sequence near '\:' مهدی بهرامی مطلق (talk) 16:29, 2 March 2023 (UTC)
- Not sure where you saw this error, but I believe \: and \; are not required, please check diff — Martin (MSGJ · talk) 21:51, 3 March 2023 (UTC)
- That was a massive and very productive edit! I didn't check all the details but it looked good and fixed the reported problem. Johnuniq (talk) 01:10, 4 March 2023 (UTC)
- Had my Lua-challenged mind puzzled! Seems that the error is found in the [edit screen]. Click on the red x-box at the bottom of the edit screen to actually see the error. That does not appear in the sandbox's edit screen. P.I. Ellsworth , ed. put'er there 07:42, 4 March 2023 (UTC)
Human UniProt search error
I am not sure if this is a problem in Infobox gene or Wikidata, but the rendering of the Human UniProt search link in Mucin-1 is not right. Does anyone have any idea how to fix this? Thanks. Boghog (talk) 06:43, 26 April 2023 (UTC)
- Done The problem was in Wikidata. Only one UniProt ID should be associated with the human protein, not two. Fixed in this edit. Boghog (talk) 06:50, 26 April 2023 (UTC)