You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Configs generated by vitessce-python 1.0.9 (view conf version 1.0.7) then upgraded to 1.0.16 have obsLabelsType coordination spaces with more than one value when upgraded, each of which is included in the coordination scopes of views, e.g.:
Creating this coordination in the new version of vitessce-python is trickier. The use_coordination function replaces any current scopes with the new passed value, so passing it five instances of coordinations with the same type makes it update the coordinationScopes.obsLabelsType to A, then B, then C, then D, then finally E.
In order to achieve something close to the desired result (i.e. set multiple scopes for the same coordination type), I had to create a custom VitessceConfigCoordinationScope with the desired list set to the c_scope value:
from vitessce.config import VitessceConfigCoordinationScope
OBS_LABELS = 'obsLabelsType'
factors = [
"marker_gene_0",
"marker_gene_1",
"marker_gene_2",
"marker_gene_3",
"marker_gene_4"
]
label_coordinations = vc.add_coordination(*[OBS_LABELS for _ in factors])
for i, factor in enumerate(factors):
label_coordinations[i].set_value(factor)
scopes = [str(l.c_scope) for l in label_coordinations]
customScope = VitessceConfigCoordinationScope(
c_type=OBS_LABELS, c_scope=scopes)
for v in views:
v.use_coordination(customScope)
My suggested enhancement to make this more straightforward would be to add an allow_multiple_scopes_per_type arg (or similar) to allow the link_views and use_coordination components to link the view to all passed scopes of the same type at once; i.e. when this flag is true, the behavior of use_coordination should be adjusted to convert the coordinationScopes value to an array and append to it if there's a value already present, rather than replacing the existing value.
The text was updated successfully, but these errors were encountered:
Configs generated by vitessce-python 1.0.9 (view conf version 1.0.7) then upgraded to 1.0.16 have
obsLabelsType
coordination spaces with more than one value when upgraded, each of which is included in the coordination scopes of views, e.g.:Original 1.0.7 config, unabridged
Excerpt from 1.0.16 config with multiple `obsLabelsType` values in the `coordinationScopes` of views
Creating this coordination in the new version of
vitessce-python
is trickier. Theuse_coordination
function replaces any current scopes with the new passed value, so passing it five instances of coordinations with the same type makes it update thecoordinationScopes.obsLabelsType
toA
, thenB
, thenC
, thenD
, then finallyE
.In order to achieve something close to the desired result (i.e. set multiple scopes for the same coordination type), I had to create a custom
VitessceConfigCoordinationScope
with the desired list set to thec_scope
value:My suggested enhancement to make this more straightforward would be to add an
allow_multiple_scopes_per_type
arg (or similar) to allow thelink_views
anduse_coordination
components to link the view to all passed scopes of the same type at once; i.e. when this flag istrue
, the behavior ofuse_coordination
should be adjusted to convert thecoordinationScopes
value to an array and append to it if there's a value already present, rather than replacing the existing value.The text was updated successfully, but these errors were encountered: