Repository navigation
Added synth data infrastructure per Issue #114 - #125
Conversation
|
I probably need to shrink the size of this data set eventually, but there are clear ways to do that. |
|
Yes, broadly similar to chondro. I actually built the first version of this when Claudia and I were working on `unmixR`. I just tuned it up some for our purposes. I do think I will need to make it a bit smaller. It’s 3.2 Mb and 5 Mb is the max for a package on CRAN.
… On May 15, 2020, at 2:42 PM, RKiselev ***@***.***> wrote:
@ximeg commented on this pull request.
In hyperSpec/R/FauxCell.R <#125 (comment)>:
> +#' Faux Cell is a synthetic data set intended for testing and demonstration.
+#' It is small so that it processes quickly.
+#' There are 300 Raman-like spectra allocated to three groups/regions.
+#' The spectrum of each region is unique and simple, with a single peak with a particular
+#' frequency and line width.
+#' Each spectrum has 1400 data points. A small amount of noise has been added.
+#' The three regions represent the sample matrix, a cell, and a nucleus within the cell.
+#' The data is indexed along x and y dimensions, simulating data collected on a grid.
I like this detailed description. It seems to be similar to the chondro dataset, right?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#125 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABCIPTYY4D4URKNLSI5AFLRRWEJLANCNFSM4NBFF7PQ>.
|
|
Can we generate it on the fly? Or during the installation? So that it is not stored at CRAN at all?
15 мая 2020 г. 14:17:40 GMT-05:00, Bryan Hanson <[email protected]> пишет:
…Yes, broadly similar to chondro. I actually built the first version of
this when Claudia and I were working on `unmixR`. I just tuned it up
some for our purposes. I do think I will need to make it a bit
smaller. It’s 3.2 Mb and 5 Mb is the max for a package on CRAN.>
>
> On May 15, 2020, at 2:42 PM, RKiselev ***@***.***>
wrote:>
> >
> >
> @ximeg commented on this pull request.>
> >
> In hyperSpec/R/FauxCell.R
<#125 (comment)>:>
> >
> > +#' Faux Cell is a synthetic data set intended for testing and
demonstration.>
> +#' It is small so that it processes quickly.>
> +#' There are 300 Raman-like spectra allocated to three
groups/regions.>
> +#' The spectrum of each region is unique and simple, with a single
peak with a particular>
> +#' frequency and line width.>
> +#' Each spectrum has 1400 data points. A small amount of noise has
been added.>
> +#' The three regions represent the sample matrix, a cell, and a
nucleus within the cell.>
> +#' The data is indexed along x and y dimensions, simulating data
collected on a grid.>
> I like this detailed description. It seems to be similar to the
chondro dataset, right?>
> >
> —>
> You are receiving this because you authored the thread.>
> Reply to this email directly, view it on GitHub
<#125 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABCIPTYY4D4URKNLSI5AFLRRWEJLANCNFSM4NBFF7PQ>.>
> >
>
>
>
-- >
You are receiving this because you were mentioned.>
Reply to this email directly or view it on GitHub:>
#125 (comment)
--
Roman Kiselev
|
|
I think that’s possible, or at least we could remove the checking steps in the script and just leave the steps needed to build the data set. It executes quickly.
But, we’d have to think about how to do that consistent with CRAN guidelines. You can’t write to any user directory other than a `tempdir` which means it wouldn’t persist for users (these are deleted when the R session ends).
… On May 15, 2020, at 5:13 PM, RKiselev ***@***.***> wrote:
Can we generate it on the fly? Or during the installation? So that it is not stored at CRAN at all?
15 мая 2020 г. 14:17:40 GMT-05:00, Bryan Hanson ***@***.***> пишет:
>Yes, broadly similar to chondro. I actually built the first version of
>this when Claudia and I were working on `unmixR`. I just tuned it up
>some for our purposes. I do think I will need to make it a bit
>smaller. It’s 3.2 Mb and 5 Mb is the max for a package on CRAN.>
>>
>> On May 15, 2020, at 2:42 PM, RKiselev ***@***.***>
>wrote:>
>> >
>> >
>> @ximeg commented on this pull request.>
>> >
>> In hyperSpec/R/FauxCell.R
><#125 (comment)>:>
>> >
>> > +#' Faux Cell is a synthetic data set intended for testing and
>demonstration.>
>> +#' It is small so that it processes quickly.>
>> +#' There are 300 Raman-like spectra allocated to three
>groups/regions.>
>> +#' The spectrum of each region is unique and simple, with a single
>peak with a particular>
>> +#' frequency and line width.>
>> +#' Each spectrum has 1400 data points. A small amount of noise has
>been added.>
>> +#' The three regions represent the sample matrix, a cell, and a
>nucleus within the cell.>
>> +#' The data is indexed along x and y dimensions, simulating data
>collected on a grid.>
>> I like this detailed description. It seems to be similar to the
>chondro dataset, right?>
>> >
>> —>
>> You are receiving this because you authored the thread.>
>> Reply to this email directly, view it on GitHub
><#125 (review)>,
>or unsubscribe
><https://github.com/notifications/unsubscribe-auth/AABCIPTYY4D4URKNLSI5AFLRRWEJLANCNFSM4NBFF7PQ>.>
>> >
>>
>>
>>
>-- >
>You are receiving this because you were mentioned.>
>Reply to this email directly or view it on GitHub:>
>#125 (comment)
--
Roman Kiselev
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#125 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABCIPSHNZMI4TZG6ELZC6TRRWV55ANCNFSM4NBFF7PQ>.
|
|
Result from video call on 2020-05-18: we can probably remove the additional dependencies of FauxCell.R and then generate a |
| person("Alois", "Bonifacio", role = c ("ctb", "dtc")), | ||
| person("Marcel", "Dahms", role = "ctb"), | ||
| person("Björn", "Egert", role = "ctb"), | ||
| person("Bj<U+00F6>rn", "Egert", role = "ctb"), |
There was a problem hiding this comment.
Is an encoding issue introduced here?
There was a problem hiding this comment.
I have tracked this down to R version 4.0.0 RC (2020-04-21 r78267) which I am using. It only has locale "C" for some reason. It is corrected in 4.1 but other things have changed there (changes in apply arguments) which affect hyperSpec so once #126 is fixed we can move to 4.1 and this locale issue should go away.
|
There might be… some of us are building in an ASCII locale and some in UTF-8. Thanks for mentioning this, we’ll get it fixed eventually. A major overhaul is underway.
… On May 19, 2020, at 6:33 PM, Vilmantas Gegzna ***@***.***> wrote:
@GegznaV commented on this pull request.
In hyperSpec/DESCRIPTION <#125 (comment)>:
> Maintainer: Claudia Beleites ***@***.***>
***@***.***: c(
person("Claudia", "Beleites", role = c("aut","cre", "dtc"), email = ***@***.***"),
person("Valter", "Sergo", role = c("aut")),
person("Alois", "Bonifacio", role = c ("ctb", "dtc")),
person("Marcel", "Dahms", role = "ctb"),
- person("Björn", "Egert", role = "ctb"),
+ person("Bj<U+00F6>rn", "Egert", role = "ctb"),
Is an encoding issue introduced here?
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub <#125 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABCIPWWNEYTJ4XK24L4ZCLRSMCLRANCNFSM4NBFF7PQ>.
|
|
Alright... Thanks @ximeg for assisting me with understanding the commit process here. Based on comments on the first commit, the desire was to move from a Also, I eliminated the This builds, checks and installs using R 4.0. |
|
@bryanhanson may I (substantially) mess around in your file? |
|
Of course!
… On May 21, 2020, at 6:02 PM, Claudia Beleites ***@***.***> wrote:
@bryanhanson <https://github.com/bryanhanson> may I (substantially) mess around in your file?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#125 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AABCIPTUVWD32NQCBJHUHIDRSWQJBANCNFSM4NBFF7PQ>.
|
| #' pca <- prcomp(fauxCell) | ||
| #' plot(pca) | ||
| #' | ||
| #' loadings <- decomposition(fauxCell, t(pca$rotation), scors = FALSE) |
|
So with the |
|
However, I just read at |
|
I need to ask about this line from the perspective of the inner workings of
? This would add the noise to the original object and not replace the original object. I may have a follow up question about the choice of Update: After reading about this a bit more, I see why your original line works (Question 2). If one were implementing Gaussian noise, you would use a mean of zero and chose a sd and add it to the original signal, causing the peaks to shift a bit up or down. Gaussian is a continuous function. Poisson however is discrete. The PMF for Poisson has lambda = expectation value/mean = the variance, which means that the greater intensity of the peak, the wider the distribution. So by replacing a peak with a draw from the Poisson distribution, you add more noise to the higher peaks. In contrast, adding Gaussian noise is essentially adding a fixed amount of noise to every peak, whether small or large. I think what this comes around to is adding Gaussian noise is homoskedastic process, but adding Poisson noise is a heteroskedastic process. Interestingly, about 3 months ago I asked about the source of noise here and got some not quite satisfying answers. Oddly enough the Wikipedia entry for shot noise answers quite clearly. If you are still reading I welcome feedback! Now it's time to understand the math behind the vanderMonde matrix and the sources of wandering baselines. And that's how I spent my Saturday night! |
| ##' @param ... hyperSpec method: further arguments to \code{\link{decomposition}} | ||
| ##' @return hyperSpec method: hyperSpec object containing van der Monde matrix as spectra and an additional column ".vdm.order" giving the order of each spectrum (term). | ||
| ##' other function). `hyperSpec::normalize01()` maps the wavelength range to the interval | ||
| ##' [0, 1]. Use `base::I()` to turn off. |
There was a problem hiding this comment.
I suggest using [base::I()] (square brackets instead of backticks) as this syntax will automatically create a link to the documentation of function I().
The same applies to [hyperSpec::decomposition()] and the other functions.
There was a problem hiding this comment.
Especially as the previous Rd code was \code{\link[base]{I}} (i.e., defined a link)
There was a problem hiding this comment.
@GegznaV ...automatically creates a link to the documentation... Where? In pkgdown? Not sure what kind of text processing you are thinking about.
There was a problem hiding this comment.
In R documentation as well as in pkgdown website.
Here is more on links in Markdown-favored R documentation:
https://roxygen2.r-lib.org/articles/markdown.html#links
There was a problem hiding this comment.
This markdown syntax and roxygen comments (#', or ##' in hyperSpec's case) indicate that roxygen2 is used to create Rd files automatically. And syntax [pkg::func()] in the roxygen comments is converted into \code{\link[pkg:func]{pkg::func()}} in appropriate Rd file. Finally, \code{\link[pkg:func]{pkg::func()}} is converted into a link when documentation is built from Rd file.
There was a problem hiding this comment.
Fantastic I did not know this trick. Thank you! Not only saves typing but when you do it all manually it's easy to miss a closing brace or square bracket. Fabulous!
There was a problem hiding this comment.
If you use RStudio, you may notice, that text inside square brackets inside roxygen comments is highlighted differently than the surrounding text.
Of course, these corrections in the documentation are not crucial. I just draw your attention that current changes in syntax (using just backticks) will not result in the links, which were present in the documentation when LaTeX based Rd syntax was used.
There was a problem hiding this comment.
There is a package, that converts from Rd to markdown syntax in roxygen comments: roxygen2md.
|
I reviewed the new synthetic data set and I really like how you've done it! Everything seems to work with R3.6.3, it builds and passes the checks, so I am merging this pull request into develop. We'll fine polish it later, if necessary. Great job everyone! 😃 👍 |



This request contains 3 new files:
hyperSpec/data/FauxCell.RDatacontaining the datahyperSpec/R/FauxCell.Rwhich has the documentation for the datahyperSpec/doc/ext/Create_Faux_Cell.Rwhich is a heavily documented script I used to create the data setThis needs to be tested: I don't have a working build system and can't test, so if @cbeleites or @ximeg can build and check I would appreciate it. Then try
?FauxCelland run the examples. Thank you.