Gemma icon indicating copy to clipboard operation
Gemma copied to clipboard

add basic support for tracking gene type (not exposed anywhere)

Open ppavlidis opened this issue 2 years ago • 7 comments

As per #64

This should be added as a field to the API and probably displayed on the UI.

Consider making more human-readable but not important.

ppavlidis avatar Apr 11 '23 20:04 ppavlidis

Is it possible to use an enumerated type for this? It will be exposed in the RESTful API as a string field otherwise.

arteymix avatar Apr 11 '23 23:04 arteymix

The underlying NCBIGeneInfo.GeneType could be used or a new type made if that's better.

ppavlidis avatar Apr 11 '23 23:04 ppavlidis

It would be preferable to have our own internal representation that we control for gene type and convert between the two, otherwise we would be at the mercy of NCBI for gene type definitions.

arteymix avatar Apr 12 '23 16:04 arteymix

Well, actually we could relocate the GeneType enum into our models because we parse it from a string supplied by NCBI. We can do a bit of renaming for clarity because the enum names will be stored in the database.

The Hibernate mapping is really simple for these:

<property name="type">
    <column name="TYPE" not-null="false" unique="false" sql-type="VARCHAR(255)"/>
    <type name="org.hibernate.type.EnumType">
        <param name="enumClass">ubic.gemma.model.common.description.DatabaseType</param>
        <param name="useNamed">true</param>
    </type>
</property>

arteymix avatar Apr 12 '23 16:04 arteymix

That is our internal representation. It's just part of our model for the NCBI gene info. Our practice has been to not carry stuff like that over directly to our entities. In this case the elements of the enum would be identical to the one we already implemented.

ppavlidis avatar Apr 12 '23 16:04 ppavlidis

Well, actually we could relocate the GeneType enum into our models because we parse it from a string supplied by NCBI. We can do a bit of renaming for clarity because the enum names will be stored in the database.

The Hibernate mapping is really simple for these:

<property name="type">
    <column name="TYPE" not-null="false" unique="false" sql-type="VARCHAR(255)"/>
    <type name="org.hibernate.type.EnumType">
        <param name="enumClass">ubic.gemma.model.common.description.DatabaseType</param>
        <param name="useNamed">true</param>
    </type>
</property>

Yes that is the right solution

ppavlidis avatar Apr 12 '23 16:04 ppavlidis

That is our internal representation. It's just part of our model for the NCBI gene info. Our practice has been to not carry stuff like that over directly to our entities. In this case the elements of the enum would be identical to the one we already implemented.

Agree here too. We can add an extra OTHER type to match unsupported NCBI gene types.

arteymix avatar Apr 21 '23 19:04 arteymix