trouble with rhdf5 and hdf5.datasets
5
0
Entering edit mode
Laurent Gautier ★ 2.3k
@laurent-gautier-29
Last seen 10.3 years ago
Dear all, I observed unexplainable things with rhdf5. I do not know if they could be avoided. I am trying to access datasets in a group using the function 'do.call' with "$" (since the name of the dataset will only be known at run-time)... and I have a hard time with that (example below). Does anybody have experience with that ? ## example from the help file > mad <- hdf5.open("microarray.h5") > # Create a new group inside the file > hdf5.group(mad,"chip1") > hdf5.dataset(mad$chip1,"raw", dim=c(534,534)) > > raw <- mad$chip1$raw > for(i in 1:534) + { raw[i,1:534] <- runif(534) } > > do.call("$", list("mad", "chip1")) NULL # uh, uh.... > mad$chip1 Name Type Date Comment [1] raw Dataset 21/07/2002 16:26 # let's try again... > do.call("$", list("mad", "chip1")) NULL > mad Name Type Date Comment [1] chip1 Group # show stopper > mad[[1]] Segmentation fault Thanks, Laurent -- -------------------------------------------------------------- Laurent Gautier CBS, Building 208, DTU PhD. Student DK-2800 Lyngby,Denmark tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent
rhdf5 rhdf5 • 1.7k views
ADD COMMENT
0
Entering edit mode
Byron Ellis ▴ 280
@byron-ellis-11
Last seen 10.3 years ago
You should be able to use the standard "[[" semantics when accessing groups or datasets under rhdf5. this elimnates the need for the "do.call" Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian Please finger bellis@hsph.harvard.edu for PGP keys On Sun, 21 Jul 2002, Laurent Gautier wrote: > Dear all, > > I observed unexplainable things with rhdf5. I do not > know if they could be avoided. > > I am trying to access datasets in a group using the > function 'do.call' with "$" (since the name of the > dataset will only be known at run-time)... and I have > a hard time with that (example below). Does anybody > have experience with that ? > > > ## example from the help file > > mad <- hdf5.open("microarray.h5") > > # Create a new group inside the file > > hdf5.group(mad,"chip1") > > hdf5.dataset(mad$chip1,"raw", dim=c(534,534)) > > > > raw <- mad$chip1$raw > > for(i in 1:534) > + { raw[i,1:534] <- runif(534) } > > > > > do.call("$", list("mad", "chip1")) > NULL > > # uh, uh.... > > > > mad$chip1 > Name Type Date Comment > [1] raw Dataset 21/07/2002 16:26 > > # let's try again... > > > do.call("$", list("mad", "chip1")) > NULL > > mad > Name Type Date Comment > [1] chip1 Group > > # show stopper > > > mad[[1]] > Segmentation fault > > > > > > Thanks, > > > > > Laurent > > > > > > > -- > -------------------------------------------------------------- > Laurent Gautier CBS, Building 208, DTU > PhD. Student DK-2800 Lyngby,Denmark > tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT
0
Entering edit mode
Byron Ellis ▴ 280
@byron-ellis-11
Last seen 10.3 years ago
Whoops, didn't scroll down that last bit...did you try mad[["chip1"]]? Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian Please finger bellis@hsph.harvard.edu for PGP keys On Sun, 21 Jul 2002, Laurent Gautier wrote: > Dear all, > > I observed unexplainable things with rhdf5. I do not > know if they could be avoided. > > I am trying to access datasets in a group using the > function 'do.call' with "$" (since the name of the > dataset will only be known at run-time)... and I have > a hard time with that (example below). Does anybody > have experience with that ? > > > ## example from the help file > > mad <- hdf5.open("microarray.h5") > > # Create a new group inside the file > > hdf5.group(mad,"chip1") > > hdf5.dataset(mad$chip1,"raw", dim=c(534,534)) > > > > raw <- mad$chip1$raw > > for(i in 1:534) > + { raw[i,1:534] <- runif(534) } > > > > > do.call("$", list("mad", "chip1")) > NULL > > # uh, uh.... > > > > mad$chip1 > Name Type Date Comment > [1] raw Dataset 21/07/2002 16:26 > > # let's try again... > > > do.call("$", list("mad", "chip1")) > NULL > > mad > Name Type Date Comment > [1] chip1 Group > > # show stopper > > > mad[[1]] > Segmentation fault > > > > > > Thanks, > > > > > Laurent > > > > > > > -- > -------------------------------------------------------------- > Laurent Gautier CBS, Building 208, DTU > PhD. Student DK-2800 Lyngby,Denmark > tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD COMMENT
0
Entering edit mode
@vincent-j-carey-jr-4
Last seen 3 months ago
United States
> > > > do.call("$", list("mad", "chip1")) > NULL here you want to refer to mad, not its name, do not use "mad" do.call("$", list(mad, "chip1")) should work also i have noted that there is a problem in some of the doc -- specifically the man page for hdf5.open -- that refers to hdf5.create.group. the latter has been supplanted, it seems, by hdf5.group. i did reproduce your segfault, that needs to be looked at. unfortunately the weather here is very nice....
ADD COMMENT
0
Entering edit mode
The problem, I believe, is that HDF5 makes no guarrantee about the ordering of the groups/datasets at any particular time (i.e. mad[[1]] today is not neccessarily mad[[1]] tomorrow). At the very least, though, I should go through and fix it so it fails gracefully :-) Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian Please finger bellis@hsph.harvard.edu for PGP keys On Sun, 21 Jul 2002, Vincent Carey 525-2265 wrote: > > > > > > do.call("$", list("mad", "chip1")) > > NULL > > here you want to refer to mad, not its name, do not use "mad" > > do.call("$", list(mad, "chip1")) > > should work > > also i have noted that there is a problem in some of the > doc -- specifically the man page for > hdf5.open -- that refers to hdf5.create.group. > the latter has been supplanted, it seems, by hdf5.group. > > i did reproduce your segfault, that needs to be looked at. > unfortunately the weather here is very nice.... > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY
0
Entering edit mode
Laurent Gautier ★ 2.3k
@laurent-gautier-29
Last seen 10.3 years ago
On Sun, Jul 21, 2002 at 10:17:28AM -0400, Byron Ellis wrote: > The problem, I believe, is that HDF5 makes no guarrantee about the > ordering of the groups/datasets at any particular time (i.e. mad[[1]] > today is not neccessarily mad[[1]] tomorrow). At the very least, though, I > should go through and fix it so it fails gracefully :-) while you are into the segfault side of things, you may also want to try the following: > hdf5.open(file("whatever")) Segmentation fault (I know, the user is not suppposed to do that, unless he/she read the help file in diagonal ;) (hey, did I ?)... but doing that generates a " > library(rhdf5) Error in firstlib(which.lib.loc, package) : not an HDF5 file Error in library(rhdf5) : .First.lib failed " at the next try) L. > > Byron Ellis (bellis@hsph.harvard.edu) > "Oook" - The Librarian > > Please finger bellis@hsph.harvard.edu for PGP keys > > On Sun, 21 Jul 2002, Vincent Carey 525-2265 wrote: > > > > > > > > > do.call("$", list("mad", "chip1")) > > > NULL > > > > here you want to refer to mad, not its name, do not use "mad" > > > > do.call("$", list(mad, "chip1")) > > > > should work > > > > also i have noted that there is a problem in some of the > > doc -- specifically the man page for > > hdf5.open -- that refers to hdf5.create.group. > > the latter has been supplanted, it seems, by hdf5.group. > > > > i did reproduce your segfault, that needs to be looked at. > > unfortunately the weather here is very nice.... > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor > > > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor -- -------------------------------------------------------------- Laurent Gautier CBS, Building 208, DTU PhD. Student DK-2800 Lyngby,Denmark tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent
ADD COMMENT
0
Entering edit mode
Laurent Gautier ★ 2.3k
@laurent-gautier-29
Last seen 10.3 years ago
On Sun, Jul 21, 2002 at 10:12:33AM -0400, Vincent Carey 525-2265 wrote: > > > > > > do.call("$", list("mad", "chip1")) > > NULL > > here you want to refer to mad, not its name, do not use "mad" > > do.call("$", list(mad, "chip1")) > > should work ... hohooo... it looks like it should be outside too (since I start to have dumb questions...) (unfortunately the weather is not particularly nice here) Thanks, L. > > also i have noted that there is a problem in some of the > doc -- specifically the man page for > hdf5.open -- that refers to hdf5.create.group. > the latter has been supplanted, it seems, by hdf5.group. > > i did reproduce your segfault, that needs to be looked at. > unfortunately the weather here is very nice.... > > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor -- -------------------------------------------------------------- Laurent Gautier CBS, Building 208, DTU PhD. Student DK-2800 Lyngby,Denmark tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent
ADD COMMENT
0
Entering edit mode
It was nice enough here that I spend the entire day on my motorcycle rather than working on this ;-) Byron Ellis (bellis@hsph.harvard.edu) "Oook" - The Librarian Please finger bellis@hsph.harvard.edu for PGP keys On Sun, 21 Jul 2002, Laurent Gautier wrote: > On Sun, Jul 21, 2002 at 10:12:33AM -0400, Vincent Carey 525-2265 wrote: > > > > > > > > do.call("$", list("mad", "chip1")) > > > NULL > > > > here you want to refer to mad, not its name, do not use "mad" > > > > do.call("$", list(mad, "chip1")) > > > > should work > > > ... hohooo... it looks like it should be outside too > (since I start to have dumb questions...) (unfortunately > the weather is not particularly nice here) > > > Thanks, > > > > L. > > > > > > > > also i have noted that there is a problem in some of the > > doc -- specifically the man page for > > hdf5.open -- that refers to hdf5.create.group. > > the latter has been supplanted, it seems, by hdf5.group. > > > > i did reproduce your segfault, that needs to be looked at. > > unfortunately the weather here is very nice.... > > > > _______________________________________________ > > Bioconductor mailing list > > Bioconductor@stat.math.ethz.ch > > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor > > -- > -------------------------------------------------------------- > Laurent Gautier CBS, Building 208, DTU > PhD. Student DK-2800 Lyngby,Denmark > tel: +45 45 25 24 85 http://www.cbs.dtu.dk/laurent > _______________________________________________ > Bioconductor mailing list > Bioconductor@stat.math.ethz.ch > http://www.stat.math.ethz.ch/mailman/listinfo/bioconductor >
ADD REPLY

Login before adding your answer.

Traffic: 450 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