{"id":16276977,"url":"https://github.com/ramiromagno/rdml","last_synced_at":"2026-01-21T19:35:31.886Z","repository":{"id":88591280,"uuid":"81501788","full_name":"ramiromagno/rdml","owner":"ramiromagno","description":"rdml: Mathematica package for Real-Time qPCR data","archived":false,"fork":false,"pushed_at":"2017-06-13T08:14:11.000Z","size":2063,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T17:19:04.863Z","etag":null,"topics":["biology-lab-protocols","mathematica","pcr","qpcr","rdml","wolfram"],"latest_commit_sha":null,"homepage":null,"language":"Mathematica","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ramiromagno.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2017-02-09T22:35:27.000Z","updated_at":"2021-07-04T16:10:43.000Z","dependencies_parsed_at":null,"dependency_job_id":"42ecdbb7-25ac-4d10-a50d-8b4d767794bc","html_url":"https://github.com/ramiromagno/rdml","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ramiromagno/rdml","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramiromagno%2Frdml","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramiromagno%2Frdml/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramiromagno%2Frdml/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramiromagno%2Frdml/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ramiromagno","download_url":"https://codeload.github.com/ramiromagno/rdml/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ramiromagno%2Frdml/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28641276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-21T18:04:35.752Z","status":"ssl_error","status_checked_at":"2026-01-21T18:03:55.054Z","response_time":86,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["biology-lab-protocols","mathematica","pcr","qpcr","rdml","wolfram"],"created_at":"2024-10-10T18:51:41.102Z","updated_at":"2026-01-21T19:35:31.869Z","avatar_url":"https://github.com/ramiromagno.png","language":"Mathematica","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rdml: Mathematica package for Real-Time qPCR data\n\n![](math_rdml_logo.png)\n\n\n\n## Overview\n\nThe *rdml* importer is an open source [Wolfram](https://en.wikipedia.org/wiki/Wolfram_Language) package that allows the validation and import of the standard  [RDML](http://rdml.org) files generated by most of the widely used qPCR equipments.\n\nThis package makes qPCR data, and all of its experimental settings, readily available to [Mathematica](https://en.wikipedia.org/wiki/Wolfram_Mathematica) users without the additional burden of becoming familiarized with the RDML schema and having to learn new package-specific functions.\n\nThe files from this repository you will need to have a working package are:\n\n1. Package: `rdml.m`;\n2. XML schema: `RDML_v1_2_REC.xsd`, from [RDML schema version 1.2](http://rdml.org/RDML_v1_2_REC.xsd);\n3. Documentation notebook: `RDML_doc.nb`.\n\nExample dataset files that accompany this package can be found in the folder *./datasets*:\n\n1. `1507AA03.rdml`, downloaded from the [RDML Consortium database](http://rdmldb.org/);\n2. `QPCRCourseApril2015_plate_1_.rdml`, from [Ruijter et al., 2015](http://dx.doi.org/10.1016/j.bdq.2015.07.001) but downloaded from [HFRC, AMC, the Netherlands](http://www.hartfaalcentrum.nl/index.php?main=files\u0026sub=0);\n3. `rdml_data.xml`, resultant file from unzipping `QPCRCourseApril2015_plate_1_.rdml`;\n4. `rpa.rdml`, courtesy of [Raquel P. Andrade Lab, CBMR, Portugal](http://cbmr.ualg.pt/research/stemcelldevelop/temporal-control-laboratory/).\n\n## Citing this work\n\n[Magno R, Duarte, I, Andrade, RP, Palmeirim, I. rdml: A Mathematica package for parsing and importing Real-Time qPCR data. BMC Research Notes. 2017; 10:208.](https://dx.doi.org/10.1186/s13104-017-2533-9)\n\n## Basic usage\n\n### Loading the package\n\nMake sure that `rdml.m` is in your current working directory (if not, specify the path).\n\nThen, to load the package, simply run:\n\n```\nGet[\"rdml.m\"]\n```\n\n### Documentation\n\nOnce you have loaded the package you may access the documentation notebook via the function:\n\n```\nHelpPageRDML[]\n```\n\n### Importing RDML data\n\nNow, the builtin `Import` function should be overloaded to work with `.rdml` and `.rdm` files.\n\nTry importing one of the example data files (found in the *datasets* folder). For example `rpa.rdml`:\n\n```\nrdml_data = Import[\"datasets/rpa.rdml\"]\n```\n\n![](readme-images/README-import.png)\n\nThe data becomes then available as a `Dataset` object, on which all the recently expanded query functionalities of Mathematica can be be applied. For more information on how to take advantage of the new data query language check [Computation with Structured Datasets](http://reference.wolfram.com/language/guide/ComputationWithStructuredDatasets.html).\n\n## RDML Schema version\n\nThe package is fully compatible with RDML version 1.2, and partially backwards compatible with versions 1.0 and 1.1.\n\n## RDML-related Import options\n\n| Option             | Default value | Description                                                   |\n|--------------------|---------------|---------------------------------------------------------------|\n| ValidateAgainstXSD | False         | whether to validate file against RDML schema before importing |\n| Compressed         | Automatic     | whether to assume that the file is a compressed archive       |\n| Dataset            | True          | whether to return a Dataset structure expression              |\n\n### ValidateAgainstXSD option\n\nThe RDML Consortium defined a XML Schema (XSD) for the RDML standard. The importer presented here fully supports currently the most recent version 1.2 (`RDML_v1_2_REC.xsd`). By default, the importer will not attempt to validate the file against the XML schema. If the file to be imported is not compliant with version 1.2, it will still attempt to import inasmuch as it is compatible with version 1.2.\n\nHowever, to check if the file to be imported complies with the XML Schema, set the option `\"ValidateAgainstXSD\"-\u003eTrue`. If the file fails to be validated, a warning is issued and `Import` returns `$Failed`.\n\n```\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\",  \"ValidateAgainstXSD\" -\u003e True]\n```\n\n![](readme-images/README-ValidateXSD-1.png)\n\nConversely, if no errors are detected, the data is simply returned:\n\n```\nImport[\"datasets/rpa.rdml\", \"ValidateAgainstXSD\" -\u003e True]\n```\n\n![](readme-images/README-import.png)\n\nFrequently, RDML files do not fully comply with the XML Schema yet the errors are relatively minor. The importer will try to import as much as it can given the Schema, being flexible where it can.\n\n```\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\",  \"ValidateAgainstXSD\" -\u003e False]\n```\n![](readme-images/README-Validate-2.png)\n\n\n### Compressed option\n\nAccording to the RDML Consortium guidelines, the XML file containing the RDML compliant data should be stored in a file named `rdml_data.xml`. This file should be compressed into a *pkzip* compatible archive. The archive can be freely named, however instead of holding the *.zip* extension, it should hold the *.rdml* (preferably) or *.rdm* extension. In addition, RDML compatible software should be able to read compressed *.rdml* or *.rdm* files, as well as uncompressed *.xml* files.\n\nBy default the importer tries to determine if the file is compressed or not (default option `\"Compressed\"-\u003eAutomatic`) by checking if the first two bytes of the file correspond to the ASCII string `\"PK\"`.\n\nFor instance, if you'd want to manually check if some file is a *pkzip* compatible archive, you could run:\n\n```\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\", {\"Byte\", {1, 2}}] // FromCharacterCode\n```\n\nthat should return `PK`.\n\nBy default, the importer will automatically determine the file compression status and import accordingly.\n\nThe following three `Import` calls are all equivalent for a compressed RDML file:\n\n```\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\"]\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\", \"Compressed\" -\u003e Automatic]\nImport[\"datasets/QPCRCourseApril2015_plate_1_.rdml\", \"Compressed\" -\u003e True]\n```\n\n![](readme-images/README-Validate-3.png)\n\n\nExplicitly forcing the importer to assume that the file is not compressed (when it actually is) will result in `$Failed` with XML-related parsing errors:\n\n![](readme-images/README-compress.png)\n\nThe importer will run smoothly on an uncompressed file (`rdml_data.xml` is `QPCRCourseApril2015_plate _ 1_. rdml` uncompressed).\n\n```\n(* All equivalent *)\nImport[\"datasets/rdml_data.xml\", \"RDML\", \"Compressed\" -\u003e False]\nImport[\"datasets/rdml_data.xml\", \"RDML\", \"Compressed\" -\u003e Automatic]\nImport[\"datasets/rdml_data.xml\", \"RDML\"]\n```\n\n![](readme-images/README-compress-2.png)\n\nIf the file extension is not *.rdml* or *.rdm*, then the file type is mandatory, otherwise `Import` will read the input file as XML and return a `XMLObject` expression:\n\n```\nImport[\"datasets/rdml_data.xml\"]\n```\n\n![](readme-images/README-compress-3.png)\n\n### Dataset option\n\nBy default, the expression returned after import is a `Dataset` expression. Setting `\"Dataset\"-\u003e False` returns the underlying RDML data explicitly as a nested structure of associations and lists.\n\n![](readme-images/README-dataset.png)\n\n## RDML structure quick overview\n\nLets import some RDML data first:\n\n```\nrpa = Import[\"datasets/rpa.rdml\"]\n```\n\nTo check top elements in the hierarchy:\n\n```\nKeys[rpa] // Normal\n```\n![](readme-images/README-keys.png)\n\n\n### version\n\nThe `version` element indicates the RDML Schema version of the file. This element can be easily retrieved from the `Dataset` object:\n\n```\nrpa[\"version\"]\n```\nor directly extracted when importing:\n\n```\nImport[\"datasets/rpa.rdml\", {\"RDML\", \"version\"}]\n```\n\nSince its release, the RDML standard has been revised twice: versions 1.1 and 1.2. Although this importer has been designed to fully support version 1.2, in practice, since version 1.2 Schema specification significantly overlaps with previous versions, this package can import RDML files from those previous versions (to the extent that they overlap with version 1.2).\n\nImporting files from versions other than 1.2 results in a warning, yet most data is often successfully imported.\n\n![](readme-images/README-version.png)\n\n## dateMade and dateUpdated\n\nThe element `dateMade` indicates the date and time stamp of the creation of the file. The element `dateUpdated` indicates the date and time stamp of the last update of the file.\n\n```\nrpa[\"dateMade\"]\nrpa[\"dateUpdated\"]\n```\n\n## id\n\nUse the `id` element to show all ids. Each id can be used to assign a publisher and a serial number to the RDML file. Additionally, an MD5Hash can also be included.\n\n```\nrpa[\"id\"]\n```\n\n## experimenter\nThe `experimenter` element contains a list of researchers and their info (in this case only one):\n\n```\nrpa[\"experimenter\"]\n```\n\n![](readme-images/README-experimenter.png)\n\nInternally this is represented as an `Association`. The key in this `Association` corresponds to the XML id attribute from the original RDML file, which can be used by other elements to link here:\n\n![](readme-images/README-experimenter-2.png)\n\nTo retrieve all information related to one particular experimenter, one can either use the key (XML id) or simply pick out the corresponding part:\n\n![](readme-images/README-experimenter-3.png)\n\n## documentation\n\nThe documentation element constitutes the multi-purpose documentation system from the RDML file. This element is a text field with an unique id (translated to a key in an `Association`).\n\nFrom many places in the RDML file, a reference can be made to these documentation elements, making it versatile and allowing the free annotation of the elements.\n\nTo retrieve all `documentation` elements:\n\n```\nrpa[\"documentation\"]\n```\nIn this file there is only one such element, whose contents pertain to the genome assembly version used to retrieve the genomic information on the HoxB gene cluster:\n\n```\nrpa[\"documentation\", 1]\n```\n\nWhose text subelement contains:\n\n```\nrpa[\"documentation\", 1, \"text\"]\n```\n\n```\n\"The genomic information for the HoxB cluster is based on the Gallus gallus (chick) genome assembly version 2.1 (WASHUC2), as performed by the Genome Sequencing Center (http://genome.wustl.edu) at the Washington University School of Medicine, St. Louis.\"\n```\n\n## dye\n\nThe `dye` element contains information regarding the fluorescent chemical compounds used as dyes for the real-time monitoring of the qPCR reaction.\n\nTo show all dyes:\n\n![](readme-images/README-dye.png)\n\n\n## sample\n\nThe sample element contains all samples used. It may describe standard samples used in a dilution series, but it will often describe different biological sources and/or conditions/treatments performed on biological material.\n\nTo inspect the different samples:\n\n```\nrpa[\"sample\"]\n```\n\n![](readme-images/README-sample.png)\n\nCheck information associated with one particular sample, e.g. `\"R-MoH9\"`:\n\n```\nrpa[\"sample\", \"R-MoH9\"]\n```\n![](readme-images/README-sample-2.png)\n\nEach sample can have a type: *unkn* (unknown sample), *ntc* (non template control), *nac* (no amplification control), *std* (standard sample), *ntp* (no target present), *nrt* (minusRT, negative for Reverse Transcription), *pos* (positive control) or *opt* (optical calibrator sample).\n\n```\nrpa[\"sample\", All, \"type\"]\n```\n\n![](readme-images/README-sample-3.png)\n\nInspect the description of all samples:\n\n```\nrpa[\"sample\", All, \"description\"]\n```\n\n## target\n\nThe `target` element contains all targets. A target is defined by the primer (and probe) mix added to the sample to specifically amplify the target sequence (amplicon).\n\n```\nrpa[\"target\"]\n```\n![](readme-images/README-target.png)\n\nExamine all amplicon sequences:\n\n```\nrpa[\"target\", All, \"sequences\", \"amplicon\", \"sequence\"]\n```\n![](readme-images/README-target-2.png)\n\nInspect the forward and reverse primers:\n\n```\nrpa[\"target\", All, \"sequences\", {\"forwardPrimer\", \"reversePrimer\"},   \"sequence\"] // Dataset\n```\n\n![](readme-images/README-target-3.png)\n\nThe `xRef` subelement relates the targets to an external database:\n\n```\nrpa[\"target\", All, \"xRef\", 1]\n```\n![](readme-images/README-target-4.png)\n\n## thermalCyclingConditions\n\nThe `thermalCyclingConditions` element describes the temperature and time steps taken by a thermocycler in order to amplify the DNA. It can be used to describe alternative cycling programs (e.g., a regular PCR or a cDNA synthesis program).\n\nShow the temperature protocol description:\n\n```\nrpa[\"thermalCyclingConditions\", 1, \"description\"]\n```\n\n![](readme-images/README-thermal.png)\n\nExamine the various steps that compose the actual program:\n\n```\nrpa[\"thermalCyclingConditions\", 1, \"step\"]\n\n```\n\n![](readme-images/README-thermal-2.png)\n\n## experiment\n\nThe `experiment` element contains the data collected during one (or more) qPCR runs, where each run contains one or more qPCR reactions. Each reaction incorporates one sample (which is referred to by its id) and one or more data elements (one for each target (also referred by its id)). Multiple data elements are only required for a multiplex reaction, in which several targets are simultaneously measured (using different fluorescent dyes). If the reactions are measured in different runs, the data should be stored as separate runs.\n\nCheck the first `run` in the `experiment` element:\n\n```\nrpa[\"experiment\", 1, \"run\", 1]\n```\n![](readme-images/README-experiment.png)\n\nThis run holds various details, including specifics about the hardware (instrument element) as well as details about the software that collected the data (`dataColletionSoftware`); `documentation`, `experimenter` and `thermalCyclingConditions` elements should have id references to elements previously defined. The `backgroundDeterminationMethod` and `cqDetectionMethod` elements include relevant information about the mathematical analysis of the qPCR amplification curves. The `pcrFormat` element allows downstream analysis software to display the data according to the qPCR instrument run format. Finally, the `react` element contains the actual data pertaining to the qPCR reactions, containing a list of qPCR reactions, each consisting of two subelements: `sample` and `data`.\n\n```\nrpa[\"experiment\", 1, \"run\", 1, \"react\"]\n```\n\n![](readme-images/README-react.png)\n\nExamine the summary of `cq` values for all reactions of sample `\"R-MoH9\"`:\n\n![](readme-images/README-cq.png)\n\nThe `adp` and `mdp` subelements contain the amplification and melting data, respectively.\n\nPlot amplification curves for all reactions of sample `\"R-MoH9\"`:\n\n```\namplificationData[\"R-MoH9\"] = rpa[\"experiment\", 1, \"run\", 1, \"react\",\n   Select[#sample == \"R-MoH9\" \u0026], \"data\", 1, \"adp\", All, {\"cyc\", \"fluor\"}];\n```\n\n```\nListPlot[amplificationData[\"R-MoH9\"], Joined -\u003e True, Frame -\u003e True, PlotLabel -\u003e \"Amplification curves of R-MoH9 reactions\",\n FrameLabel -\u003e {\"Temperature (Celsius degrees)\",\n   \"Fluorescence (a.u)\"}]\n```\n![](readme-images/README-amplification.png)\n\nPlot melting curves for all reactions of sample `\"R-MoH9\"`:\n\n```\nmeltingData[\"R-MoH9\"] = rpa[\"experiment\", 1, \"run\", 1, \"react\", Select[#sample == \"R-MoH9\" \u0026], \"data\", 1, \"mdp\", All, {\"tmp\", \"fluor\"}];\n```\n\n![](readme-images/README-melting.png)\n\nTo highlight the melting temperature, calculate the negative of the derivative of the fluorescence with respect to temperature:\n\n```\nmeltingData2[\"R-MoH9\"] = Values /@ meltingData[\"R-MoH9\"] // Normal // Values;\n```\n\n```\ninterpolatedMeltingData[\"R-MoH9\"] = Interpolation /@ meltingData2[\"R-MoH9\"];\n```\n\n```\ninterpolatedDerMeltingData[\"R-MoH9\"] = (-D[#[t], t]) \u0026 /@ interpolatedMeltingData[\"R-MoH9\"];\n```\n\n```\nPlot[interpolatedDerMeltingData[\"R-MoH9\"], {t, 65, 95}, PlotRange -\u003e All, Frame -\u003e True, FrameLabel -\u003e {\"Temperature (Celsius degrees)\", \"-dfluor/dT\"}]\n```\n\n![](readme-images/README-melting2.png)\n\n### Keep calm and carry on  :)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framiromagno%2Frdml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Framiromagno%2Frdml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Framiromagno%2Frdml/lists"}