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)