Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor find.turn.point.R and find.tol.time.R and recover.weaker.R #91

Merged
merged 58 commits into from
Aug 17, 2022
Merged
Show file tree
Hide file tree
Changes from 57 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
b006c19
setup remote
wverastegui Jul 29, 2022
b099d9e
Update
wverastegui Jul 29, 2022
ae0be7d
extracted functions into top level
hechth Aug 1, 2022
e573714
Refactoring
wverastegui Aug 2, 2022
91746c2
renamed and extracted variables
hechth Aug 2, 2022
70152c6
Started adding documentation and reworked base.curve variable
Aug 2, 2022
60119d1
Removed compute base curve function
hechth Aug 2, 2022
572ebaa
Removed parallel code section from test
hechth Aug 2, 2022
145e31f
Renamed all.times to delta_rt which is the actual content of the vari…
hechth Aug 2, 2022
4b4863c
Added documentation for compute target times and renamed variable
hechth Aug 3, 2022
c67e22d
adjusted namespace
hechth Aug 3, 2022
ee6d1d2
refactored find.tol.time function
hechth Aug 3, 2022
8ced53c
Further improved documentation and removed unnecessary functions
hechth Aug 3, 2022
d520cde
Added further documentation and renamed variables
hechth Aug 4, 2022
9004c22
Fixing other test cases
hechth Aug 4, 2022
a49291d
added coments
wverastegui Aug 4, 2022
133a1bc
Finalized find.tol.time
hechth Aug 4, 2022
f7e54ab
started find.turn.point
hechth Aug 4, 2022
fbdd303
Adapted to new combine.seq implementation
hechth Aug 5, 2022
e54f576
Merge remote-tracking branch 'origin/master' into 74_continue
hechth Aug 5, 2022
e93a9d3
Refactored find.turn.point.R
wverastegui Aug 5, 2022
91547dd
post merge cleanup
hechth Aug 5, 2022
a5f4c21
Refactored find.turn.point.R
wverastegui Aug 5, 2022
75b39a1
refactored find turn points with pastecs library
wverastegui Aug 8, 2022
0bdeaf3
final refactorings
Aug 8, 2022
824fcae
Updated changelog file
wverastegui Aug 8, 2022
821bb9a
updated variable name
hechth Aug 8, 2022
8e1f381
Finalized documentation
hechth Aug 8, 2022
e5cde42
Added final documentation sections.
Aug 8, 2022
8587a61
Merge branch 'master' into 77_refactor_R_aplcms
hechth Aug 8, 2022
3788061
tiny refactor
hechth Aug 8, 2022
9c3df64
reformatting
hechth Aug 9, 2022
01ed54a
Changed test case to actually check the recovered tables
Aug 10, 2022
8beafb4
fixed typo
hechth Aug 10, 2022
4e91d2d
Adapted to tibble and properly added rows to dataframes
hechth Aug 10, 2022
5db5d2f
extracted function to compute cores and starting on fixing hybrid tes…
hechth Aug 10, 2022
d11743b
temporarily disabled two step hybrid
hechth Aug 10, 2022
215afdc
Merge branch 'master' into 74_continue
hechth Aug 10, 2022
13928c8
Reformatted file and adjusted variable name
hechth Aug 11, 2022
7cd24d9
Fixed bug with vscDebugger
hechth Aug 11, 2022
9192974
Adapted function name to better reflect functionality
Aug 11, 2022
7c8c114
Adapted to new variable name
hechth Aug 11, 2022
4f3cec6
added r-httpgd package for plotting
hechth Aug 11, 2022
96c64ae
Reverted to refactored version without turnpoint(). Updated changelog…
wverastegui Aug 11, 2022
e4b9d3c
Merge branch 'master' into 77_refactor_R_aplcms
hechth Aug 11, 2022
9df570d
Update conda/environment-dev.yaml
hechth Aug 11, 2022
fa06229
Update conda/meta.yaml
hechth Aug 11, 2022
852e2c9
Update DESCRIPTION
hechth Aug 12, 2022
79aa394
fixed adjust.time, feature.align and extract_features test cases
hechth Aug 12, 2022
c354bdc
fixed unsupervised and hybrid test cases
hechth Aug 12, 2022
054f62f
Added missing function exports
hechth Aug 12, 2022
f84f147
Merge branch '74_continue' into 77_refactor_R_aplcms
hechth Aug 16, 2022
6c7cf2f
addressed comment
hechth Aug 16, 2022
05c213a
pinned r-arrow version as 9.0.0 fails
hechth Aug 16, 2022
51fa953
moved arrange out of loop
hechth Aug 16, 2022
804f16b
reverted change
hechth Aug 16, 2022
bbf3237
Fixed documentation
hechth Aug 16, 2022
668a6bf
Update R/find.tol.time.R
hechth Aug 17, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- refactored `feature.align.R` [#63](https://github.com/RECETOX/recetox-aplcms/pull/63)[#88](https://github.com/RECETOX/recetox-aplcms/pull/88)
- refactored `adjust.time.R` [#64](https://github.com/RECETOX/recetox-aplcms/pull/64)
- refactored `find.tol.time.R` [#91](https://github.com/RECETOX/recetox-aplcms/pull/91)
- refactored `find.turn.point.R` [#91](https://github.com/RECETOX/recetox-aplcms/pull/91)
### Removed

## [0.9.4] - 2022-05-10
Expand Down
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@ Authors@R: c(
Description: This is a customized fork of the original work from Tianwei Yu.
It takes the adaptive processing of LC/MS metabolomics data further
with focus on high resolution MS for both LC and GC applications.
Depends: R (>= 3.50), MASS, mzR, splines, doParallel, foreach, snow, dplyr,
tidyr, stringr, tibble, tools, arrow
Depends: R (>= 3.50), MASS, mzR, splines, doParallel, foreach,
snow, dplyr, tidyr, stringr, tibble, tools, arrow
biocViews: Technology, MassSpectrometry
License: GPL-2
LazyLoad: yes
NeedsCompilation: no
Suggests:
arrow, dataCompareR, testthat (>= 3.0.0)
dataCompareR, testthat (>= 3.0.0)
Config/testthat/edition: 3
RoxygenNote: 7.2.0
RoxygenNote: 7.2.1
13 changes: 8 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,25 @@ export(bigauss.esti)
export(bigauss.esti.EM)
export(bigauss.mix)
export(combine.seq.3)
export(compute_all_times)
export(compute_base_curve)
export(compute_boundaries)
export(compute_bounds)
export(compute_breaks)
export(compute_breaks_2)
export(compute_delta_rt)
export(compute_densities)
export(compute_mass_density)
export(compute_mass_values)
export(compute_target_time)
export(compute_target_times)
export(cont.index)
export(duplicate.row.remove)
export(extract_features)
export(extract_pattern_colnames)
export(feature.align)
export(find.tol)
export(find.turn.point)
export(find_local_maxima)
export(get_custom_chr_tol)
export(get_mzrange_bound_indices)
export(get_raw_features_in_mzrange)
export(get_rt_region_indices)
export(get_times_to_use)
export(hybrid)
export(increment_counter)
Expand All @@ -35,9 +35,12 @@ export(load.lcms)
export(load_data)
export(load_file)
export(make.known.table)
export(mass.match)
export(msExtrema)
export(normix)
export(normix.bic)
export(plot_raw_profile_histogram)
export(predict_mz_break_indices)
export(prep.uv)
export(proc.cdf)
export(prof.to.features)
Expand Down
16 changes: 2 additions & 14 deletions R/adaptive.bin.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,6 @@ compute_breaks <- function(tol, masses, intensi, weighted) {
return(breaks)
}

#' @export
compute_boundaries <- function(mass.vlys, mass.pks, j){
mass.lower <- max(mass.vlys[mass.vlys < mass.pks[j]])
mass.upper <- min(mass.vlys[mass.vlys > mass.pks[j]])

return(list(lower = mass.lower, upper = mass.upper))
}

#' @export
increment_counter <- function(pointers, that.n){
Expand Down Expand Up @@ -134,7 +127,7 @@ adaptive.bin <- function(x,
for (j in 1:length(mass.pks))
{
# compute boundaries
boundaries <- compute_boundaries(mass.vlys, mass.pks, j)
boundaries <- compute_boundaries(mass.vlys, mass.pks[j])

if (length(mass.pks) == 1){
boundaries$lower <- boundaries$lower - 1
Expand All @@ -144,12 +137,7 @@ adaptive.bin <- function(x,
that <- this_table |> dplyr::filter(mz > boundaries$lower & mz <= boundaries$upper)

if (nrow(that) > 0) {
that <- combine.seq.3(that)

if (nrow(that) != 1) {
that <- that[order(that[, 1]), ]
}

that <- combine.seq.3(that) |> dplyr::arrange_at("mz")
that.range <- diff(range(that$labels))

if (that.range > 0.5 * time_range & length(that$labels) > that.range * min.pres & length(that$labels) / (that.range / aver.time.range) > min.pres) {
Expand Down
Loading