Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New fields for Batches entity #1863

Closed
leandroradusky opened this issue Jan 24, 2023 — with Manas.Tech Commit · 10 comments · Fixed by #1940
Closed

New fields for Batches entity #1863

leandroradusky opened this issue Jan 24, 2023 — with Manas.Tech Commit · 10 comments · Fixed by #1940
Assignees
Milestone

Comments

Copy link
Contributor

leandroradusky commented Jan 24, 2023

The Batch entity within CDx is missing some data to be complete in regard to the data that needs to be uploaded to NIH.

These new columns need to be added to batches:

  • reference_gene: all the calculations made are based on copies of the virus (i.e. concentration where its units is copies/ml) but what this count on reality is not copies of the virus, but based on a reference gene that can be counted experimentally. This depends on the methods used, in our scenario will be almost always equal to N the nucleocapsid protein but this, for other organisms could be whatever gene.
  • target_organism_taxonomy_id: ID given to the organism in molecular biology databases like NCBI
  • pango_lineage: stands for Phylogenetic Assignment of Named Global Outbreak Lineages, a database with reference names widely used in this scenario
  • who_label: name that the world health organization gives to the virus

Field labels:

  1. Reference gene
  2. Target organism taxonomy ID
  3. Pango Lineage
  4. Virus World Health Organization's label

All of them are combo free text fields:

  1. The field should be autocomplete, but allow entering values that aren't in the list.
  2. The list should include all values that were entered in previous batches for the current institution.
  3. The field needs to be in the Batch and in the Sample.
  4. The list of options for Batches and Samples, should be the same.
@diegoliberman
Copy link
Contributor

@leandroradusky could you briefly explain what those fields are about?

@leandroradusky
Copy link
Contributor Author

I will do it in the main text of the issue when we have the full details... But as an advance: these two mentioned above are names that the viruses within the batches have in global reference databases: WHO_label is the name that the world health organization gives to the virus, similarly, PANGO stands for Phylogenetic Assignment of Named Global Outbreak Lineages, a database with reference names widely used in this scenario.

@ysbaddaden
Copy link
Contributor

Shall the fields be free text, or would we like to have a database of all these names? The former is prone to human typos, while the second means we must keep the databases updated, which we probably don't want to.

@diegoliberman
Copy link
Contributor

@leandroradusky what do you say if we make these fields dropdowns/autocomplete? Plus an "other" option for entering the value manually if not found?
Ideally, in the future the system should have some kind of support for adding new options into the tables, but they would also have the "other" option for not getting blocked.
In the future, if they find a frequent need of adding options, a feature could be implemented for administering the values from the UI.

@leandroradusky
Copy link
Contributor Author

leandroradusky commented Feb 10, 2023

This can be done, we should confirm with them where they get this labels for different DBs and analyze if we can have a table, or if we should be constantly updating them from online resources (taxonomy id, I believe, will update each time there is a new strain of covid or whatever other organism, and they will need to add the options "constantly"─there isn't now one new strain per week, but in the peak of covide there were).

@ysbaddaden
Copy link
Contributor

Just a note that the estimation will be completely different: syncing a local copy of a database is more complex than having free text inputs.

@bolom bolom self-assigned this May 23, 2023
@diegoliberman
Copy link
Contributor

The conclusion regarding the fields to be free text or combos, is described in the section All of them are combo free text fields: of this ticket.

@bolom
Copy link
Contributor

bolom commented May 23, 2023

@diegoliberman still need some clarification

The field should be autocomplete, but allow entering values that aren't in the list.
The list should include all values that were entered in previous batches for the current institution.

If no values have been previously entered in these fields for batches from the same institution, the autocomplete feature will not have any suggestions to offer.

Conversely, if there have been values entered in these fields for past batches from the same institution, the autocomplete feature will provide these as suggestions when inputting data into these fields.

Thats correct?

The field needs to be in the Batch and in the Sample.

(reference_gene, target_organism_taxonomy_id, pango_lineage, who_label) this new field should be also in Sample model?

The list of options for Batches and Samples, should be the same.

For example, if you have a Batch with a reference_gene of "N", and later you are entering a Sample, "N" should come up as a suggestion for the reference_gene in the Sample as well, and vice versa.

that's correct?

@diegoliberman
Copy link
Contributor

@bolom the answer for the 3 questions is --> correct

:)

@bolom bolom linked a pull request May 23, 2023 that will close this issue
bolom added a commit that referenced this issue Jun 23, 2023
* Fix BachForm to use correct name
Fix Lint Syntax Issue
Update autocomplete.js.jsx

* AutoComplete Feature for Batch Model

* Delete autocomplete.js.jsx

Update batches_controller.rb

Delete autocomplete_value.rb

Update batch_form.rb

Update institution.rb

remove unused files

Update _form.haml

* Add react component helper: autocomplete_field

* Optimize Loading Values

* Fix test Suite

Fix TextSuite

* Fix: add combobox props to CdxSelectAutocomplete to fix broken autocomplete to box form

* Fix: debounce calls to CdxSelectAutocomplete to reduce stress on server

* Use Send instead of try in unique_values_for

---------

Co-authored-by: Julien Portalier <julien@portalier.com>
@ysbaddaden ysbaddaden added this to the v0.23.0 milestone Jul 3, 2023
@sardar-usman
Copy link

@bolom It is working fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants