Git Product home page Git Product logo

eds-handler's Introduction

A work-in-progress limited generator and parser for the .eds file format used by e.g. the ABI 7500 qPCR machines.

.eds files are actually Microsoft Office OOXML spreadsheet files, which are zip files with a bunch of XML. The weird thing is that the actual spreadsheet data is just a document with three blanks sheets. All the actual data is in the apldbio/sds directory which is not part of the MS OOXML standard. There appears to be no actual reason for these files to conform to the MS OOXML standard.

Generator

The template/ dir contains an extracted copy of a working .eds file from before the qPCR run was started. The generator modifies files from this template as indicated in the "Template modifications" section and generates a new zip file from the modified content.

const eds = require('eds-handler');

eds.generate(dirPath, filename, data, type, cb)

Where type is the output data type. It must be one of the types supported by JSZip e.g. 'nodebuffer' or 'blob'.

Parser

The parser takes a filepath or zip file data as input and outputs parsed data including metadata, Ct values and raw data.

Template modifications

plate_setup.xml

Barcode set:

<Plate><BarCode>CF06BF6I</BarCode>

Plate name set:

<Plate><Name>Some plate<Name>

Plate description set:

<Plate><Name>Generated by renegade-lims<Name>

All FeatureValue elements removed from the FeatureMap with Feature Id "sample" and re-populated with new FeatureValue elements matching plate layout.

The Index changes for each well as well as the Sample Name and Color. Color only changes for negative and positive control.

<Plate>
  <FeatureMap>
        <Feature> <!-- only once at the top of the featuremap -->
            <Id>sample</Id>
            <Name>sample</Name>
        </Feature>
        <FeatureValue>
            <Index>0</Index>
            <FeatureItem>
                <Sample>
                    <Name>NTC</Name>
                    <Color>-8076815</Color>
                </Sample>
            </FeatureItem>
        </FeatureValue>
  </FeatureMap>

All FeatureValue elements removed from the FeatureMap with Feature Id "detector-task" and re-populated with new FeatureValue elements matching plate layout.

The only changing part for each well is <Index>well index</Index>.

<Plate>
  <FeatureMap>
        <Feature> <!-- only once at the top of the featuremap -->
            <Id>sample</Id>
            <Name>sample</Name>
        </Feature>
        <FeatureValue>
            <Index>0</Index>
            <FeatureItem>
                <DetectorTaskList>
                    <DetectorTask>
                        <Task>UNKNOWN</Task>
                        <Concentration>1.0</Concentration>
                        <Detector>
                            <Name>Target 1</Name>
                            <Reporter>FAM</Reporter>
                            <Quencher>None</Quencher>
                            <Color>-7619079</Color>
                        </Detector>
                    </DetectorTask>
                    <DetectorTask>
                        <Task>UNKNOWN</Task>
                        <Concentration>1.0</Concentration>
                        <Detector>
                            <Name>Target 2</Name>
                            <Reporter>VIC</Reporter>
                            <Quencher>None</Quencher>
                            <Color>-3083422</Color>
                        </Detector>
                    </DetectorTask>
                </DetectorTaskList>>
            </FeatureItem>
        </FeatureValue>
  </FeatureMap>

experiment.xml

FileName set:

<Experiment><FileName>full path to file on disk

C:\Applied Biosystems\7500\experiments\Renegade\something.eds

Existing Samples element removed from Experiment and new Samples elements added based on plate map.

<Experiment>
    <Samples>
        <Name>NTC</Name>
        <Color>-8076815</Color>
        <Concentration>100.0</Concentration>
    </Samples>
    <Samples>
        <Name>POS</Name>
        <Color>-5701666</Color>
        <Concentration>100.0</Concentration>
    </Samples>
    <Samples>
        <Name>a368</Name>
        <Color>-2105970</Color>
        <Concentration>100.0</Concentration>
    </Samples>

analysis_protocol.xml

Remove all of the JaxbAnalysisSettings elements in the root element which have <Type>com.apldbio.sds.platform.analysis.IWellSettings</Type> and have a JaxbSettingValue with the Name "ObjectName" and the JaxbValueItem > StringValue "Target " where number is currently either 1 or 2.

Re-populate with new equivalent elements based on plate map.

<JaxbAnalysisProtocol>
    <Name>unnamed</Name>
    <JaxbAnalysisSettings>
        <Type>com.apldbio.sds.platform.analysis.IWellSettings</Type>
        <JaxbSettingValue>
            <Name>AutoBaseline</Name>
            <JaxbValueItem type="Boolean">
                <BooleanValue>false</BooleanValue>
            </JaxbValueItem>
        </JaxbSettingValue>
        <JaxbSettingValue>
            <Name>BaselineStart</Name>
            <JaxbValueItem type="Integer">
                <IntValue>3</IntValue>
            </JaxbValueItem>
        </JaxbSettingValue>
        <JaxbSettingValue>
            <Name>ObjectName</Name>
            <JaxbValueItem type="String">
                <StringValue>Target 1</StringValue>
            </JaxbValueItem>
        </JaxbSettingValue>
        <JaxbSettingValue>
            <Name>BaselineStop</Name>
            <JaxbValueItem type="Integer">
                <IntValue>15</IntValue>
            </JaxbValueItem>
        </JaxbSettingValue>
        <JaxbSettingValue>
            <Name>WellIndex</Name>
            <JaxbValueItem type="Integer">
                <IntValue>0</IntValue>
            </JaxbValueItem>
        </JaxbSettingValue>
        <JaxbSettingValue>
            <Name>UseDetectorDefaults</Name>
            <JaxbValueItem type="Boolean">
                <BooleanValue>true</BooleanValue>
            </JaxbValueItem>
        </JaxbSettingValue>
    </JaxbAnalysisSettings>

ToDo

Use browser field in package.json to ensure that e.g. the 'fs' module is not required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.