-
Notifications
You must be signed in to change notification settings - Fork 0
Feature/refactor DIMS PeakFinding #76
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
base: develop
Are you sure you want to change the base?
Conversation
… file with scanmode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Veel werk!
Ik heb hier en daar wat comments achter gelaten :)
|
||
script: | ||
""" | ||
Rscript ${baseDir}/CustomModules/DIMS/CollectAveraged.R |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit Rscript wordt aangeroepen zonder argumenten, maar het R script consumed cmd_args[1] (DIMS/CollectAveraged.R regel 4) is dit correct?
|
||
# get TIC intensities for areas between trim_left and trim_right | ||
tic_intensity_persample <- cbind(round(raw_data@scantime, 2), raw_data@tic) | ||
tic_intensity_persample <- cbind(raw_data@scantime, raw_data@tic) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klopt het dat er helemaal niet meer afgerond hoeft te worden?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Klopt, deze getallen worden alleen gebruikt voor het maken van een plot, dus afronden doet er niet toe.
DIMS/AveragePeaks.R
Outdated
techreps <- cmd_args[2] | ||
scanmode <- cmd_args[3] | ||
tech_reps <- strsplit(techreps, ";")[[1]] | ||
print(sample_name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is dit alleen voor debugging of moet dit er in blijven staan voor de release?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Print statements zijn alleen voor debugging. Verwijderd.
print(scanmode) | ||
|
||
# set ppm as fixed value, not the same ppm as in peak grouping | ||
ppm_peak <- 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hier staan 'not the same ppm as in peak grouping' maar in peak grouping wordt deze value dynamisch ge-assigned. kan het voorkomen dat de code daar soms toch 2 gebruikt, en zo ja, is het een probleem als ze allebij t zelfde zijn en waarom?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De parameter ppm wordt op 4 verschillende plekken in de workflow gebruikt en is in te stellen bij het starten van de workflow; deze wordt voornamelijk gebruikt voor de annotatie bij een bepaalde massa plus of min een tolerantie die berekend wordt adhv ppm.
De parameter ppm_peak wordt alleen bij PeakFinding gebruikt en heeft een vaste waarde. Deze wordt gebruikt om pieken in verschillende samples bij elkaar te zoeken en een piekgroep te vormen. De waarde van 2 reflecteert de nauwkeurigheid van het MS apparaat.
Het is geen probleem als ppm en ppm_peak dezelfde waarde zouden hebben omdat ze niet in hetzelfde script gebruikt worden en een andere toepassing hebben.
# test get_fwhm function | ||
test_that("fwhm is correctly calculated", { | ||
# create peak info to test on: | ||
test_mass_vector <- rep(70.00938, 5) + 1:5 * 0.00006 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
zijn dit handige default waardes, of zijn deze puur gekozen omdat ze lijken op 'echte' waardes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gekozen omdat ze lijken op echte waarden. De exacte waarden maken niet uit; deze manier is compacter dan 5 losse waarden invoeren.
source("../../preprocessing/peak_finding_functions.R") | ||
|
||
# test search_regions_of_interest function: | ||
test_that("regions of interest are correctly found for a single peak", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beschrijf welke functie je test (search_regions_of_interest)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De functie die getest wordt staat vernoemd in de comment erboven, in de test_that statement staat wat de functie moet doen. Dit is het format dat we afgesproken hebben.
expect_equal(nrow(search_regions_of_interest(test_ints_fullrange)), 1) | ||
expect_equal(search_regions_of_interest(test_ints_fullrange), expected_output, tolerance = 0.000001, TRUE) | ||
}) | ||
test_that("regions of interest are correctly found for two peaks", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beschrijf welke functie je test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dit is de tweede test van de functie search_regions_of_interest, zoals aangegeven in regel 5. In twee aparte test_that statements wordt het geval van een enkele en van een dubbele piek getest.
}) | ||
|
||
# test integrate_peaks function: | ||
test_that("peaks are correctly integrated", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beschrijf welke functie je test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De functie die getest wordt staat vernoemd in de comment erboven, in de test_that statement staat wat de functie moet doen. Dit is het format dat we afgesproken hebben.
}) | ||
|
||
# test get_fwhm function | ||
test_that("fwhm is correctly calculated", { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
beschrijf welke functie je test
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
De functie die getest wordt staat vernoemd in de comment erboven, in de test_that statement staat wat de functie moet doen. Dit is het format dat we afgesproken hebben.
The PeakFinding step in the DIMS pipeline has been refactored. Instead of averaging the intensities for technical replicates and doing PeakFinding on the averages, the new method will do PeakFinding for each technical replicate and then average the peak intensities for every biological sample. To do this, several scripts have been modified: