[Bioc-devel] How to recreate R CMD BUILD environment in interactive session?
Elizabeth Purdom
epurdom at stat.berkeley.edu
Mon Oct 23 22:06:44 CEST 2017
Dear Martin,
Just for completeness, I figured out the discrepancy and solved my problem. In my check, I check that the column names contain the expected names and I didn’t want to make the order required in a certain way so I used sort -- but only of one side because I naively assumed the other side would be fixed:
any(sort(colnames(object at merge_nodeMerge)) != c('Contrast','isMerged','mergeClusterId','Node’)
But the different environments are sorting differently!
In my normal interactive R session:
> sort(c("Contrast", "isMerged", "mergeClusterId", "Node"))
[1] "Contrast" "isMerged" "mergeClusterId" "Node"
In the build version of R however:
Browse[2]> sort(c("Contrast", "isMerged", "mergeClusterId", "Node"))
[1] "Contrast" "Node" "isMerged" "mergeClusterId"
Thank you very much for your help in getting an interactive session in the build environment!
Elizabeth
> On Oct 23, 2017, at 4:35 PM, Martin Morgan <martin.morgan at roswellpark.org> wrote:
>
> On 10/23/2017 09:59 AM, Elizabeth Purdom wrote:
>>> On Oct 23, 2017, at 3:47 PM, Martin Morgan <martin.morgan at roswellpark.org <mailto:martin.morgan at roswellpark.org>> wrote:
>>>
>>> On 10/23/2017 09:26 AM, Elizabeth Purdom wrote:
>>>> Hello,
>>>> I am updating an existing package and I am getting an error in running my vignette (and a similar error in an example in help pages) but ONLY when I run R CMD BUILD. I can’t recreate the error in any session where I can debug and figure out what is happening. So my question is how can I recreate the exact environment of R CMD BUILD that runs the vignette but in an interactive session so that I can figure out what is going on?
>>>> I have tried reproducing the error in other environments:
>>>> * Running R —vanilla interactively and trying the code manually
>>>> * running purl on my vignette to get pure R code and running just the R code with R CMD BATCH —vanilla
>>>
>>> hint on the specific package and / or error message?
>>>
>>> My approach would be to install the package, Stangle / purl the vignette, and R -f vignette.R, then trim the vignette to a fast reproducible case. But it sounds like you're doing that...
>>>
>>> Martin
>>>
>> Yes, that is what I tried but did not get the error from the R code.
>> And I apologize, it’s the `clusterExperiment` package. My error was so specific to the class created by my package that I didn’t think it would be useful, but here is the relevant error message:
>> Quitting from lines 271-272 (clusterExperimentTutorial.Rmd)
>> Error: processing vignette 'clusterExperimentTutorial.Rmd' failed with diagnostics:
>> invalid class "ClusterExperiment" object: merge_nodeMerge must have 4 columns and column names equal to: 'Node','Contrast','isMerged','mergeClusterId'
>> Execution halted
>> I would note that my vignette calls an object that is saved as a data object as part of my package to speed up compilation. But I experimented and you can also switch it so that it creates the object from scratch and doesn’t load the object, and it runs into the same error. There is a `LazyData: false` in my DESCRIPTION File, because I was having problems with my R data object, because it is of the class I make with my package, and without the package loaded there was some problem loading it.
>
> I can reproduce the error with
>
> clusterExperiment/vignettes master$ R_DEFAULT_PACKAGES= LC_COLLATE=C R -f clusterExperimentTutorial.R
>
> leading to
>
> > ## ----recallRSEC------------------------------------------------------------
> > rsecFluidigm<-RSEC(rsecFluidigm,isCount=TRUE,combineProportion=0.6,mergeMethod="JC",mergeCutoff=0.05)
> Error in validObject(.Object) :
> invalid class "ClusterExperiment" object: merge_nodeMerge must be data.frame with 4 columns and column names equal to: 'Node','Contrast','isMerged','mergeClusterId'
> Calls: RSEC ... .local -> new -> initialize -> initialize -> validObject
> Execution halted
>
> and then for work inside R
>
>
> clusterExperiment/vignettes$ R_DEFAULT_PACKAGES= LC_COLLATE=C R
> Bioconductor version 3.6 (BiocInstaller 1.27.7), ?biocLite for help
> > source("clusterExperimentTutorial.R", echo=TRUE, max=Inf)
>
> Does that set you down the right path?
>
> Martin
>
>
>
> This email message may contain legally privileged and/or confidential information. If you are not the intended recipient(s), or the employee or agent responsible for the delivery of this message to the intended recipient(s), you are hereby notified that any disclosure, copying, distribution, or use of this email message is prohibited. If you have received this message in error, please notify the sender immediately by e-mail and delete this email message from your computer. Thank you.
[[alternative HTML version deleted]]
More information about the Bioc-devel
mailing list