tidyspec

Analyze spectroscopy data using tidy-data philosophy

https://github.com/marceelrf/tidyspec

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (17.0%) to scientific vocabulary

Keywords

ftir spectroscopy tidy-data
Last synced: 6 months ago · JSON representation

Repository

Analyze spectroscopy data using tidy-data philosophy

Basic Info
  • Host: GitHub
  • Owner: marceelrf
  • License: other
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 14.3 MB
Statistics
  • Stars: 7
  • Watchers: 1
  • Forks: 1
  • Open Issues: 1
  • Releases: 0
Topics
ftir spectroscopy tidy-data
Created over 3 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# tidyspec 



[![R-CMD-check](https://github.com/marceelrf/tidyspec/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/marceelrf/tidyspec/actions/workflows/R-CMD-check.yaml)
[![CRAN status](https://www.r-pkg.org/badges/version/tidyspec)](https://CRAN.R-project.org/package=tidyspec)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


The goal of **tidyspec** is to provide a friendly pipeline for spectroscopy analysis using the tidy data philosophy.

## Installation

You can install from CRAN (0.1.0):

```{r eval=FALSE}
install.packages("tidyspec")
```


You can install the development version of tidyspec from [GitHub](https://github.com/) with:

``` r
# install.packages("devtools")
devtools::install_github("marceelrf/tidyspec")
```

## About

The `tidyspec` package was design to enable the data analysis of spectroscopy data (as IR, Raman, NMR) with the tidy-data format. There are 6 families of functions in `tidyspec`, all starting with `spec_`:

- **Transformation**: Convert data from absorbance to transmittance (`spec_abs2trans`) & from transmittance to absorbance (`spec_trans2abs`).  
- **Normalize**: Normalize the data to range 0-1 (`spec_norm_01`), normalize between a custom range (`spec_norm_minmax`), or normalize to have a standard deviation of one (`spec_norm_var`).  
- **Baseline correction**: Correct the baseline using the the *rolling ball* algorithm (`spec_blc_rollingBall`) or *Rubberband* (`spec_blc_rubberband`). The function `spec_bl` return the baseline vectors (`spec_bl_rollingBall`, `spec_bl_rubberband`).
- **Smooth correction**: Smooth the data using the average window (`spec_smooth_avg`) or using the Savitzky-Golay algorithm (`spec_smooth_sga`).  
- **Derivative**: Create differential data from the spectra (`spec_diff`).  
- **Preview**: Preview your data while applying changes statically (`spec_smartplot`) or interactively (`spec_smartplotly`).

- **Import/Export**: Import spectra data from common data formats, like csv, txt, tsv, xslx and xls, with `spec_read`. Export functions will be created in next moment, but user can easily use `{readr}` or `{writexl}` functions.

The function `set_spec_wn` simplifies the use of functions by globally defining the column that contains the wave numbers. User can check the wavenumber column with `check_wn_col`.

## Example

This is a basic example which shows you how to solve a common problem:

```{r example, warning=FALSE}
library(tidyspec)
```

### The data  

```{r the data}
head(CoHAspec)
```

### Set the wavenumber column

```{r set the wavenumber column}
set_spec_wn("Wavenumber")

check_wn_col()
```

### Plot the data

```{r plot_the_data, out.width = "100%",fig.alt="Static plot", fig.dpi=300}
spec_smartplot(CoHAspec)
```

### Convert to trasmittance

```{r plot_the_data_in_transmittance, out.width = "100%",fig.alt="Transmittance plot", fig.dpi=300}
CoHAspec |>
    spec_abs2trans() |>
    spec_smartplot(type = "transmittance")
```

### Select the spectra

```{r select_the_CoHA01_data, out.width = "100%",fig.alt="CoHA01 plot", fig.dpi=300}
spec_select(CoHAspec, CoHA01) |>
  spec_smartplot(geom = "line")
```

## The future of `tidyspec`  

Our plan is for tidyspec to be the first step toward a complete ecosystem for spectral data analysis. For spectral band analysis, we are creating the [bandspec](https://github.com/marceelrf/bandspec) package that handles different band profiles. We also intend to create a package focused on producing publication-level graphics for spectral data. We haven't thought of a name yet, so we welcome suggestions!
 

Owner

  • Name: Marcel Ferreira
  • Login: marceelrf
  • Kind: user
  • Location: Itapetininga, SP
  • Company: labio-unesp

Medical physicist, Master and PhD in Biotechnology. Works on the development of tools for bone biomaterials analysis.

GitHub Events

Total
  • Issues event: 7
  • Watch event: 5
  • Issue comment event: 3
  • Push event: 38
  • Create event: 1
Last Year
  • Issues event: 7
  • Watch event: 5
  • Issue comment event: 3
  • Push event: 38
  • Create event: 1

Issues and Pull Requests

Last synced: 6 months ago

Packages

  • Total packages: 1
  • Total downloads:
    • cran 167 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 0
  • Total versions: 1
  • Total maintainers: 1
cran.r-project.org: tidyspec

Spectroscopy Analysis Using the Tidy Data Philosophy

  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 167 Last month
Rankings
Dependent packages count: 26.3%
Dependent repos count: 32.4%
Average: 48.4%
Downloads: 86.5%
Maintainers (1)
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • knitr * suggests
  • rmarkdown * suggests