---
title: "Capillary Electrophoresis JSON-LD"
author: "Erika Imada Barcelos, Laura S. Bruckman, Roger H. French"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Capillary Electrophoresis JSON-LD}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

Capillary Electrophoresis JSON-LD Description
-----------------------------------
Capillary Electrophoresis (CE) is a separation  method in which ions are separated based on their ionic charge and  electrophoretic mobility using an applied voltage. 
One of the main advantages of CE is the usage of lower sample volumes compared to traditional separation methods, such as high performance liquid chromatography (HPLC).

In a CE experiment, ions in a sample are separated according to their mobility which is translated into a chromatogram, where  the time the ions take to go through the capillary and  detector signal ( absorbance) is captured and recorded. Sample information as well as the experimental metadata and separation results(absorbance and time) are important variables in this experiment.  

Capillary Eletrophoresis is a type of Electrophoresis method. In CE JSON-LD, the experiment is defined by the experimental metadata, which encompasses information regarding the experimental procedure itself. Some examples are the buffer ph, buffer composition, capillary length etc.
As important as the experiment metadata is the information about the sample to be analysed, which includes the analyte properties and identification. The results are defined based on the absorbance and time on the ions that are separated  in the same.



Creating JSON-LD for CE in R
------------------------------------------
```{r, message=FALSE, eval=FALSE}
library(FAIRmaterials)

# An example data frame for CE
CE_exp <- data.frame(
  'bufferpH' = c('7.4', '6.8'),
  'appliedVoltage' = c('26', '30'),
  'columnTemperature' = c('50C', '60C'),
  'capillaryLength' = c('15cm', '30cm'),
  'capillaryMaterial' = c('silica', 'polyacrylamide')
)

# This will generate JSON-LD file for the example data
output <- fairify_data(CE_exp, domain = 'CapillaryElectrophoresis', saveLocal = TRUE)
```

Creating JSON-LD for CE in Python
------------------------------------------
```{python, eval = FALSE, python.reticulate = FALSE}
from fairmaterials.fairify_data import *
import pandas as pd

# An example data frame for CE
CE_exp = pd.DataFrame  ('bufferpH' = [7.4, 6.8],
  'appliedVoltage' = [26, 30],
  'columnTemperature' = [50, 60],
  'capillaryLength' = [15, 30],
  'capillaryMaterial' = ['silica', 'polyacrylamide'])

# This will generate JSON-LD file for the example data
output <- fairify_data(CE_exp, domain = 'CapillaryElectrophoresis')
```


CE Formulations schema diagram
--------------------------

```{r, out.width="1200px", echo=FALSE, fig.cap="CE Formulations schema diagram"}
knitr::include_graphics("capillaryElectrophoresis.png")
```

References
--------------------------

https://chem.libretexts.org/Bookshelves/Analytical_Chemistry/Supplemental_Modules_(Analytical_Chemistry)/Instrumentation_and_Analysis/Capillary_Electrophoresis,
https://www.shsu.edu/~chm_tgc/primers/pdf/CE.pdf

Acknowledgment
--------------------------
This material is based upon work in the CASFER National Science Foundation (NSF) Engineering Research Center under the  under Grant No 2133576 sub award 21P735-03

