RGLab / CytoML

A GatingML Interface for Cross Platform Cytometry Data Sharing
GNU Affero General Public License v3.0
30 stars 14 forks source link

CytoML Xml File Parsing Issues #137

Open upatel2 opened 3 years ago

upatel2 commented 3 years ago

Hi,

I am working closely with .xml and .fcs files for research regarding extracting gates from a particular XML file.

I have followed your tutorial on GitHub regarding parsing a DIVA workspace file (i.e., extdata/diva/PE_2.xml) and it seems to work fine for me. However, when I try to parse a local XML file that I have on my local drive, I get this error:

Diva Workspace Version Version 8.0.1 File location: . File name: Patient4Template.xml Workspace is open.

Groups in Workspace Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

I am not sure why I am getting this error and I can't seem to solve this particular issue.

Also, I wanted to ask another question regarding how your XML file has the correlated FCS file details. The XML file I have does not contain any fcs file detail, so is it still possible to extract gates from it? Or is that not possible?

It would be great if you can help me with understanding the issue I am having.

Thank You very much, Utsav

mikejiang commented 3 years ago

diva_to_gatingset function has an argument worksheet , can be set to either "normal" or "global". The latter use the global worksheet as the template, thus doesn't require fcs info.

upatel2 commented 3 years ago

@mikejiang Thank you for clarifying that. I was actually also encountering another issue. I am not sure whether this is due to my XML file or whether it is about errors in my code.

library(flowWorkspace) library(flowWorkspaceData) library(CytoML) workspace <- ('C:/Users/utsav/Documents/Patient4Template.xml') qw <- open_diva_xml(workspace) qw Diva Workspace Version Version 8.0.1 File location: C:/Users/utsav/Documents File name: Patient4Template.xml Workspace is open.

Groups in Workspace Error in names(x) <- value : 'names' attribute [2] must be the same length as the vector [1]

Are you able to please help me find a way through this?

Thank You!

mikejiang commented 3 years ago

Please provide a reproducible example for me to troubleshoot

upatel2 commented 3 years ago

@mikejiang Hi Mike,

As the file I am working with is for research, I have asked my supervisors if I can send this to you. Should they respond yes, I can email it to you.

Can you please share your email until I wait for their response?

Thank You!

mikejiang commented 3 years ago

mike@ozette.ai

mikejiang commented 3 years ago

sorry it took a while for me to get back to you. Looks like the current diva parser does require the normal worksheet that is associated with some fcs file to be present in order to proceed the global template worksheet parsing. i.e. it expects something like image and yours seem to be the pure template that doesn't have data_filename field.

I am not sure if we have the bandwidth or resource to add this support. The workaround for you is to create some dummy normal worksheet to associate with one fcs in diva software and then re-export the xml so that diva parser will not error out.

upatel2 commented 3 years ago
Hi Mike,  Thank you for your response.  Although, I don’t fully understand what you are trying to say.  From what I understand, you want us to add the code below into the xml file (with the relevant fcs filename attached inside the xml) I sent you and then try to parse it?  I am trying to get my mind around this but it seems to be quite difficult for me to understand. It would be great of you could please provide some clarification. For you understanding, I have also CC’d my supervisor Dr. Kennedy so that he also has an idea.  If you have any concerns, please let me know.  Thank You, Utsav Patel  From: Mike JiangSent: Sunday, 17 October 2021 5:17 AMTo: RGLab/CytoMLCc: upatel2; AuthorSubject: Re: [RGLab/CytoML] CytoML Xml File Parsing Issues (#137) sorry it took a while for me to get back to you. Looks like the current diva parser does require the normal worksheet that is associated with some fcs file to be present in order to proceed the global template worksheet parsing.i.e. it expects something likeand yours seem to be the pure template that doesn't have data_filename field.I am not sure if we have the bandwidth or resource to add this support. The workaround for you is to create some dummy normal worksheet to associate with one fcs so that diva parser will not error out.—You are receiving this because you authored the thread.Reply to this email directly, view it on GitHub, or unsubscribe.Triage notifications on the go with GitHub Mobile for iOS or Android.  
mikejiang commented 3 years ago

No. You don't want to manually edit this XML. This file is supposed to be generated and exported from diva software. What you need to do is to use diva software to recreate the analysis by adding both global and normal worksheet the normal worksheet should be associated with a particular fcs file.So that this will get our diva parser working properly. But real gates can be still stored in global worksheet as a template