Error with unique
1
0
Entering edit mode
Erik Wright ▴ 210
@erik-wright-4003
Last seen 9.7 years ago
Hi all, I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: myDNAStringSet <- unique(myDNAStringSet) When I run my function the error returned is: Error in unique.default(myDNAStringSet) : unique() applies only to vectors I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? Thanks!, Erik [[alternative HTML version deleted]]
Biostrings Biostrings • 1.7k views
ADD COMMENT
0
Entering edit mode
@sean-davis-490
Last seen 4 months ago
United States
On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: > Hi all, > > I am using the unique(x) function with a DNAStringSet in one of my own functions. ?Recently my function has started returning an error, and I am not sure what changed. ?The same line of code works fine in the R Console, just not in my function. ?I am using the function as: > > myDNAStringSet <- unique(myDNAStringSet) > > When I run my function the error returned is: > > Error in unique.default(myDNAStringSet) : > ?unique() applies only to vectors > > I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. ?Is there a solution to this? > Hi, Erik. A reproducible example and sessionInfo() would be helpful. Sean
ADD COMMENT
0
Entering edit mode
Hi Sean, Here is a simple function that creates the problem: doUnique <- function(myDNAStringSet) { myDNAStringSet <- unique(myDNAStringSet) } Here is the output in the R Console: > doUnique(myDNAStringSet) Error in unique.default(myDNAStringSet) : unique() applies only to vectors > sessionInfo() R version 2.10.1 (2009-12-14) i386-apple-darwin9.8.0 locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [1] GoneFISHing_1.0.5 RSQLite_0.8-3 DBI_0.2-5 [4] Biostrings_2.14.12 IRanges_1.4.11 loaded via a namespace (and not attached): [1] Biobase_2.6.1 Thanks again!, Erik On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: > On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: >> Hi all, >> >> I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: >> >> myDNAStringSet <- unique(myDNAStringSet) >> >> When I run my function the error returned is: >> >> Error in unique.default(myDNAStringSet) : >> unique() applies only to vectors >> >> I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? >> > > Hi, Erik. A reproducible example and sessionInfo() would be helpful. > > Sean
ADD REPLY
0
Entering edit mode
On 04/05/2010 07:23 PM, Erik Wright wrote: > Hi Sean, > > Here is a simple function that creates the problem: > doUnique <- function(myDNAStringSet) { > myDNAStringSet <- unique(myDNAStringSet) > } > > Here is the output in the R Console: >> doUnique(myDNAStringSet) > Error in unique.default(myDNAStringSet) : > unique() applies only to vectors Likely it is a NAMESPACE issue. Either doUnique is defined in GoneFISHing but the NAMESPACE of GoneFISHing does not have importFrom(Biostrings, unique) or GoneFISHing defines and/or exports its own unique that masks the one exported by Biostrings. If these were packages written by people who didn't talk with one another then you could specify Biostrings::unique(myDNAStringSet) but likely the solution is to develop an appropriate NAMESPACE in GoneFISHing. The codetoolsBioC package at https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetool sBioC accessible using svn, see http://wiki.fhcrc.org/bioc/SvnHowTo might be helpful. Martin >> sessionInfo() > R version 2.10.1 (2009-12-14) > i386-apple-darwin9.8.0 > > locale: > [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 > > attached base packages: > [1] stats graphics grDevices utils datasets methods > [7] base > > other attached packages: > [1] GoneFISHing_1.0.5 RSQLite_0.8-3 DBI_0.2-5 > [4] Biostrings_2.14.12 IRanges_1.4.11 > > loaded via a namespace (and not attached): > [1] Biobase_2.6.1 > > Thanks again!, > Erik > > > On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: > >> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: >>> Hi all, >>> >>> I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: >>> >>> myDNAStringSet <- unique(myDNAStringSet) >>> >>> When I run my function the error returned is: >>> >>> Error in unique.default(myDNAStringSet) : >>> unique() applies only to vectors >>> >>> I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? >>> >> >> Hi, Erik. A reproducible example and sessionInfo() would be helpful. >> >> Sean > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
Hi Martin, In Writing R Extensions it says that "the import directive imports all exported variables from the specified package(s).": http://cran.r-project.org/doc/manuals/R-exts.html#Specifying-imports- and-exports Since my NAMESPACE file already says import(Biostrings), do I also need to use importFrom(Biostrings, x, y, z) for each x, y, z function I want to use? Also, where do I get the username/password that I need to access svn? Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository Password for 'me': Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository Username: svn: OPTIONS of 'https://hedgehog.fhcrc.org/bioconductor/tru nk/madman/Rpacks/codetoolsBioC': authorization failed: Could not authenticate to server: rejected Basic challenge (https://hedgehog.fhcrc.org) Thanks!, Erik On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: > On 04/05/2010 07:23 PM, Erik Wright wrote: >> Hi Sean, >> >> Here is a simple function that creates the problem: >> doUnique <- function(myDNAStringSet) { >> myDNAStringSet <- unique(myDNAStringSet) >> } >> >> Here is the output in the R Console: >>> doUnique(myDNAStringSet) >> Error in unique.default(myDNAStringSet) : >> unique() applies only to vectors > > Likely it is a NAMESPACE issue. Either doUnique is defined in > GoneFISHing but the NAMESPACE of GoneFISHing does not have > > importFrom(Biostrings, unique) > > or GoneFISHing defines and/or exports its own unique that masks the one > exported by Biostrings. If these were packages written by people who > didn't talk with one another then you could specify > > Biostrings::unique(myDNAStringSet) > > but likely the solution is to develop an appropriate NAMESPACE in > GoneFISHing. The codetoolsBioC package at > > https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoo lsBioC > > accessible using svn, see > > http://wiki.fhcrc.org/bioc/SvnHowTo > > might be helpful. > > Martin > >>> sessionInfo() >> R version 2.10.1 (2009-12-14) >> i386-apple-darwin9.8.0 >> >> locale: >> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >> >> attached base packages: >> [1] stats graphics grDevices utils datasets methods >> [7] base >> >> other attached packages: >> [1] GoneFISHing_1.0.5 RSQLite_0.8-3 DBI_0.2-5 >> [4] Biostrings_2.14.12 IRanges_1.4.11 >> >> loaded via a namespace (and not attached): >> [1] Biobase_2.6.1 >> >> Thanks again!, >> Erik >> >> >> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >> >>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: >>>> Hi all, >>>> >>>> I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: >>>> >>>> myDNAStringSet <- unique(myDNAStringSet) >>>> >>>> When I run my function the error returned is: >>>> >>>> Error in unique.default(myDNAStringSet) : >>>> unique() applies only to vectors >>>> >>>> I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? >>>> >>> >>> Hi, Erik. A reproducible example and sessionInfo() would be helpful. >>> >>> Sean >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > > > -- > Martin Morgan > Computational Biology / Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. > PO Box 19024 Seattle, WA 98109 > > Location: Arnold Building M1 B861 > Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
On 04/06/2010 04:37 AM, Erik Wright wrote: > Hi Martin, > > In Writing R Extensions it says that "the import directive imports > all exported variables from the specified package(s).": > > http://cran.r-project.org/doc/manuals/R-exts.html#Specifying- imports-and-exports > > Since my NAMESPACE file already says import(Biostrings), do I also > need to use importFrom(Biostrings, x, y, z) for each x, y, z function > I want to use? import() is sufficient. IMHO import() defeats the developer-side purpose of carefully controlling what functions the package sees. > > Also, where do I get the username/password that I need to access > svn? username: readonly password: readonly (they're on the wiki page, but made more prominent now). Martin > > Authentication realm: <https: hedgehog.fhcrc.org:443=""> The > bioconductor Subversion Repository Password for 'me': Authentication > realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion > Repository Username: svn: OPTIONS of > 'https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoo lsBioC': > authorization failed: Could not authenticate to server: rejected > Basic challenge (https://hedgehog.fhcrc.org) > > Thanks!, Erik > > > On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: > >> On 04/05/2010 07:23 PM, Erik Wright wrote: >>> Hi Sean, >>> >>> Here is a simple function that creates the problem: doUnique <- >>> function(myDNAStringSet) { myDNAStringSet <- >>> unique(myDNAStringSet) } >>> >>> Here is the output in the R Console: >>>> doUnique(myDNAStringSet) >>> Error in unique.default(myDNAStringSet) : unique() applies only >>> to vectors >> >> Likely it is a NAMESPACE issue. Either doUnique is defined in >> GoneFISHing but the NAMESPACE of GoneFISHing does not have >> >> importFrom(Biostrings, unique) >> >> or GoneFISHing defines and/or exports its own unique that masks the >> one exported by Biostrings. If these were packages written by >> people who didn't talk with one another then you could specify >> >> Biostrings::unique(myDNAStringSet) >> >> but likely the solution is to develop an appropriate NAMESPACE in >> GoneFISHing. The codetoolsBioC package at >> >> https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoo lsBioC >> >> >> accessible using svn, see >> >> http://wiki.fhcrc.org/bioc/SvnHowTo >> >> might be helpful. >> >> Martin >> >>>> sessionInfo() >>> R version 2.10.1 (2009-12-14) i386-apple-darwin9.8.0 >>> >>> locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >>> >>> attached base packages: [1] stats graphics grDevices utils >>> datasets methods [7] base >>> >>> other attached packages: [1] GoneFISHing_1.0.5 RSQLite_0.8-3 >>> DBI_0.2-5 [4] Biostrings_2.14.12 IRanges_1.4.11 >>> >>> loaded via a namespace (and not attached): [1] Biobase_2.6.1 >>> >>> Thanks again!, Erik >>> >>> >>> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >>> >>>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> >>>> wrote: >>>>> Hi all, >>>>> >>>>> I am using the unique(x) function with a DNAStringSet in one >>>>> of my own functions. Recently my function has started >>>>> returning an error, and I am not sure what changed. The same >>>>> line of code works fine in the R Console, just not in my >>>>> function. I am using the function as: >>>>> >>>>> myDNAStringSet <- unique(myDNAStringSet) >>>>> >>>>> When I run my function the error returned is: >>>>> >>>>> Error in unique.default(myDNAStringSet) : unique() applies >>>>> only to vectors >>>>> >>>>> I am guessing that the R is trying to apply the unique >>>>> function in the base package to the DNAStringSet rather than >>>>> using the unique function in the Biostrings package. Is >>>>> there a solution to this? >>>>> >>>> >>>> Hi, Erik. A reproducible example and sessionInfo() would be >>>> helpful. >>>> >>>> Sean >>> >>> _______________________________________________ Bioconductor >>> mailing list Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>> archives: >>> http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> >> >>> -- >> Martin Morgan Computational Biology / Fred Hutchinson Cancer >> Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA >> 98109 >> >> Location: Arnold Building M1 B861 Phone: (206) 667-2793 > -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
On 04/06/2010 06:17 AM, Martin Morgan wrote: > On 04/06/2010 04:37 AM, Erik Wright wrote: >> Hi Martin, >> >> In Writing R Extensions it says that "the import directive imports >> all exported variables from the specified package(s).": >> >> http://cran.r-project.org/doc/manuals/R-exts.html#Specifying- imports-and-exports >> >> Since my NAMESPACE file already says import(Biostrings), do I also >> need to use importFrom(Biostrings, x, y, z) for each x, y, z function >> I want to use? > > import() is sufficient. IMHO import() defeats the developer-side purpose > of carefully controlling what functions the package sees. maybe connecting the dots a little with your other email. Perhaps you are missing importFrom(IRanges, unique)? Martin >> >> Also, where do I get the username/password that I need to access >> svn? > > username: readonly > password: readonly > > (they're on the wiki page, but made more prominent now). > > Martin >> >> Authentication realm: <https: hedgehog.fhcrc.org:443=""> The >> bioconductor Subversion Repository Password for 'me': Authentication >> realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion >> Repository Username: svn: OPTIONS of >> 'https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codeto olsBioC': >> authorization failed: Could not authenticate to server: rejected >> Basic challenge (https://hedgehog.fhcrc.org) >> >> Thanks!, Erik >> >> >> On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: >> >>> On 04/05/2010 07:23 PM, Erik Wright wrote: >>>> Hi Sean, >>>> >>>> Here is a simple function that creates the problem: doUnique <- >>>> function(myDNAStringSet) { myDNAStringSet <- >>>> unique(myDNAStringSet) } >>>> >>>> Here is the output in the R Console: >>>>> doUnique(myDNAStringSet) >>>> Error in unique.default(myDNAStringSet) : unique() applies only >>>> to vectors >>> >>> Likely it is a NAMESPACE issue. Either doUnique is defined in >>> GoneFISHing but the NAMESPACE of GoneFISHing does not have >>> >>> importFrom(Biostrings, unique) >>> >>> or GoneFISHing defines and/or exports its own unique that masks the >>> one exported by Biostrings. If these were packages written by >>> people who didn't talk with one another then you could specify >>> >>> Biostrings::unique(myDNAStringSet) >>> >>> but likely the solution is to develop an appropriate NAMESPACE in >>> GoneFISHing. The codetoolsBioC package at >>> >>> https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codeto olsBioC >>> >>> >>> > accessible using svn, see >>> >>> http://wiki.fhcrc.org/bioc/SvnHowTo >>> >>> might be helpful. >>> >>> Martin >>> >>>>> sessionInfo() >>>> R version 2.10.1 (2009-12-14) i386-apple-darwin9.8.0 >>>> >>>> locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >>>> >>>> attached base packages: [1] stats graphics grDevices utils >>>> datasets methods [7] base >>>> >>>> other attached packages: [1] GoneFISHing_1.0.5 RSQLite_0.8-3 >>>> DBI_0.2-5 [4] Biostrings_2.14.12 IRanges_1.4.11 >>>> >>>> loaded via a namespace (and not attached): [1] Biobase_2.6.1 >>>> >>>> Thanks again!, Erik >>>> >>>> >>>> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >>>> >>>>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> >>>>> wrote: >>>>>> Hi all, >>>>>> >>>>>> I am using the unique(x) function with a DNAStringSet in one >>>>>> of my own functions. Recently my function has started >>>>>> returning an error, and I am not sure what changed. The same >>>>>> line of code works fine in the R Console, just not in my >>>>>> function. I am using the function as: >>>>>> >>>>>> myDNAStringSet <- unique(myDNAStringSet) >>>>>> >>>>>> When I run my function the error returned is: >>>>>> >>>>>> Error in unique.default(myDNAStringSet) : unique() applies >>>>>> only to vectors >>>>>> >>>>>> I am guessing that the R is trying to apply the unique >>>>>> function in the base package to the DNAStringSet rather than >>>>>> using the unique function in the Biostrings package. Is >>>>>> there a solution to this? >>>>>> >>>>> >>>>> Hi, Erik. A reproducible example and sessionInfo() would be >>>>> helpful. >>>>> >>>>> Sean >>>> >>>> _______________________________________________ Bioconductor >>>> mailing list Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>>> archives: >>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> >>> >>>> -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
Thanks Martin, Adding import(IRanges) to my package's NAMESPACE file fixed the problem. - Erik On Apr 6, 2010, at 8:26 AM, Martin Morgan wrote: > On 04/06/2010 06:17 AM, Martin Morgan wrote: >> On 04/06/2010 04:37 AM, Erik Wright wrote: >>> Hi Martin, >>> >>> In Writing R Extensions it says that "the import directive imports >>> all exported variables from the specified package(s).": >>> >>> http://cran.r-project.org/doc/manuals/R-exts.html#Specifying- imports-and-exports >>> >>> Since my NAMESPACE file already says import(Biostrings), do I also >>> need to use importFrom(Biostrings, x, y, z) for each x, y, z function >>> I want to use? >> >> import() is sufficient. IMHO import() defeats the developer-side purpose >> of carefully controlling what functions the package sees. > > maybe connecting the dots a little with your other email. Perhaps you > are missing importFrom(IRanges, unique)? Martin > >>> >>> Also, where do I get the username/password that I need to access >>> svn? >> >> username: readonly >> password: readonly >> >> (they're on the wiki page, but made more prominent now). >> >> Martin >>> >>> Authentication realm: <https: hedgehog.fhcrc.org:443=""> The >>> bioconductor Subversion Repository Password for 'me': Authentication >>> realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion >>> Repository Username: svn: OPTIONS of >>> 'https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codet oolsBioC': >>> authorization failed: Could not authenticate to server: rejected >>> Basic challenge (https://hedgehog.fhcrc.org) >>> >>> Thanks!, Erik >>> >>> >>> On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: >>> >>>> On 04/05/2010 07:23 PM, Erik Wright wrote: >>>>> Hi Sean, >>>>> >>>>> Here is a simple function that creates the problem: doUnique <- >>>>> function(myDNAStringSet) { myDNAStringSet <- >>>>> unique(myDNAStringSet) } >>>>> >>>>> Here is the output in the R Console: >>>>>> doUnique(myDNAStringSet) >>>>> Error in unique.default(myDNAStringSet) : unique() applies only >>>>> to vectors >>>> >>>> Likely it is a NAMESPACE issue. Either doUnique is defined in >>>> GoneFISHing but the NAMESPACE of GoneFISHing does not have >>>> >>>> importFrom(Biostrings, unique) >>>> >>>> or GoneFISHing defines and/or exports its own unique that masks the >>>> one exported by Biostrings. If these were packages written by >>>> people who didn't talk with one another then you could specify >>>> >>>> Biostrings::unique(myDNAStringSet) >>>> >>>> but likely the solution is to develop an appropriate NAMESPACE in >>>> GoneFISHing. The codetoolsBioC package at >>>> >>>> https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codet oolsBioC >>>> >>>> >>>> >> accessible using svn, see >>>> >>>> http://wiki.fhcrc.org/bioc/SvnHowTo >>>> >>>> might be helpful. >>>> >>>> Martin >>>> >>>>>> sessionInfo() >>>>> R version 2.10.1 (2009-12-14) i386-apple-darwin9.8.0 >>>>> >>>>> locale: [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >>>>> >>>>> attached base packages: [1] stats graphics grDevices utils >>>>> datasets methods [7] base >>>>> >>>>> other attached packages: [1] GoneFISHing_1.0.5 RSQLite_0.8-3 >>>>> DBI_0.2-5 [4] Biostrings_2.14.12 IRanges_1.4.11 >>>>> >>>>> loaded via a namespace (and not attached): [1] Biobase_2.6.1 >>>>> >>>>> Thanks again!, Erik >>>>> >>>>> >>>>> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >>>>> >>>>>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> >>>>>> wrote: >>>>>>> Hi all, >>>>>>> >>>>>>> I am using the unique(x) function with a DNAStringSet in one >>>>>>> of my own functions. Recently my function has started >>>>>>> returning an error, and I am not sure what changed. The same >>>>>>> line of code works fine in the R Console, just not in my >>>>>>> function. I am using the function as: >>>>>>> >>>>>>> myDNAStringSet <- unique(myDNAStringSet) >>>>>>> >>>>>>> When I run my function the error returned is: >>>>>>> >>>>>>> Error in unique.default(myDNAStringSet) : unique() applies >>>>>>> only to vectors >>>>>>> >>>>>>> I am guessing that the R is trying to apply the unique >>>>>>> function in the base package to the DNAStringSet rather than >>>>>>> using the unique function in the Biostrings package. Is >>>>>>> there a solution to this? >>>>>>> >>>>>> >>>>>> Hi, Erik. A reproducible example and sessionInfo() would be >>>>>> helpful. >>>>>> >>>>>> Sean >>>>> >>>>> _______________________________________________ Bioconductor >>>>> mailing list Bioconductor at stat.math.ethz.ch >>>>> https://stat.ethz.ch/mailman/listinfo/bioconductor Search the >>>>> archives: >>>>> http://news.gmane.org/gmane.science.biology.informatics.conductor >>>> >>>> >>>> >>>>> > > > -- > Martin Morgan > Computational Biology / Fred Hutchinson Cancer Research Center > 1100 Fairview Ave. N. > PO Box 19024 Seattle, WA 98109 > > Location: Arnold Building M1 B861 > Phone: (206) 667-2793
ADD REPLY
0
Entering edit mode
Hi Martin, When I tried using "Biostrings::unique(myDNAStringSet)", I got this error instead: Error: 'unique' is not an exported object from 'namespace:Biostrings' Any ideas? Thanks!, Erik On Apr 6, 2010, at 6:37 AM, Erik Wright wrote: > Hi Martin, > > In Writing R Extensions it says that "the import directive imports all exported variables from the specified package(s).": > > http://cran.r-project.org/doc/manuals/R-exts.html#Specifying- imports-and-exports > > Since my NAMESPACE file already says import(Biostrings), do I also need to use importFrom(Biostrings, x, y, z) for each x, y, z function I want to use? > > Also, where do I get the username/password that I need to access svn? > > Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository > Password for 'me': > Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository > Username: svn: OPTIONS of 'https://hedgehog.fhcrc.org/bioconductor/t runk/madman/Rpacks/codetoolsBioC': authorization failed: Could not authenticate to server: rejected Basic challenge (https://hedgehog.fhcrc.org) > > Thanks!, > Erik > > > On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: > >> On 04/05/2010 07:23 PM, Erik Wright wrote: >>> Hi Sean, >>> >>> Here is a simple function that creates the problem: >>> doUnique <- function(myDNAStringSet) { >>> myDNAStringSet <- unique(myDNAStringSet) >>> } >>> >>> Here is the output in the R Console: >>>> doUnique(myDNAStringSet) >>> Error in unique.default(myDNAStringSet) : >>> unique() applies only to vectors >> >> Likely it is a NAMESPACE issue. Either doUnique is defined in >> GoneFISHing but the NAMESPACE of GoneFISHing does not have >> >> importFrom(Biostrings, unique) >> >> or GoneFISHing defines and/or exports its own unique that masks the one >> exported by Biostrings. If these were packages written by people who >> didn't talk with one another then you could specify >> >> Biostrings::unique(myDNAStringSet) >> >> but likely the solution is to develop an appropriate NAMESPACE in >> GoneFISHing. The codetoolsBioC package at >> >> https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoo lsBioC >> >> accessible using svn, see >> >> http://wiki.fhcrc.org/bioc/SvnHowTo >> >> might be helpful. >> >> Martin >> >>>> sessionInfo() >>> R version 2.10.1 (2009-12-14) >>> i386-apple-darwin9.8.0 >>> >>> locale: >>> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >>> >>> attached base packages: >>> [1] stats graphics grDevices utils datasets methods >>> [7] base >>> >>> other attached packages: >>> [1] GoneFISHing_1.0.5 RSQLite_0.8-3 DBI_0.2-5 >>> [4] Biostrings_2.14.12 IRanges_1.4.11 >>> >>> loaded via a namespace (and not attached): >>> [1] Biobase_2.6.1 >>> >>> Thanks again!, >>> Erik >>> >>> >>> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >>> >>>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: >>>>> Hi all, >>>>> >>>>> I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: >>>>> >>>>> myDNAStringSet <- unique(myDNAStringSet) >>>>> >>>>> When I run my function the error returned is: >>>>> >>>>> Error in unique.default(myDNAStringSet) : >>>>> unique() applies only to vectors >>>>> >>>>> I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? >>>>> >>>> >>>> Hi, Erik. A reproducible example and sessionInfo() would be helpful. >>>> >>>> Sean >>> >>> _______________________________________________ >>> Bioconductor mailing list >>> Bioconductor at stat.math.ethz.ch >>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >> >> >> -- >> Martin Morgan >> Computational Biology / Fred Hutchinson Cancer Research Center >> 1100 Fairview Ave. N. >> PO Box 19024 Seattle, WA 98109 >> >> Location: Arnold Building M1 B861 >> Phone: (206) 667-2793 > > _______________________________________________ > Bioconductor mailing list > Bioconductor at stat.math.ethz.ch > https://stat.ethz.ch/mailman/listinfo/bioconductor > Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor
ADD REPLY
0
Entering edit mode
On 04/06/2010 04:43 AM, Erik Wright wrote: > Hi Martin, > > When I tried using "Biostrings::unique(myDNAStringSet)", I got this error instead: > Error: 'unique' is not an exported object from 'namespace:Biostrings' > > Any ideas? My bad, sorry. IRanges::unique(). The generic is defined in IRanges, the method for DNAStringSet attached to that generic. Martin > > Thanks!, > Erik > > > On Apr 6, 2010, at 6:37 AM, Erik Wright wrote: > >> Hi Martin, >> >> In Writing R Extensions it says that "the import directive imports all exported variables from the specified package(s).": >> >> http://cran.r-project.org/doc/manuals/R-exts.html#Specifying- imports-and-exports >> >> Since my NAMESPACE file already says import(Biostrings), do I also need to use importFrom(Biostrings, x, y, z) for each x, y, z function I want to use? >> >> Also, where do I get the username/password that I need to access svn? >> >> Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository >> Password for 'me': >> Authentication realm: <https: hedgehog.fhcrc.org:443=""> The bioconductor Subversion Repository >> Username: svn: OPTIONS of 'https://hedgehog.fhcrc.org/bioconductor/ trunk/madman/Rpacks/codetoolsBioC': authorization failed: Could not authenticate to server: rejected Basic challenge (https://hedgehog.fhcrc.org) >> >> Thanks!, >> Erik >> >> >> On Apr 5, 2010, at 10:01 PM, Martin Morgan wrote: >> >>> On 04/05/2010 07:23 PM, Erik Wright wrote: >>>> Hi Sean, >>>> >>>> Here is a simple function that creates the problem: >>>> doUnique <- function(myDNAStringSet) { >>>> myDNAStringSet <- unique(myDNAStringSet) >>>> } >>>> >>>> Here is the output in the R Console: >>>>> doUnique(myDNAStringSet) >>>> Error in unique.default(myDNAStringSet) : >>>> unique() applies only to vectors >>> >>> Likely it is a NAMESPACE issue. Either doUnique is defined in >>> GoneFISHing but the NAMESPACE of GoneFISHing does not have >>> >>> importFrom(Biostrings, unique) >>> >>> or GoneFISHing defines and/or exports its own unique that masks the one >>> exported by Biostrings. If these were packages written by people who >>> didn't talk with one another then you could specify >>> >>> Biostrings::unique(myDNAStringSet) >>> >>> but likely the solution is to develop an appropriate NAMESPACE in >>> GoneFISHing. The codetoolsBioC package at >>> >>> https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codeto olsBioC >>> >>> accessible using svn, see >>> >>> http://wiki.fhcrc.org/bioc/SvnHowTo >>> >>> might be helpful. >>> >>> Martin >>> >>>>> sessionInfo() >>>> R version 2.10.1 (2009-12-14) >>>> i386-apple-darwin9.8.0 >>>> >>>> locale: >>>> [1] en_US.UTF-8/en_US.UTF-8/C/C/en_US.UTF-8/en_US.UTF-8 >>>> >>>> attached base packages: >>>> [1] stats graphics grDevices utils datasets methods >>>> [7] base >>>> >>>> other attached packages: >>>> [1] GoneFISHing_1.0.5 RSQLite_0.8-3 DBI_0.2-5 >>>> [4] Biostrings_2.14.12 IRanges_1.4.11 >>>> >>>> loaded via a namespace (and not attached): >>>> [1] Biobase_2.6.1 >>>> >>>> Thanks again!, >>>> Erik >>>> >>>> >>>> On Apr 5, 2010, at 8:55 PM, Sean Davis wrote: >>>> >>>>> On Mon, Apr 5, 2010 at 9:51 PM, Erik Wright <eswright at="" wisc.edu=""> wrote: >>>>>> Hi all, >>>>>> >>>>>> I am using the unique(x) function with a DNAStringSet in one of my own functions. Recently my function has started returning an error, and I am not sure what changed. The same line of code works fine in the R Console, just not in my function. I am using the function as: >>>>>> >>>>>> myDNAStringSet <- unique(myDNAStringSet) >>>>>> >>>>>> When I run my function the error returned is: >>>>>> >>>>>> Error in unique.default(myDNAStringSet) : >>>>>> unique() applies only to vectors >>>>>> >>>>>> I am guessing that the R is trying to apply the unique function in the base package to the DNAStringSet rather than using the unique function in the Biostrings package. Is there a solution to this? >>>>>> >>>>> >>>>> Hi, Erik. A reproducible example and sessionInfo() would be helpful. >>>>> >>>>> Sean >>>> >>>> _______________________________________________ >>>> Bioconductor mailing list >>>> Bioconductor at stat.math.ethz.ch >>>> https://stat.ethz.ch/mailman/listinfo/bioconductor >>>> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor >>> >>> >>> -- >>> Martin Morgan >>> Computational Biology / Fred Hutchinson Cancer Research Center >>> 1100 Fairview Ave. N. >>> PO Box 19024 Seattle, WA 98109 >>> >>> Location: Arnold Building M1 B861 >>> Phone: (206) 667-2793 >> >> _______________________________________________ >> Bioconductor mailing list >> Bioconductor at stat.math.ethz.ch >> https://stat.ethz.ch/mailman/listinfo/bioconductor >> Search the archives: http://news.gmane.org/gmane.science.biology.informatics.conductor > -- Martin Morgan Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD REPLY

Login before adding your answer.

Traffic: 270 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6