Re: [Bioc-devel] Struggles with correct import .....

2013-12-03 Thread Martin Maechler
 Kasper Daniel Hansen kasperdanielhan...@gmail.com
 on Wed, 20 Nov 2013 15:37:00 -0500 writes:

 Ok, I analyzed the package using codetoolsBioC and there
 were a number of missing imports, including what Leonardo
 has described.  I have fixed those in bumphunter 1.3.3

 Kasper

Impressing and interesting.   I don't see  'codetoolsBioC' to be
available via biocLite().

What's the recommended way to have it among the bioconductor
packages ?

Martin

 On Wed, Nov 20, 2013 at 3:28 PM, Kasper Daniel Hansen 
 kasperdanielhan...@gmail.com wrote:

 I'll have a look.
 
 Basically, issues such as this is never the end-users
 problem and is likely to either be caused by bumphunter
 not importing correctly (most likely) or IRanges not
 exporting correctly.
 
 Kasper
 
 
 On Wed, Nov 20, 2013 at 3:02 PM, Leonardo Collado Torres
  lcoll...@jhsph.edu wrote:
 
 Hello,
 
 Found how to solve this. Basically, the NAMESPACE of the
 bumphunter package is not complete (I think).
 
 I downloaded
 
 
http://bioconductor.org/packages/release/bioc/src/contrib/bumphunter_1.2.0.tar.gz
 , changed the version to 1.2.1 and added/modified the
 following lines to the NAMESPACE:
 
 importFrom(IRanges, IRanges, distance,
 distanceToNearest, subjectHits)
 importMethodsFrom(GenomicRanges, seqnames, sort, strand,
 elementMetadata)
 
 Once bumphunter was importing IRanges::distance, I got
 past the error I reported. Then I found other errors
 related to bumphunter not importing the GenomicRanges
 strand and elementMetadata functions, as well as the
 IRanges distanceToNearest, IRanges and subjectHits
 functions.
 
 Best, Leo
 
 
 
 
 On Wed, Nov 20, 2013 at 2:46 PM, Leonardo Collado Torres
  lcoll...@jhsph.edu  wrote:
 
  Hi Harris,
 
  Answering your question from your first email, I do
 not think that it  would help if bumphunter exported
 matchGenes() or .matchGenes().
 
  Currently by just importing annotateNearest(), R is
 correctly able to use  annotateNearest(), then
 .matchGenes(), and also nearestgene(). The problem  is
 that nearestgene() uses IRanges::distance() but that
 function is not  being found even after importing it.
 
  So as far as I understand, everything should be
 working since the  NAMESPACE
 https://github.com/lcolladotor/derfinder/blob/v0.0.34/NAMESPACEhas:
 
  importFrom(bumphunter,annotateNearest) 
 importMethodsFrom(IRanges,distance) 
 importFrom(IRanges,distance)
 
  That is why I am confused and do not know what is the
 cause of the problem.
 
 
  One possible explanation could be that bumphunter's
 NAMESPACE
 
 
https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/bumphunter/NAMESPACEdoesn't
  import the IRanges::distance method.
 
 
 
  Regarding your second email (quoted below), I do not
 import the  IRanges::nearest method, but it doesn't
 seem to be causing problems.  That  could be because
 bumphunter does import the IRanges::nearest method
 
  If I comment out line 147 of 
 https://github.com/lcolladotor/derfinder/blob/v0.0.34/R/analyzeChr.R,
  aka, comment out library(bumphunter) the example for
 analyzeChr() fails  with:
 
  Error in withCallingHandlers(expr, warning =
 function(w)  invokeRestart(muffleWarning)) :  could
 not find function distance
 
  So yes, I get the same error in real life and not only
 in CMD check.
 
 
  Adding to the NAMESPACE the following line doesn't
 help either.
 
  importMethodsFrom(IRanges,nearest)
 
 
 
 
  Best,  Leo
 
 
 
  On Wed, Nov 20, 2013 at 2:06 PM, Harris A. Jaffee
 h...@jhu.edu wrote:
 
  In nearestgene(), before the call to distance, there
 is a call to nearest.   How is that getting resolved?
 Did you import nearest from IRanges?  Can  you run
 nearestgene under debug and step through it, seeing how
 nearest is  resolved?  Do you only get an error from
 CMD check and not in real life?
 
 
  On Nov 20, 2013, at 12:16 PM, Leonardo Collado Torres
 wrote:
 
   Dear BioC-devel list,
  
   I have what I hope is a simple problem. Basically,
 a function in my  package uses
 bumphunter::annotateNearest. This function in turn uses
  IRanges::distance.
  
   I would expect that using the following roxygen2
 info would work:
  
   #' @importMethodsFrom IRanges distance   #'
 @importFrom bumphunter annotateNearest   #'
 @importFrom IRanges distance
  
   Note that distance is a generic in IRanges with
 methods for Ranges
 
 

Re: [Bioc-devel] GenomicRanges: Storing 'seqlengths' as numeric

2013-12-03 Thread Martin Morgan

On 12/03/2013 02:29 AM, Julian Gehring wrote:

Hi,

Some of the chromosomes out in the world are fairly large (e.g. wheat chr 3B
with  995 Mbp [1]).  Currently, the 'seqlengths' of the reference sequence are
stored as 'integers' which do not allow to store lengths of this size.  Are
there any plans of switching to 'doubles' or 64-bit integers for the
'seqlengths' slot?  Or extending the slot such that a user can store it either
as integer or floating-point number?


But

 .Machine$integer.max
[1] 2147483647

so we at least survive wheat chr 3B?

If there is movement to support this I'd encourage exact representation as 
double (this is how R deals with long vectors, and I believe it is the 
javascript representation of integers so not completely unprecedented) rather 
than 64 bit integers (which do not have any support in R).


I guess this would be quite a big undertaking so real use cases need to be 
present. And support for larger integers would seem to be useful to R generally 
rather than just to Bioc.


Martin



Best wishes
Julian


[1] http://www.sciencemag.org/content/322/5898/101

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel



--
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

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Bioc-devel] GenomicRanges: Storing 'seqlengths' as numeric

2013-12-03 Thread Hervé Pagès

Hi,

Agreed with Martin that until someone comes up with a chromosome that
is longer than .Machine$integer.max I don't see the need for switching
to double or int64 to represent the seqlengths.

Furthermore, since the seqlengths are used in many range operations
like checking the validity of the ranges in a GRanges object, trimming
them, computing coverage, handling circularity, etc... it would not
make much sense to make the switch for the seqlengths without also
making it for Ranges objects. That would be a serious undertaking though
and probably with many backward compatibility issues.

H.


On 12/03/2013 10:07 AM, Martin Morgan wrote:

On 12/03/2013 02:29 AM, Julian Gehring wrote:

Hi,

Some of the chromosomes out in the world are fairly large (e.g. wheat
chr 3B
with  995 Mbp [1]).  Currently, the 'seqlengths' of the reference
sequence are
stored as 'integers' which do not allow to store lengths of this
size.  Are
there any plans of switching to 'doubles' or 64-bit integers for the
'seqlengths' slot?  Or extending the slot such that a user can store
it either
as integer or floating-point number?


But

  .Machine$integer.max
[1] 2147483647

so we at least survive wheat chr 3B?

If there is movement to support this I'd encourage exact representation
as double (this is how R deals with long vectors, and I believe it is
the javascript representation of integers so not completely
unprecedented) rather than 64 bit integers (which do not have any
support in R).

I guess this would be quite a big undertaking so real use cases need to
be present. And support for larger integers would seem to be useful to R
generally rather than just to Bioc.

Martin



Best wishes
Julian


[1] http://www.sciencemag.org/content/322/5898/101

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel





--
Hervé Pagès

Program in Computational Biology
Division of Public Health Sciences
Fred Hutchinson Cancer Research Center
1100 Fairview Ave. N, M1-B514
P.O. Box 19024
Seattle, WA 98109-1024

E-mail: hpa...@fhcrc.org
Phone:  (206) 667-5791
Fax:(206) 667-1319

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


[Bioc-devel] Conflict between BiocStyle and the verbatim package

2013-12-03 Thread Nicolas Delhomme
Hej Martin!

I’d like to have multi-line comments in my vignette and the easiest way I know 
is to use the “comment” environment from the verbatim package - i.e. 
\begin{comment}…\end{comment}. However, when I do this, i.e. load the verbatim 
package after having “sourced” the BiocStyle package, generating the pdf just 
fails without any error message. 

Here’s a tiny .Rnw example of how to reproduce the error:

\documentclass[11pt,a4paper]{article}
% Bioc style
style, eval=TRUE, echo=FALSE, results=tex=
BiocStyle::latex()
@
\usepackage{verbatim}
\begin{document}
Some text
\begin{comment}
some comments not to be seen by the user
\end{comment}
Some more text
\end{document}

The generated pdf stops after the text “Some text”. I tried to track it down, 
but I’m out of my depth in latex style file. Do you have any idea what is 
happening? And do you have any suggestion of how I could go around this other 
than using % on every comment line?

Cheers,

Nico

---
Nicolas Delhomme

Nathaniel Street Lab
Department of Plant Physiology
Umeå Plant Science Center

Tel: +46 90 786 7989
Email: nicolas.delho...@umu.se
SLU - Umeå universitet
Umeå S-901 87 Sweden

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Bioc-devel] Conflict between BiocStyle and the verbatim package

2013-12-03 Thread Martin Morgan

On 12/03/2013 12:30 PM, Nicolas Delhomme wrote:

Hej Martin!

I’d like to have multi-line comments in my vignette and the easiest way I know 
is to use the “comment” environment from the verbatim package - i.e. 
\begin{comment}…\end{comment}. However, when I do this, i.e. load the verbatim 
package after having “sourced” the BiocStyle package, generating the pdf just 
fails without any error message.

Here’s a tiny .Rnw example of how to reproduce the error:

\documentclass[11pt,a4paper]{article}
% Bioc style
style, eval=TRUE, echo=FALSE, results=tex=
BiocStyle::latex()
@
\usepackage{verbatim}
\begin{document}
Some text
\begin{comment}
some comments not to be seen by the user
\end{comment}
Some more text
\end{document}

The generated pdf stops after the text “Some text”. I tried to track it down, 
but I’m out of my depth in latex style file. Do you have any idea what is 
happening? And do you have any suggestion of how I could go around this other 
than using % on every comment line?



If I take your file and

  R CMD Sweave Nico.Rnw
  pdflatex Nico.tex

I get

! Undefined control sequence.
\f@ncyolh -\thetitle
  \strut
l.15 \end{document}

?

which is because the vignette needs to have a title, e.g., in the preamble

\usepackage{verbatim}
\title{My amazing document}
\begin{document}

If I add this, then things seem to work fine.

The undefined control sequence doesn't sound like what you saw, so maybe more 
details are needed? I'm using


$ R --vanilla --slave -e R.version.string
[1] R Under development (unstable) (2013-12-01 r64371)

$ pdflatex --version
pdfTeX 3.1415926-1.40.10-2.2 (TeX Live 2009/Debian)

Martin


Cheers,

Nico

---
Nicolas Delhomme

Nathaniel Street Lab
Department of Plant Physiology
Umeå Plant Science Center

Tel: +46 90 786 7989
Email: nicolas.delho...@umu.se
SLU - Umeå universitet
Umeå S-901 87 Sweden

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel




--
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

___
Bioc-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/bioc-devel


Re: [Bioc-devel] Struggles with correct import .....

2013-12-03 Thread Kasper Daniel Hansen
It is super super super useful for NAMESPACE issues.  I don't really use
the other stuff.

Kasper

On Tue, Dec 3, 2013 at 11:34 AM, Dan Tenenbaum dtene...@fhcrc.org wrote:



 - Original Message -
  From: Martin Maechler maech...@stat.math.ethz.ch
  To: Kasper Daniel Hansen kasperdanielhan...@gmail.com
  Cc: bioc-devel@r-project.org
  Sent: Tuesday, December 3, 2013 8:13:55 AM
  Subject: Re: [Bioc-devel] Struggles with correct import .
 
   Kasper Daniel Hansen kasperdanielhan...@gmail.com
   on Wed, 20 Nov 2013 15:37:00 -0500 writes:
 
   Ok, I analyzed the package using codetoolsBioC and there
   were a number of missing imports, including what Leonardo
   has described.  I have fixed those in bumphunter 1.3.3
 
   Kasper
 
  Impressing and interesting.   I don't see  'codetoolsBioC' to be
  available via biocLite().
 
  What's the recommended way to have it among the bioconductor
  packages ?
 


 Check it out from svn:

 https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/codetoolsBioC/

 (username/password: readonly)

 The package has some issues and needs some attention; this is why it has
 not been released.
 It's still useful though.

 Dan


  Martin
 
   On Wed, Nov 20, 2013 at 3:28 PM, Kasper Daniel Hansen 
   kasperdanielhan...@gmail.com wrote:
 
   I'll have a look.
  
   Basically, issues such as this is never the end-users
   problem and is likely to either be caused by bumphunter
   not importing correctly (most likely) or IRanges not
   exporting correctly.
  
   Kasper
  
  
   On Wed, Nov 20, 2013 at 3:02 PM, Leonardo Collado Torres
lcoll...@jhsph.edu wrote:
  
   Hello,
  
   Found how to solve this. Basically, the NAMESPACE of the
   bumphunter package is not complete (I think).
  
   I downloaded
  
  
 http://bioconductor.org/packages/release/bioc/src/contrib/bumphunter_1.2.0.tar.gz
   , changed the version to 1.2.1 and added/modified the
   following lines to the NAMESPACE:
  
   importFrom(IRanges, IRanges, distance,
   distanceToNearest, subjectHits)
   importMethodsFrom(GenomicRanges, seqnames, sort, strand,
   elementMetadata)
  
   Once bumphunter was importing IRanges::distance, I got
   past the error I reported. Then I found other errors
   related to bumphunter not importing the GenomicRanges
   strand and elementMetadata functions, as well as the
   IRanges distanceToNearest, IRanges and subjectHits
   functions.
  
   Best, Leo
  
  
  
  
   On Wed, Nov 20, 2013 at 2:46 PM, Leonardo Collado Torres
lcoll...@jhsph.edu  wrote:
  
Hi Harris,
   
Answering your question from your first email, I do
   not think that it  would help if bumphunter exported
   matchGenes() or .matchGenes().
   
Currently by just importing annotateNearest(), R is
   correctly able to use  annotateNearest(), then
   .matchGenes(), and also nearestgene(). The problem  is
   that nearestgene() uses IRanges::distance() but that
   function is not  being found even after importing it.
   
So as far as I understand, everything should be
   working since the  NAMESPACE
   https://github.com/lcolladotor/derfinder/blob/v0.0.34/NAMESPACE
 has:
   
importFrom(bumphunter,annotateNearest) 
   importMethodsFrom(IRanges,distance) 
   importFrom(IRanges,distance)
   
That is why I am confused and do not know what is the
   cause of the problem.
   
   
One possible explanation could be that bumphunter's
   NAMESPACE
   
  
 https://hedgehog.fhcrc.org/bioconductor/trunk/madman/Rpacks/bumphunter/NAMESPACEdoesn't
import the IRanges::distance method.
   
   
   
Regarding your second email (quoted below), I do not
   import the  IRanges::nearest method, but it doesn't
   seem to be causing problems.  That  could be because
   bumphunter does import the IRanges::nearest method
   
If I comment out line 147 of 
  
 https://github.com/lcolladotor/derfinder/blob/v0.0.34/R/analyzeChr.R,
aka, comment out library(bumphunter) the example for
   analyzeChr() fails  with:
   
Error in withCallingHandlers(expr, warning =
   function(w)  invokeRestart(muffleWarning)) :  could
   not find function distance
   
So yes, I get the same error in real life and not only
   in CMD check.
   
   
Adding to the NAMESPACE the following line doesn't
   help either.
   
importMethodsFrom(IRanges,nearest)
   
   
   
   
Best,  Leo
   
   
   
On Wed, Nov 20, 2013 at 2:06 PM, Harris A. Jaffee
   h...@jhu.edu wrote:
   
In nearestgene(), before the call to distance, there
   is a