Re: [Bioc-devel] IRanges - PartitioningByEnd not found when package method runs.

2016-01-13 Thread Hervé Pagès

Hi Ben, Martin,

On 01/13/2016 08:19 AM, Morgan, Martin wrote:

Hi Ben -- nice to see you over here ;)

You're using the release version of R (R-3.2.3) and presumably release versions 
of packages (my advice on placing sessionInfo() was a little too clever; you 
want your package loaded, so the versions of it's dependencies are apparent, so 
in a separate R maybe library(testRpkg); sessionInfo(); I'll update my support 
site post...).

At least for Bioconductor packages, you want to be using the 'devel' version of 
Bioconductor, and during the current release cycle that means the devel version 
of R.

Nonetheless, I started R-release, loaded the test package, ran the function, 
and looked at traceback()


library(testRpkg)
doit()

Error in end(PartitioningByEnd(x)) :
   error in evaluating the argument 'x' in selecting a method for function 'end': Error: 
could not find function "PartitioningByEnd"

traceback()

9: end(PartitioningByEnd(x))
8: .unlist_NL_subscript(i, x)
7: fast_path_FUN(x, i)
6: subset_List_by_List(x, i)
5: object[index]
4: object[index]
3: subsetSites(dna, 1:50)
2: subsetSites(dna, 1:50)
1: doit()

The suspect looks like .unlist_NL_subscript, so I went looking for it


getAnywhere(.unlist_NL_subscript)

A single object matching '.unlist_NL_subscript' was found
It was found in the following places
   namespace:S4Vectors
with value

function (i, x)
{
 offsets <- c(0L, end(PartitioningByEnd(x))[-length(x)])
 i <- i + offsets
 unlist(i, use.names = FALSE)
}


So S4Vectors wants to use PartitioningByEnd. I looked at it's NAMESPACE imports 
(actually I looked in the SVN repository...) for the packages it imports from...


names(getNamespaceImports("S4Vectors"))

[1] "base" "methods"  "utils""stats""stats4"
[6] "BiocGenerics"

and find that it does not import IRanges. So the problem is a bug in S4Vectors.

I don't see the problem in bioc-devel, and to see why I had to be a bit clever 
-- there is no error, so no opportunity to use traceback(). Instead, I used the 
advanced-but-flexible 'trace' function to set a tracer on PartioningByEnd, 
where the tracer is the 'recover' function...


trace(IRanges::PartitioningByEnd, tracer=recover)


So when PartioningByEnd is evalutated, R will get me the 'recover' prompt...

doit()

Tracing IRanges::PartitioningByEnd(x) on entry

Enter a frame number, or 0 to exit

  1: doit()
  2: subsetSites(dna, 1:50)
  3: subsetSites(dna, 1:50)
  4: object[index]
  5: object[index]
  6: subset_List_by_List(x, i)
  7: fast_path_FUN(x, i)
  8: .unlist_NL_subscript(i, x)
  9: end(IRanges::PartitioningByEnd(x))
10: IRanges::PartitioningByEnd(x)

Selection:

This shows me the call stack (looks almost identical, so I could have 'guessed' 
that I wanted to look at .unlist_NL_subscript again) and suggests that the code 
has been fixed to explicitly indicate where PartitioningByEnd comes from. This 
is confirmed by looking at the code definition


getAnywhere(".unlist_NL_subscript")

A single object matching '.unlist_NL_subscript' was found
It was found in the following places
   namespace:S4Vectors
with value

function (i, x)
{
 offsets <- c(0L, end(IRanges::PartitioningByEnd(x))[-length(x)])
 i <- i + offsets
 unlist(i, use.names = FALSE)
}


So this is a bug in S4Vectors, but fixed in Bioc-devel where new package 
development should be occurring.

I'll leave it to Herve or others to decide whether S4Vectors in release should 
be patched.


Michael fixed this in devel. Thanks Michael! I should probably backport
the fix to release.

@Ben: FWIW subsetting with an IntegerList subscript is much more
efficient than with an ordinary list:

index <- rep.int(IntegerList(index), length(object))
object[index]

It will make a big difference (e.g. 100x faster or more) if 'object' is
a DNAStringSet with tens of thousands of sequences.

Cheers,
H.



Thanks for the bug report!

Martin

From: Bioc-devel [bioc-devel-boun...@r-project.org] on behalf of Ben Ward 
(TGAC) [ben.w...@tgac.ac.uk]
Sent: Wednesday, January 13, 2016 10:57 AM
To: bioc-devel@r-project.org
Subject: [Bioc-devel] IRanges - PartitioningByEnd not found when package
method runs.

Hi All,

I am having an issue with an un-exported method in a package I am developing, 
the package imports Biostrings and IRanges.

I have created a minimal, reproducible example, (many many thanks to Martin 
Morgan for telling me how to do this) in this repo branch: 
https://github.com/Ward9250/testRpkg/tree/PartByEnd

The method, as you will see from the branch, is called subsetSites, and is 
supposed to cut a DNAString set down to only the sites/base positions indicated 
by a provided vector of integers. It does this by indexing the DNAStringSet 
with re.int.

If I try to run this however, it seems to fail, indicating that it cannot find 
the PartitioningByEnd function. This puzzles me as I know the function is part 
of IRanges, which is im

Re: [Bioc-devel] ncdf4 not installed on build machines

2016-01-13 Thread Dan Tenenbaum
Hi Stephanie,

ncdf4 did not install on zin2 because I needed to update netcdf. Thanks for 
reminding me this was necessary. 

On windows I believe the build system was installing ncdf4 from source and 
failing because it doesn't know where netcdf.h is located on moscato2. However 
a binary install of ncdf4 works, so I will ensure that that is what the build 
system does.


Dan


- Original Message -
> From: "Stephanie M. Gogarten" 
> To: "bioc-devel" 
> Sent: Wednesday, January 13, 2016 2:26:38 PM
> Subject: [Bioc-devel] ncdf4 not installed on build machines

> How long does it usually take for a new package added to Imports to
> become available on the build machines? I updated GWASTools on January 4
> to depend on ncdf4 instead of ncdf, but the build report for 2/3
> machines still says "ncdf4 not available".
> 
> thanks,
> Stephanie
> 
> ___
> Bioc-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel

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


[Bioc-devel] ncdf4 not installed on build machines

2016-01-13 Thread Stephanie M. Gogarten
How long does it usually take for a new package added to Imports to 
become available on the build machines? I updated GWASTools on January 4 
to depend on ncdf4 instead of ncdf, but the build report for 2/3 
machines still says "ncdf4 not available".


thanks,
Stephanie

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


Re: [Bioc-devel] IRanges - PartitioningByEnd not found when package method runs.

2016-01-13 Thread Morgan, Martin
Hi Ben -- nice to see you over here ;)

You're using the release version of R (R-3.2.3) and presumably release versions 
of packages (my advice on placing sessionInfo() was a little too clever; you 
want your package loaded, so the versions of it's dependencies are apparent, so 
in a separate R maybe library(testRpkg); sessionInfo(); I'll update my support 
site post...).

At least for Bioconductor packages, you want to be using the 'devel' version of 
Bioconductor, and during the current release cycle that means the devel version 
of R.

Nonetheless, I started R-release, loaded the test package, ran the function, 
and looked at traceback()

> library(testRpkg)
> doit()
Error in end(PartitioningByEnd(x)) : 
  error in evaluating the argument 'x' in selecting a method for function 
'end': Error: could not find function "PartitioningByEnd"
> traceback()
9: end(PartitioningByEnd(x))
8: .unlist_NL_subscript(i, x)
7: fast_path_FUN(x, i)
6: subset_List_by_List(x, i)
5: object[index]
4: object[index]
3: subsetSites(dna, 1:50)
2: subsetSites(dna, 1:50)
1: doit()

The suspect looks like .unlist_NL_subscript, so I went looking for it

> getAnywhere(.unlist_NL_subscript)
A single object matching '.unlist_NL_subscript' was found
It was found in the following places
  namespace:S4Vectors
with value

function (i, x) 
{
offsets <- c(0L, end(PartitioningByEnd(x))[-length(x)])
i <- i + offsets
unlist(i, use.names = FALSE)
}


So S4Vectors wants to use PartitioningByEnd. I looked at it's NAMESPACE imports 
(actually I looked in the SVN repository...) for the packages it imports from...

> names(getNamespaceImports("S4Vectors"))
[1] "base" "methods"  "utils""stats""stats4"  
[6] "BiocGenerics"

and find that it does not import IRanges. So the problem is a bug in S4Vectors.

I don't see the problem in bioc-devel, and to see why I had to be a bit clever 
-- there is no error, so no opportunity to use traceback(). Instead, I used the 
advanced-but-flexible 'trace' function to set a tracer on PartioningByEnd, 
where the tracer is the 'recover' function...

> trace(IRanges::PartitioningByEnd, tracer=recover)

So when PartioningByEnd is evalutated, R will get me the 'recover' prompt... 
> doit()
Tracing IRanges::PartitioningByEnd(x) on entry 

Enter a frame number, or 0 to exit   

 1: doit()
 2: subsetSites(dna, 1:50)
 3: subsetSites(dna, 1:50)
 4: object[index]
 5: object[index]
 6: subset_List_by_List(x, i)
 7: fast_path_FUN(x, i)
 8: .unlist_NL_subscript(i, x)
 9: end(IRanges::PartitioningByEnd(x))
10: IRanges::PartitioningByEnd(x)

Selection: 

This shows me the call stack (looks almost identical, so I could have 'guessed' 
that I wanted to look at .unlist_NL_subscript again) and suggests that the code 
has been fixed to explicitly indicate where PartitioningByEnd comes from. This 
is confirmed by looking at the code definition

> getAnywhere(".unlist_NL_subscript")
A single object matching '.unlist_NL_subscript' was found
It was found in the following places
  namespace:S4Vectors
with value

function (i, x) 
{
offsets <- c(0L, end(IRanges::PartitioningByEnd(x))[-length(x)])
i <- i + offsets
unlist(i, use.names = FALSE)
}


So this is a bug in S4Vectors, but fixed in Bioc-devel where new package 
development should be occurring.

I'll leave it to Herve or others to decide whether S4Vectors in release should 
be patched.

Thanks for the bug report!

Martin

From: Bioc-devel [bioc-devel-boun...@r-project.org] on behalf of Ben Ward 
(TGAC) [ben.w...@tgac.ac.uk]
Sent: Wednesday, January 13, 2016 10:57 AM
To: bioc-devel@r-project.org
Subject: [Bioc-devel] IRanges - PartitioningByEnd not found when package
method runs.

Hi All,

I am having an issue with an un-exported method in a package I am developing, 
the package imports Biostrings and IRanges.

I have created a minimal, reproducible example, (many many thanks to Martin 
Morgan for telling me how to do this) in this repo branch: 
https://github.com/Ward9250/testRpkg/tree/PartByEnd

The method, as you will see from the branch, is called subsetSites, and is 
supposed to cut a DNAString set down to only the sites/base positions indicated 
by a provided vector of integers. It does this by indexing the DNAStringSet 
with re.int.

If I try to run this however, it seems to fail, indicating that it cannot find 
the PartitioningByEnd function. This puzzles me as I know the function is part 
of IRanges, which is imported in the package, and I would assume Biostrings 
would import any IRanges functionality it needed for the DNAStringSet indexing 
operator.

Below is an example run of what I see, and my session info.

If anyone can see what my issue is or knows how to solve this it would be a big 
help.

Many Thanks,
Ben W.


bward@n78620:/tmp$ git clone g...@github.com:ward9250/testRpkg.git -b PartByEnd
Cloning into 'testRpkg'...
remote: Counting objects: 18, done.
remote: Compressing 

[Bioc-devel] IRanges - PartitioningByEnd not found when package method runs.

2016-01-13 Thread Ben Ward (TGAC)
Hi All,

I am having an issue with an un-exported method in a package I am developing, 
the package imports Biostrings and IRanges.

I have created a minimal, reproducible example, (many many thanks to Martin 
Morgan for telling me how to do this) in this repo branch: 
https://github.com/Ward9250/testRpkg/tree/PartByEnd

The method, as you will see from the branch, is called subsetSites, and is 
supposed to cut a DNAString set down to only the sites/base positions indicated 
by a provided vector of integers. It does this by indexing the DNAStringSet 
with re.int.

If I try to run this however, it seems to fail, indicating that it cannot find 
the PartitioningByEnd function. This puzzles me as I know the function is part 
of IRanges, which is imported in the package, and I would assume Biostrings 
would import any IRanges functionality it needed for the DNAStringSet indexing 
operator.

Below is an example run of what I see, and my session info.

If anyone can see what my issue is or knows how to solve this it would be a big 
help.

Many Thanks,
Ben W.


bward@n78620:/tmp$ git clone g...@github.com:ward9250/testRpkg.git -b PartByEnd
Cloning into 'testRpkg'...
remote: Counting objects: 18, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 18 (delta 1), reused 18 (delta 1), pack-reused 0
Receiving objects: 100% (18/18), done.
Resolving deltas: 100% (1/1), done.
Checking connectivity... done.
bward@n78620:/tmp$ cd testRpkg
bward@n78620:/tmp/testRpkg$ R CMD INSTALL .
* installing to library 
�/usr/users/TGAC_ga002/bward/R/x86_64-pc-linux-gnu-library/3.2�
* installing *source* package �testRpkg� ...
** R
** preparing package for lazy loading
** help
No man pages found in package  �testRpkg�
*** installing help indices
** building package indices
** testing if installed package can be loaded
* DONE (testRpkg)
bward@n78620:/tmp/testRpkg$ R --vanilla -e "sessionInfo(); testRpkg::doit()"
R version 3.2.3 (2015-12-10) -- "Wooden Christmas-Tree"
Copyright (C) 2015 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> sessionInfo(); testRpkg::doit()
R version 3.2.3 (2015-12-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.3 LTS

locale:
 [1] LC_CTYPE=en_GB.UTF-8   LC_NUMERIC=C
 [3] LC_TIME=en_GB.UTF-8LC_COLLATE=en_GB.UTF-8
 [5] LC_MONETARY=en_GB.UTF-8LC_MESSAGES=en_GB.UTF-8
 [7] LC_PAPER=en_GB.UTF-8   LC_NAME=C
 [9] LC_ADDRESS=C   LC_TELEPHONE=C
[11] LC_MEASUREMENT=en_GB.UTF-8 LC_IDENTIFICATION=C

attached base packages:
[1] stats graphics  grDevices utils datasets  methods   base
Error in end(PartitioningByEnd(x)) :
  error in evaluating the argument 'x' in selecting a method for function 
'end': Error: could not find function "PartitioningByEnd"
Calls:  ... subset_List_by_List -> fast_path_FUN -> 
.unlist_NL_subscript -> end
Execution halted



[[alternative HTML version deleted]]

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