-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Quad gates from flowjo are converted to giant rectangles in Cytobank #23
Comments
FJ is affected by this issue as well #20 , I am in the process of efforts of restoring quadgate |
@cciccole , I think I need your help to figure out the correct format specification for I think it may have to do with the fact that I didn't provide the <gating:QuadrantGate id="Gate_7_Q0Q0IHN1Yg..">
<gating:divider transformation-ref="Tr_Arcsinh_Comp_B710-A" compensation-ref="Spill_defaultCompensation" id="Gate_7_Q0Q0IHN1Yg..divider_1">
<data-type:fcs-dimension name="Comp_G560-A"/>
<gating:value>2.23594047371882</gating:value>
</gating:divider>
<gating:divider transformation-ref="Tr_Arcsinh_Comp_B710-A" compensation-ref="Spill_defaultCompensation" id="Gate_7_Q0Q0IHN1Yg..divider_2">
<data-type:fcs-dimension name="Comp_G780-A"/>
<gating:value>3.41168125519337</gating:value>
</gating:divider>
<gating:Quadrant id="Gate_9_Q0NSNysgNDVSQSs.">
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_1" location="3.23594047371882"/>
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_2" location="4.41168125519337"/>
</gating:Quadrant>
<gating:Quadrant id="Gate_10_Q0NSNysgNDVSQS0.">
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_1" location="3.23594047371882"/>
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_2" location="2.41168125519337"/>
</gating:Quadrant>
<gating:Quadrant id="Gate_8_Q0NSNy0gNDVSQSs.">
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_1" location="1.23594047371882"/>
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_2" location="4.41168125519337"/>
</gating:Quadrant>
<gating:Quadrant id="Gate_11_Q0NSNy0gNDVSQS0.">
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_1" location="1.23594047371882"/>
<gating:position divider_ref="Gate_7_Q0Q0IHN1Yg..divider_2" location="2.41168125519337"/>
</gating:Quadrant>
<data-type:custom_info>
<cytobank>
<name>CD4 sub</name>
<id>7</id>
<gate_id>7</gate_id>
<type>QuadrantGate</type>
<version>1</version>
<fcs_file_id></fcs_file_id>
<fcs_file_filename></fcs_file_filename>
<definition>{"scale":{"x":{"flag":4,"argument":"150","min":-200,"max":262144,"bins":256,"size":256},"y":{"flag":4,"argument":"150","min":-200,"max":262144,"bins":256,"size":256}}}</definition>
</cytobank>
</data-type:custom_info>
</gating:QuadrantGate> Here I also attached the complete example xml generated by cytoML |
@mikejiang I agree that the problem seems to be within the JSON definition. The
Thus making the full definition look like this: Note that the X and Y coordinates in the end of the JSON definition appear to be what control the placement of the gate's center point and the ones found within the It indeed has different requirements than other gates. Yet another level of strange nuance in this system... I'm impressed at how well you've dealt with all of it! You might run into another problem where gate labels say NA after import (and also the population tree doesn't load). This is actually Cytobank's fault and it's in the process of getting fixed. It has to do with importing a gatingML multiple times that contains identical spill information by name (or something along those lines...still investigating). Let me know (by email) if this afflicts you and I can rescue it on a per-case basis after gates have been imported. |
Thanks, @cciccole . I also found out that Anyway, |
@mikejiang Mm yeah I believe that is indeed another requirement. I didn't experience any error uploading the gatingML you provided, so perhaps in my case there was just strange behavior with the tree and/or stats. I didn't validate those components in my situation (because I didn't know the expected truth), just that things appeared to import okay without error. Thanks for catching this downstream issue. Will try the new code. |
@cciccole , I am running into the issue when I export the second the quadGate under the same parent but with different x,y dimensions. library(CytoML)
dataDir <- system.file("extdata",package="flowWorkspaceData")
gs <- load_gs(list.files(dataDir, pattern = "gs_manual",full = TRUE))
Rm("CD8", gs)
#nodes <- getChildren(gs, "CD4")[1:4]
#for(i in nodes)
#Rm(i, gs)
#output to cytobank
outFile <- "~/cytobank/test.xml"
GatingSet2cytobank(gs, outFile) |
@katdrake to take over since I'm moving on from cytobank |
@mikejiang I am going to continue this thread to report a recent development with quad gate import. Rather than producing giant rectangles, we get the following upon import into Cytobank: Here is what the error looks like close up: I have shown that this error exists in quad gates for both scatter (eg FSC x SSC) and the traditional antibody markers (eg. CD33 x CD3). I have also shown that GatingML from older versions of Cytobank do in fact import into Cytobank, shown below: I tried looking through GatingML of quad gates from old versus new versions, but it's a bit more complicated than last time. Luckily, we at least have that more descriptive error message. I am waiting to hear back from Cytobank to see if they have more insight about this error server side. I will email you the wsp, xml, and script to reproduce the error. |
@tjburns08 , I've pushed the fix, which I believe should fix the error you reported. However, I keep getting the gate plotting error when I tried to two sets of quad gates under the same parent using different dimensions. |
@tjburns08 , Never mind, I've sorted it out on my own. It has to do with the |
@mikejiang I confirm that the new quad gate architecture works on my end. I tested the new update on curly quad gate and spider gates and both are still viewed as rectangles, extending out in the southwest direction, both in FlowWorkspace and in Cytobank. I also note that for some reason, I can't get the percentages to be viewed on my end within Cytobank, though they are displayed on FlowWorkspace. I've emailed you the wsp, fcs, and xml files in the above examples. Thanks for your time. |
I am not aware that |
We can't make them directly within Cytobank, but I found that Cytobank does recognize them and display them. I can push to make this functionality possible if enough users want them. |
After import into Cytobank, quad gates from flowjo are not quad gates but instead are 4 rectangular gates. The gates are huge and their edges extend very far off axis. The statistics labels are also very far off the plot and thus not visible. In order to see the labels the gate must be dragged and resized many times, which is painful.
This issue affects other quad types in FJ such as curly quad and quad-disconnected-center. It doesn't seem to affect spider quad as badly (for this quad type, the edges extend only marginally off axis).
Should be fairly simple to adjust CytoML to not make the rectangles so large. They just need to slightly clear the scale maximum. This ensures that the gates capture all data points beyond the scale maximum, since these data points are binned at the scale maximum in Cytobank. This strategy may solve the problem with the labels without any label-specific logic, since I believe label position is set automatically based on general gate characteristics.
The text was updated successfully, but these errors were encountered: