HelenaLC / CATALYST

Cytometry dATa anALYsis Tools
67 stars 30 forks source link

Faceting plotScatter by Metacluster #346

Closed LukaTandaric closed 1 year ago

LukaTandaric commented 1 year ago

Dear Helena,

is it possible to facet the plots of the plotScatter function by metacluster? I would like to save time when checking the quality of the flowSOM clustering by viewing the results in biaxial plots on a per-metacluster basis, since the metaclustering is my end goal in the sense of representing populations of cells.

I am unable to find a way to do this, since the plotScatter function only takes variables from names(int_colData(x)), which doesn't contain assigments of cells to the metaclustering layer of the workflow.

I have attempted to find a solution to this dilemma amongst the issues here, but did not find one. Apologies if I unwittingly missed it.

Kind regards. Luka

LukaTandaric commented 1 year ago

Dear Helena,

I figured it out:

# Addind a metacluster_id column to the SCE:
SCE_metaclustered$metacluster_id <- cluster_ids(SCEmetaclustered, k = "metacluster_merging") # Add a "metacluster_id"
column. "k" can be any clustering level, such as "som64", or "meta20" (column headers of "cluster_codes(x)"). In this
case, it is my manual metaclustering my means of using the mergeClusters function.

colData(SCE_metaclustered) # Check the headers of the colData.

# Plotting scatter plots faceted by metacluster:
plotScatter(
    x = SCE_metaclustered,
    chs = c("chX", "chY"),
    facet_by = "metacluster_id"
)

Regards.