[Bioc-devel] rhdf5 and left-justified output in h5ls - is this sensible?

Aaron Lun alun at wehi.edu.au
Tue Apr 12 21:56:53 CEST 2016


> Sorry for any inconvenience. I just wanted to change ‘aesthetics’, but
> not ‘expected behaviour of the function’.
> I moved the format call from h5ls to the show method.

Ah, aesthetics. My old arch-nemesis...

> Will be effective in version 2.15.7 from tomorrow on.

The function works great now, thanks.

- Aaron

> On 08.04.2016, at 10:15, Aaron Lun <alun at wehi.edu.au<mailto:alun at wehi.edu.au>> wrote:
>
> Dear List, Bernd;
>
> I've noticed that h5ls now left-justifies its output. For example, if I
> were to run example(h5ls) on my BioC-devel system, I would get:
>
>   group   name         ltype corder_valid corder cset       otype num_attrs
> 0  /    foo    H5L_TYPE_HARD        FALSE      0    0 H5I_GROUP           0
> 1  /foo B      H5L_TYPE_HARD        FALSE      0    0 H5I_DATASET         0
> 2  /foo foobaa H5L_TYPE_HARD        FALSE      0    0 H5I_GROUP           0
>   dclass          dtype  stype rank       dim    maxdim
> 0                                 0
> 1  FLOAT H5T_IEEE_F64LE SIMPLE    3 5 x 2 x 2 5 x 2 x 2
> 2                                 0
>
> ... whereas if I run it on release, I would get:
>
>   group   name         ltype corder_valid corder cset       otype num_attrs
> 0     /    foo H5L_TYPE_HARD        FALSE      0    0   H5I_GROUP         0
> 1  /foo      B H5L_TYPE_HARD        FALSE      0    0 H5I_DATASET         0
> 2  /foo foobaa H5L_TYPE_HARD        FALSE      0    0   H5I_GROUP         0
>   dclass          dtype  stype rank       dim    maxdim
> 0                                 0
> 1  FLOAT H5T_IEEE_F64LE SIMPLE    3 5 x 2 x 2 5 x 2 x 2
> 2                                 0
>
> Now, my problem is that I use h5ls to determine what data substructures
> are available in a particular *.h5 file, and how I should load them with
> h5read. I can do this on release:
>
> x <- h5ls("ex_ls_dump.h5",all=TRUE)
> h5read("ex_ls_dump.h5", file.path(x$group[2], x$name[2]))
> # gives me the data under /foo/B
>
> ... but not on BioC-devel:
>
> Error in h5read("ex_ls_dump.h5", file.path(x$group[2], x$name[2])) :
>   Object /foo/B      does not exist in this HDF5 file.
>
> ... due to the extra spaces. Suffice to say that it was a rather
> unpleasant surprise to get at 2am in the morning!
>
> I can't see any purpose of the left-justification except for aesthetics.
> Is it sensible to compromise the expected behaviour of the function just
> to make its output look pretty?
>
> Here's the session information for my devel build:
>
> R Under development (unstable) (2016-02-24 r70217)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 14.04.4 LTS
>
> locale:
> [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
> [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
> [5] LC_MONETARY=en_GB.UTF-8    LC_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
>
> other attached packages:
> [1] rhdf5_2.15.6
>
> loaded via a namespace (and not attached):
> [1] zlibbioc_1.17.1 tools_3.3.0
>
> ... and again, for release:
>
> R version 3.2.2 (2015-08-14)
> Platform: x86_64-pc-linux-gnu (64-bit)
> Running under: Ubuntu 14.04.4 LTS
>
> locale:
> [1] LC_CTYPE=en_GB.UTF-8       LC_NUMERIC=C
> [3] LC_TIME=en_GB.UTF-8        LC_COLLATE=en_GB.UTF-8
> [5] LC_MONETARY=en_GB.UTF-8    LC_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
>
> other attached packages:
> [1] rhdf5_2.14.0
>
> loaded via a namespace (and not attached):
> [1] zlibbioc_1.16.0 tools_3.2.2
>
> Cheers,
>
> Aaron
>
> _______________________________________________
> Bioc-devel at r-project.org<mailto:Bioc-devel at r-project.org> mailing list
> https://stat.ethz.ch/mailman/listinfo/bioc-devel
>
>>
> Bernd Fischer
> Computational Genome Biology / B210
> group leader
>
> German Cancer Research Center (DKFZ)
> Foundation under Public Law
> Im Neuenheimer Feld 580
> 69120 Heidelberg
> Germany
> phone: +49 6221 42-1280
> fax:      +49 6221 42-1289
> b.fischer at dkfz.de<mailto:b.fischer at dkfz.de>
> http://www.dkfz.de/en/computational-genome-biology
> Management Board: Prof. Dr. Michael Boutros (interim), Prof. Dr. Josef Puchta
> VAT-ID No.: DE143293537
>



More information about the Bioc-devel mailing list