Open rwbaer opened 3 months ago
This issue report could be related to/confounded with issue #210.
As a follow-up, I deleted my samples-template.csv and tried creating my quad gate BEFORE creating my two interval gates. I was able to successfully add my quad gate without an error. I can't prove this; just a theory?
> library(CytoExploreR)
> gsSamp <- cyto_setup(path = "Samples",
+ gatingTemplate = "Samples-Template.csv",
+ details = "Samples-Details.csv",
+ restrict = TRUE)
Loading FCS files into a GatingSet...
Assigning markers to channels...
Experiment-Markers.csv found in working directory.
Updating experiment details...
Samples-Details.csv found in working directory.
Removing unassigned channels...
Setting Samples-Template.csv as the active gatingTemplate...
Creating Samples-Template.csv ...
Done!
> # Apply compensation to samples, based on the spill matrix calculated with our calibration beads
> gsSamp <- cyto_compensate(gsSamp,
+ spillover = "Spillover-Matrix.csv")
> # Show us what we have
> cyto_channels(gsSamp)
[1] "TIME_MSW" "TIME_LSW" "FSC-HEIGHT" "FSC-AREA" "FSC-WIDTH" "SSC-HEIGHT" "SSC-AREA" "SSC-WIDTH"
[9] "FL2-AREA" "FL4-AREA"
> cyto_markers(gsSamp)
TIME_MSW FSC-HEIGHT FSC-AREA SSC-AREA FL2-AREA FL4-AREA
"TIME" "FSC-HEIGHT" "FSC-AREA" "SSC-AREA" "AnnexinV-AREA" "SytoxAAD-AREA"
> cyto_fluor_channels(gsSamp)
[1] "FL2-AREA" "FL4-AREA"
> # We use asinh because logicle fails out of the box.
> transList <- cyto_transformer_arcsinh(gsSamp)
Warning messages:
1: In par(pars) : argument 1 does not name a graphical parameter
2: In par(pars) : argument 1 does not name a graphical parameter
> # Apply our asinh transform for better viewing of our data
> # never do this line more than once. Start over if in doubt.
> gsSamp = cyto_transform(gsSamp, trans = transList)
Warning messages:
1: In par(pars) : argument 1 does not name a graphical parameter
2: In par(pars) : argument 1 does not name a graphical parameter
> # Gate (non-debris) Cells (gating template Samples.csv)
>############
> # Draw Gates
>############
> cyto_gate_draw(gsSamp,
+ parent = "root",
+ alias = "Non-Debris",
+ channels = c("FSC-AREA", "SSC-AREA"))
Select at least 3 points to construct a polygon gate around the Non-Debris population.
Adding newly constructed gate(s) to Samples-Template.csv .
...
done
Warning message:
In par(pars) : argument 1 does not name a graphical parameter
> # Gate Single Cells (gating template Samples.csv)
> cyto_gate_draw(gsSamp,
+ parent = "Non-Debris",
+ alias = "Single Cells",
+ channels = c("FSC-AREA", "FSC-HEIGHT"))
Select at least 3 points to construct a polygon gate around the Single Cells population.
Adding newly constructed gate(s) to Samples-Template.csv .
...
done
Warning message:
In par(pars) : argument 1 does not name a graphical parameter
>###################
> # Draw Quad gate
>###################
> # necrosis and apoptosis
> # Quad gate - named clockwise from upper left
> cyto_gate_draw(gsSamp,
+ parent = "Single Cells",
+ alias = c("necrotic", "necrotic-apoptotic", "apoptotic", "live"),
+ channels = c("FL2-AREA", "FL4-AREA"),
+ type = "quadrant",
+ limits = "instrument")
Select the center point to construct quadrant gates.
Adding newly constructed gate(s) to Samples-Template.csv .
...
done
Warning message:
In par(pars) : argument 1 does not name a graphical parameter
> # Gate Live Single Cells
> # Gate SytoxAAD on Unstained
> cyto_gate_draw(gsSamp,
+ parent = "Single Cells",
+ alias = c("Live", "Dead"),
+ channels = "FL4-AREA",
+ type = "interval",
+ negate = TRUE)
Select the lower and upper bounds of the Live population to construct an interval gate.
Adding newly constructed gate(s) to Samples-Template.csv .
...
done
Warning message:
In par(pars) : argument 1 does not name a graphical parameter
> # Gate Annexin-pos Cells
> cyto_gate_draw(gsSamp,
+ parent = "Single Cells",
+ alias = c("Annexin+", "Annexin-"),
+ channels = "FL2-AREA",
+ type = "interval",
+ negate = TRUE)
Select the lower and upper bounds of the Annexin+ population to construct an interval gate.
Adding newly constructed gate(s) to Samples-Template.csv .
...
done
Warning message:
In par(pars) : argument 1 does not name a graphical parameter
> # cyto_plot_gating_scheme(gsSamp)
> cyto_plot_gating_tree(gsSamp) # Cytoexplorer version of gating tree
The gates appear to create properly:
So, it now seems everything has gone well, but try to apply the Sample-Template
> cyto_gatingTemplate_apply(gsSamp, gatingTemplate = "Samples-Template")
Applying Samples-Template.csv to the GatingSet...
Preprocessing for 'Non-Debris'
Gating for 'Non-Debris'
done!
done.
Preprocessing for 'Single Cells'
Gating for 'Single Cells'
done!
done.
Preprocessing for 'Annexin+'
Gating for 'Annexin+'
done!
done.
Annexin- gating...
done!
done.
Preprocessing for 'Live'
Gating for 'Live'
done!
done.
Dead gating...
done!
done.
Error in length(gs_nodes) == 0 || !popAlias %in% gs_nodes :
'length = 4' in coercion to 'logical(1)'
We see the same error that we did when I was trying to add the quad gate before. This makes it look like issue #210 is involved.
Describe the bug When creating a manual quad gate with cyto_gate_draw(), The graphical portion of the gate creation seems to work, but an error iis produced and the gate(s) are not added to the gating template.
To Reproduce Steps to reproduce the behavior: Execute this code on a loaded gating set called gsSamp
Expected behavior I expect the four components of a quad gate to be created and added to the gating template.
Screenshots Graphically, things appear to be working:
Desktop (please complete the following information):
Additional query about a warning Side query. For some time now I have been receiving the warning. I don't believe I used to get it. Is it something of known origin that I should be worried about? In addition: Warning message: In par(pars) : argument 1 does not name a graphical parameter