SofieVG / FlowSOM

Using self-organizing maps for visualization and interpretation of cytometry data
61 stars 26 forks source link

importing the gating workspace from flowJo as .xml file in order to work in flowSOM #1

Open anaraserikbek opened 8 years ago

anaraserikbek commented 8 years ago

Hi, I've been exploring FlowSOM and had a problem when exporting .xml. I've tried several ways:

SofieVG commented 8 years ago

Hi,

The parseGatingML function is added in the latest version of the package, so it's certainly possible that it still contains some bugs. However, I wondered how you get your xml file? It should be generated by FlowJo X (the beta version generates these files automatically when I save my workspace, before that, I saved my experiment as ".acs" to get the gatingML files from that. The FlowJo 9 xml files are not compatible.

If you have another way of importing your gating (e.g. because you generated it some other way and you know of a different package which can handle it), it's good to know that the PlotPies function just requires a vector containing a label for each cell. So if you can generate this vector in some other way, you should still be able to map it onto your FlowSOM trees.

If needed, you can also email me how you extracted your xml file and the xml file itself, so I can figure out what's going on.

Thank you for your comment!

anaraserikbek commented 8 years ago

Hi Sophie, Thank you for your clarification. I actually use FlowJo 10, and yes, indeed we've used FlowJo 9 as well to try to export the gating template as an .xml file and it didn't work as you're saying. But, in flowJo 10 I tried several methods: 1) Configure=>Power=>Diagnostics=>Show XML for selected Workspace=>and then I save the xml code in text file in .xml format. and from this method I received the above error;

Other methods I've also tried (including exporting it as wsp file) & I also tried to save my experiemtn as .acs file as you suggested. However, I receive the following error when I try directly working with this .acs file in FlowSOM: Error: 1: Start tag expected, '<' not found Could you explain me if you use the saved .acs file straight away or you wrote that you "... get the gatingML files from that..." and how exactly do you do that? Because when i save it as .acs file, the file is saved in *****.xml.acs format. is that normal?

Thank you in advance p.s. unfortunately i haven't been able to attach my .xml.acs file since github doesn't support it, but I can send it via email, if you provide me your email

SofieVG commented 8 years ago

No, I think the xml flowjo shows you is the whole workspace and not the file specific gatingML files. You can either unzip the acs and get the gatingML files from that (they will have the name from the workspace + the name from the file + _gates.xml I think), or you can check the following link: http://docs.flowjo.com/vx/setting-your-preferences/workspace/prefs-gates/

In the gate preferences, "Use Gating-ML conventions" is selected for me, and these files get automatically created in the same folder as the wsp (without needing to create a acs)

You can reach me sofie.vangassen@removethis.ugent.be if you want me to check a specific file.

anaraserikbek commented 8 years ago

Thank you once more Sophie. I've been able to get the gating file by choosing "Use Gating-ML conventions" & I'm really glad since I've been trying to do it for some time & now will be able to use this gating template. However, when I read the gating template through read.gatingML, I get this error: Error in meanList[[1]]: subscript out of bounds When I do traceback(). I can see the following my code: gatingFile=system.file("extdata","FlowSOMgate.xml_AV 10-1974 P1_gates.xml",package="FlowSOM") read.gatingML(gatingFile,flowEnv)

traceback() 6: getParameters(meanList[[1]]) 5: identifyNode(node, flowEnv) 4: identifyNode(node, flowEnv) 3: parseGatingML(xmlRoot(smartTreeParse(file, ...)), flowEnv) 2: parseGatingML(xmlRoot(smartTreeParse(file, ...)), flowEnv) 1: read.gatingML(gatingFile, flowEnv) Does this mean that the gating template does not have enough gates in order to read it? or what is the read.gatingML function trying to access in the matrix form that doesn't exist in the gating.xml file? I have tried to send my .xml file to you through anara92@bu.edu email address & for some reason, it failed. i resent it, but got the same message. maybe the email address is incorrect?

anaraserikbek commented 8 years ago

Hi, Sophie, I was wondering if you could provide me the correct email address so that I sent you the .xml template that I've used to see if it is working for you? And also to know what this error means in terms of meanList bounds.

SofieVG commented 8 years ago

You probably want to define the gatingfile as gatingFile = "FlowSOMgate.xml_AV 10-1974 P1_gates.xml" if it is saved in your current working directory, or otherwise with the path to the file added. The code from the documentation is specifically to load a file which is attached to the package. I'm not sure this is causing the problem though.

Please don't forget to remove the "removethis." from the email address I provided if you try to contact me, I guess this is the reason your previous emails would not send.