Title: | Cleans Spectrophotometry Data Obtained from the Denovix DS-11 Instrument |
---|---|
Description: | Cleans spectrophotometry data obtained from the Denovix instrument. The package also provides an option to normalize the data in order to compare the quality of the samples obtained. |
Authors: | Tingwei Adeck [aut, cre] |
Maintainer: | Tingwei Adeck <[email protected]> |
License: | MIT + file LICENSE |
Version: | 2.1.0 |
Built: | 2025-03-11 05:31:48 UTC |
Source: | https://github.com/alphaprime7/tidydenovix |
Title: Extract key colnames from the Denovix data frame
extract_col_names(xdf)
extract_col_names(xdf)
xdf |
The data frame for colname(s) extraction. |
A vector of key column names.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') col_names = extract_col_names(rna_data)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') col_names = extract_col_names(rna_data)
Title: Extract sample names from the Denovix data frame
extract_sample_names(dfile, file_type = NULL)
extract_sample_names(dfile, file_type = NULL)
dfile |
The denovix raw file for sample name(s) extraction. |
file_type |
The type of file. |
A vector of sample names.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) esn = extract_sample_names(fpath, file_type = 'csv')
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) esn = extract_sample_names(fpath, file_type = 'csv')
Title: Extract wavelength
extract_wavelength(xdf)
extract_wavelength(xdf)
xdf |
The original data frame derived from importing Denovix data. |
A numeric data frame for the wavelength attribute.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') wl = extract_wavelength(rna_data)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') wl = extract_wavelength(rna_data)
Title: File Extension Finder
file_ext(epath)
file_ext(epath)
epath |
File path. |
A string representing the file extension.
Unknown (Adapted by Tingwei Adeck)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) ext = file_ext(fpath)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) ext = file_ext(fpath)
Title: Wavelength quality control
lambda_check( qdf, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax") )
lambda_check( qdf, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax") )
qdf |
A data frame with quality attributes. |
sample_type |
The type of sample under investigation. |
check_level |
The level of strictness based on sample type. |
A data frame that meets the quality check criteria.
Some key assumptions are made about quality for RNA or DNA. At the moment column names is the main issue found with using this approach.
Tingwei Adeck
Other lambda:
lambda_check_source()
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_check = lambda_check(rna_data,sample_type='RNA',check_level='lax')
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_check = lambda_check(rna_data,sample_type='RNA',check_level='lax')
Title: Wavelength quality control
lambda_check_source( odf, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax") )
lambda_check_source( odf, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax") )
odf |
A data frame with quality attributes. |
sample_type |
The type of sample under investigation. |
check_level |
The level of strictness based on sample type. |
A vector of sample names for the different QC criteria.
Some key assumptions are made about quality for RNA or DNA. At the moment column names is the main issue found with using this approach.
Tingwei Adeck
Other lambda:
lambda_check()
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_check = lambda_check_source(rna_data,sample_type='RNA',check_level='lax')
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_check = lambda_check_source(rna_data,sample_type='RNA',check_level='lax')
Title: Make wavelength
make_wavelength()
make_wavelength()
A numeric data frame for the wavelength attribute.
Tingwei Adeck
wl = make_wavelength()
wl = make_wavelength()
Title: Min-Max normalization of attributes that require normalization
min_max_norm(x)
min_max_norm(x)
x |
A single value from an attribute passed in the function for normalization. |
A normalized value (value between 1 and 0)
lapply is needed to apply the function across several columns in a data set.
Tingwei Adeck (Adapted from Statology)
https://www.statology.org/how-to-normalize-data-in-r/
test_df <- as.data.frame(c(seq(40))) colnames(test_df) <- "test" test_df_norm <- lapply(test_df[1:ncol(test_df)], min_max_norm)
test_df <- as.data.frame(c(seq(40))) colnames(test_df) <- "test" test_df_norm <- lapply(test_df[1:ncol(test_df)], min_max_norm)
Title: Quality Control data frame
qc_attributes(dfile, file_type = NULL, xdf)
qc_attributes(dfile, file_type = NULL, xdf)
dfile |
The Denovix file path. |
file_type |
The type of file. |
xdf |
The Denovix data frame. |
A quality control data frame.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_attributes = qc_attributes(fpath, file_type = 'csv', rna_data)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv') qc_attributes = qc_attributes(fpath, file_type = 'csv', rna_data)
A function read Denovix data files.
read_denovix(dfile)
read_denovix(dfile)
dfile |
A Denovix file or path to the Denovix file. |
A data frame.
Denovix files can be saved as csv, txt or even excel files. This function accounts for these file types.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix(fpath)
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix(fpath)
A function read Denovix data files.
read_denovix_data(dfile, file_type = c("csv", "txt", "excel"))
read_denovix_data(dfile, file_type = c("csv", "txt", "excel"))
dfile |
A Denovix file or path to the Denovix file. |
file_type |
The file type being imported. |
A data frame.
Denovix files can be saved as csv, txt or even excel files. This function accounts for these file types.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv')
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = read_denovix_data(fpath, file_type = 'csv')
Title: Enum function
REnum(elist)
REnum(elist)
elist |
A list with variable binding. |
The list supplied by the user.
Tingwei Adeck
cols = list('x260' = 1, 'x280' = 2, 'x230' = 3) qc = REnum(cols) a = (qc$x260)
cols = list('x260' = 1, 'x280' = 2, 'x230' = 3) qc = REnum(cols) a = (qc$x260)
An excel file version of the Denovix Spectrophotometry data.
rna1
rna1
An object of class tbl_df
(inherits from tbl
, data.frame
) with 14 rows and 151 columns.
A csv file version of the Denovix Spectrophotometry data.
rna2
rna2
An object of class data.frame
with 15 rows and 151 columns.
A csv file version of the Denovix Spectrophotometry data.
rna3
rna3
An object of class data.frame
with 15 rows and 152 columns.
A txt file version of the Denovix Spectrophotometry data.
spec
spec
An object of class data.frame
with 15 rows and 151 columns.
Title: Clean data from the Denovix DS-11 instrument
tidyDenovix( dfile, file_type = NULL, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax"), qc_omit = NULL, normalized = c("yes", "no"), fun = NA )
tidyDenovix( dfile, file_type = NULL, sample_type = c("RNA", "DNA"), check_level = c("strict", "lax"), qc_omit = NULL, normalized = c("yes", "no"), fun = NA )
dfile |
The raw file obtained from the machine. |
file_type |
The file type specification. |
sample_type |
The sample type specification used in quality control. |
check_level |
The level of quality control performed. |
qc_omit |
Takes 'yes' or 'no' and determines if the qc data would be provided. |
normalized |
Takes 'yes' or 'no'. |
fun |
A parameter used for boolean expressions. |
A cleaned data frame with attribute names in some instances.
The strict level of QC yields a data frame with no attribute names. This will be worked on so that users get the sample names for their data.
Tingwei Adeck
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = tidyDenovix(fpath, file_type = 'csv', sample_type = 'RNA', check_level = 'lax')
fpath <- system.file("extdata", "rnaspec2018.csv", package = "tidyDenovix", mustWork = TRUE) rna_data = tidyDenovix(fpath, file_type = 'csv', sample_type = 'RNA', check_level = 'lax')