Error message about Biostrings - r

I am using a code where at some point i have something like that
anna <- DNAStringSet()
for (chr in c(paste('chr',seq(1,22),sep=''),'chrX','chrY')){
.
.
.
anna.view<-DNAStringSet(Views(unmasked(Hsapiens[[chr]])
.
anna<-append(anna,anna.view)
}
gc()
}
anna
library(rGADEM)
gadem <- GADEM(anna, genome = Hsapiens)
Warning message:
Using XStringViews() on a character vector is deprecated.
Please use instead something like:
as(DNAStringSet(x)), "Views")
if you really want views, otherwise just:
DNAStringSet(x)
What does that message mean? Do i have to change anything in my code, or it is safe to continue?

The warning about XStringViews being deprecated warns you that you can use this function, although it is discouraged because better alternative exist (the alternatives are suggested in the warning). However, you can still use the function.
I think the code that generates the warning comes from a function within a package. But without a reproducible example, this is hard to say. If the warning is generated from a package, upgrade to the newest version to see if that fixes the problem (although the package does not look like it is actively maintained). Alternatively, you mail the package maintainer and tell about this issue.
Bottom line, you can still use the package in your research, the warning relates to a purely software technical issue. There is no garantuee however that the code will run in new versions of R or Bioconductor, as deprecated code has a tendency to be deleted at some time.

Related

R package check() warning: A complete check needs the 'checkbashisms' script

Today I have tried to prepare a new CRAN update for a package and have come across a warning, while performing devtools::check().
Since this warning also occurs without my changes I made to the package, I am assuming this is a new check. Unfortunately I don't really get what I am supposed to do.
This is the error message:
A complete check needs the 'checkbashisms' script.
See section ‘Configure and cleanup’ in the ‘Writing R Extensions’
manual.
Of course I took a look at the section ‘Configure and cleanup’ as proposed in the warning. But still, I am not sure what to do exactly. I got, there is a checkbashisms Perl script I can download somewhere on the internet (but this alone won't make this message disappear). How shall I integrate this, that the message actually disappears.
Any hints or comments would be extremely helpful to me.
Here is a link to the repo of the package in case you want to clone it to reproduce the error.

R can't find function even though I installed its package. .nlmP (from geoR)

I write
install.packages("geoR")
library(geoR)
.nlmP(f,parameters)
and it returns
Error: could not find function ".nlmP"
What to do?
I did what the first answer suggest, then it said
Error in get(".ind.prof.phi", pos = 1) : object '.ind.prof.phi' not found
Actually I think we're quick to judge here.
https://github.com/cran/geoR/blob/a516861572ad6be3c2452a7b187af946130cf439/inst/CHANGES
The CHANGES file specifies that .nlmP was supposed to be exported in 1.7-2 and looking through the history it was. It wasn't until 1.7-4 or 1.7-5 that it got commented out in the NAMESPACE file. There is a note "changes to fix issues on CRAN reported errors/warnings regarding namespaces and foreign calls" so it might have been a namespace issue but it does seem the author intended for the function to be exported.
It might make sense to contact the maintainer about this.
If you absolutely need this function you could install the latest version that had it exported.
library(devtools)
install_github("cran/geoR", ref = "74feb80")
Note that you won't have any of the changes made to the package after that commit.
With that said I'm fairly sure there are better packages for contstrained non-linear optimization so hopefully somebody comes along with a better answer to get at the actual root of your problem.
You must use geoR:::.nlmP(), because nlmP is not in the exported NAMESPACE for geoR.

RcmdrPluginPackage Paths

My paths and files are as follows ...
E:R/R-2.15.1/library/Rcmdr/
E:R/R-2.15.1/library/RcmdrPlugin.Package/
E:R/R-2.15.1/MyLibrary/RcmdrPlugin.Package.zip
E:R/R-2.15.1/MyLibrary/RcmdrPlugin.Package/
where, in the name RcmdrPlugin.Package, I've used the word 'Package' to represent the name of the actual package being used.
The installation is as described above because (i) I'm not an expert at installing packages, (ii) I couldn't do a direct install from Cran because I wanted to put the package onto a USB stick; and, (iii) at work the Cran server is blocked (sic).
When I start the package from the GUI the Cmdr opens once and quickly closes (I don't know if this is relevant or normal) and opens again. Once open, I can operate the package via the Cmdr interface. It's a very nice package, everything works really well until I want to save the work. Then I get the following error,
Error in obj[i] : object of type 'closure' is not subsettable
I've been in contact with the people who developed (and are still developing) the package and they cannot reproduce the bug.
I strongly suspect that the problem lies in my 'crappy' install and file configuration, rather than with the package.
Can anyone please help me by suggesting how I would undo what I've done and do it properly in view of the constraints list above?
I appreciate that I can use Remove to get rid of the package but I don't want to start tinkering with something without having a greater understanding of what I'm doing.
Lastly, note that is error has been discussed a number of times on this list but not within this particular context.
I've managed to get it to work by following the instructions from here stackoverflow.com/questions/12820189/… where I set repos=NULL after I'd put the package into /MyLibrary/

How can I remove a lock from a linked environment in R?

I tried to run a Bioconductor package (truncateCDF) that modify an environment(hgu133plus2cdf), to remove unwanted probesets, from an affymetrix chip.
Everything went fine, until I got the following message (translated from french):
> assign(cdfname, cdf.env, env=CDF.env)
Error in assign(cdfname, cdf.env, env = CDF.env) :
impossible to change the value of a locked link for 'hgu133plus2cdf'
The assign function is the ultimate function of the code, that save the changes made to the environment dataset CDF.env to the original environment (hgu133plus2cdf), before using it in analyses of affymetrix chip results; so, it is essential.
My question: what is this locked link to the hgu133plus2cdf environment, and how could I bypass it.
The author of this package successfully run its package around 2005; so I suppose it is a feature introduced since then in R (probably not related to Bioconductor, since assign is a basic R function, reason why I ask this question on this forum instead of Biostar).
I tried to read the docs, but I am overwhelmed, when it comes to environments.
Thanks in advance for any help.
I don't think truncateCDF is from a Bioconductor package; it is a at least not current. This sounds like this post and the next two from the same thread from the Bioconductor mailing list. It is a result of a change in R -- packages now have not-easily-modified name spaces, and these are implemented by locking the environment in which name space symbols are defined. Removing probes is not an essential part of a typical microarray work flow. Please ask on the Bioconductor mailing list (no subscription required) if you'd like more help.

Building R package: no visible global function definition for 'subject'

I'm building an R package for the first time and am having some trouble. I am doing an R CMD Check and am getting the following error:
get.AlignedPositions: no visible global function definition for 'subject'
I am not sure what is causing this. I don't even have a "subject" variable in my code. The code is rather lengthy so I rather not paste all of it unless someone asks in a comment. Is there something specific I should look for? The only thing I can think of is that I have a line like this:
alignment <-pairwiseAlignment(pattern = canonical.protein, subject=protein.extracted, patternQuality=patternQuality,
subjectQuality=subjectQuality,type = type, substitutionMatrix= substitutionMatrix,
fuzzyMatrix=fuzzyMatrix,gapOpening=gapOpening,gapExtension=gapExtension,
scoreOnly=scoreOnly)
but subject is defined by the pairwiseAlignment function in the Biostrings package. Thank you for your help!
R spotted a function, subject, being used without a function called subject being available. One possible reason for this is explained in this discussion on R-devel. In that case code is used conditionally, e.g. if a certain package is installed we use its functionality. When checking the package on a system which does not have this package installed, we run in to these kinds of warnings. So please check if this might be the case. Alternatively, you might have made a mistake by calling subject while no function existed, e.g. subject was not a function but just an object.

Resources