KarrLab / obj_tables

Tools for creating and reusing high-quality spreadsheets
https://objtables.org
MIT License
8 stars 2 forks source link

Grouped columns - optional alternative syntax? #153

Open liebermeister opened 4 years ago

liebermeister commented 4 years ago

Hi Jonathan,

we talked about this already, but I'd like to bring this up again.

Since SBtab does not support grouped tables, it will not be able to import ObjTables files that use this feature. Therefore, it would be great if there was an option in ObjTables that allows for import and export of data files in an alternative form. Instead of

 | !GROUP |       |

!A | !X | !Y |!B

this form could read, for example,

!A | !::GROUP::X | !::GROUP::Y | !B

It's not urgent, but it would be good to know whether you would be willing to implement this in principle.

Thank you!

Best, Wolf

jonrkarr commented 4 years ago

In principle, we could flatten out of the column headings. The one issue I forsee is that the separator character(s) (e.g. ::) would need to disallowed from the names of the individual columns. I didn't implement this early because SBtab does indicate some groups of columns, but it didn't seem to be used consistently.

Also, should the group be preceded by !! (e.g., !!Group :: !Column) since groups correspond to their own classes?

liebermeister commented 4 years ago

Ok great! We don't have to decide this soon, but it's important for me to know that it can be done in the future.

I think the !! syntax would be nice (because it's very consistent with the semantics of grouped columns), but it makes it a bit harder to recognise the table header lines (which, then, are not the only lines anymore that can start with !!). So yet another possibilty, to avoid this, would be something like

:!!Group!Column or :!!Group:!Column

I will discuss this with Timo.

Thank you!!

jonrkarr commented 4 years ago

I offer this is as a suggestion. I think we should try to be consistent in the usage of the ! and !!. To me, the :: is inconsistent with the current markup.

Actually, I don't think we need a separator. Its sufficient to use !! to denote a group and ! to denote a column of a group. In addition, we have to disallow ! from table names. We can flexibility allow white space (not tabs) between the group name and column name. It could look like this:

!!Group-name !Column-name
liebermeister commented 4 years ago

Thank you! I will think about this with Timo.