PCRuniversum / RDML

RDML data import for R
Other
21 stars 8 forks source link

RDML$new assertion error NA #34

Closed epruesse closed 2 years ago

epruesse commented 2 years ago

I am getting the same assertion violation as described in #28:

Error in (function (cq)  : Assertion on 'cq' failed: May not be NA.

The RDML should parse OK. As you can see below, the <cq>NaN</cq> tag appears legitimately when a reaction did not amplify at all (e.g. a negative test).

[...]
            <react id="1">
                <sample id="mysample1"/>
                <data>
                    <tar id="the_target"/>
                    <cq>NaN</cq>
                    <adp>
                        <cyc>1.0</cyc>
                        <fluor>0.045274403</fluor>
                    </adp>                    
[...]
                    <adp>
                        <cyc>45.0</cyc>
                        <fluor>-0.013826137</fluor>
                    </adp>
[...]
            <react id="86">
                <sample id="mysample1"/>
                <data>
                    <tar id="the_positive_control"/>
                    <cq>26.96937</cq>
                    <adp>
                        <cyc>1.0</cyc>
                        <fluor>0.01319422</fluor>
                    </adp>
[...]
                    <adp>
                        <cyc>25.0</cyc>
                        <fluor>0.090496756</fluor>
                    </adp>
                    <adp>
                        <cyc>26.0</cyc>
                        <fluor>0.13862325</fluor>
                    </adp>
kablag commented 2 years ago

As I mention in #28 this is not RDML package problem because it is standard violation image You can see that Cq can't be NaN. For NA case it should be -1.0 . But I can remove such testing.

epruesse commented 2 years ago

The files are from a current Thermofisher Quantstudio 7 Pro. I had assumed they'd implemented the standard correctly. Sad.

Perhaps add a lenient/non-strict mode for standard violations that still result in an unambiguous interpretation. In this case, converting NaN to -1.

kablag commented 2 years ago

ok. I'll convert NA and NaN to -1. But it can cause problems in future calculation - for example mean cq. Maybe convert NaN to NA?