Hi Byrn,
Thanks for your reply. I’ve tried hdiff 1.10.7 and can see --exclude-attribute
is now supported. However, I am having trouble getting it to work. I have an HDF5 file of structure (I’ve excised non-relevant detail and replaced it with ...
):
HDF5 "vignette/output/WTnone/WTnone.h5" {
GROUP "/" {
GROUP "YAL068C" {
...
}
...
GROUP "YAL001C" {
GROUP "vignette" {
GROUP "reads" {
ATTRIBUTE "buffer_left" { ... }
ATTRIBUTE "buffer_right" { ... }
ATTRIBUTE "lengths" { ... }
ATTRIBUTE "reads_by_len" { ... }
ATTRIBUTE "reads_total" { ... }
ATTRIBUTE "start_codon_pos" { ... }
ATTRIBUTE "stop_codon_pos" { ... }
DATASET "data" {
DATA {
(0,0): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
(0,18): 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
...
(3982,34): 0, 0, 0, 0, 0, 0, 0
}
ATTRIBUTE "rhdf5-NA.OK" {
DATATYPE H5T_STD_I32LE
DATASPACE SIMPLE { ( 1 ) / ( 1 ) }
DATA {
(0): 1
}
}
}
}
}
}
}
}
The version of rhdf5 used determines if ATTRIBUTE "rhdf5-NA.OK"
is present or not in the file. I want to ignore this attribute when comparing files created using different versions of rhdf. I’ve tried different alternatives but to no avail:
Ignore attribute for YAL001C group’s data
only, specifying absolute path to attribute:
$ ../hdf5-1.10.7-linux-centos7-x86_64-gcc485-shared/bin/h5diff -v2 --exclude-attribute "/YAL001C/vignette/reads/data/rhdf5-NA.OK" /home/ubuntu/test-data-20210618/output/WTnone/WTnone.h5 vignette/output/WTnone/WTnone.h5 /YAL001C/vignette/reads/data
dataset: </YAL001C/vignette/reads/data> and </YAL001C/vignette/reads/data>
0 differences found
obj1 obj2
--------------------------------------
x rhdf5-NA.OK
Attributes status: 0 common, 0 only in obj1, 1 only in obj2
Ignore attribute for YAL001C group’s data
only, specifying relative path to attribute:
$ ../hdf5-1.10.7-linux-centos7-x86_64-gcc485-shared/bin/h5diff -v2 --exclude-attribute "rhdf5-NA.OK" /home/ubuntu/test-data-20210618/output/WTnone/WTnone.h5 vignette/output/WTnone/WTnone.h5 /YAL001C/vignette/reads/data
dataset: </YAL001C/vignette/reads/data> and </YAL001C/vignette/reads/data>
0 differences found
obj1 obj2
--------------------------------------
x rhdf5-NA.OK
Attributes status: 0 common, 0 only in obj1, 1 only in obj2
Ignore attribute for YAL001C group, specifying absolute path to attribute:
../hdf5-1.10.7-linux-centos7-x86_64-gcc485-shared/bin/h5diff -v2 --exclude-attribute "/YAL001C/vignette/reads/data/rhdf5-NA.OK" /home/ubuntu/test-data-20210618/output/WTnone/WTnone.h5 vignette/output/WTnone/WTnone.h5 /YAL001C
...
dataset: </YAL001C/vignette/reads/data> and </YAL001C/vignette/reads/data>
0 differences found
obj1 obj2
--------------------------------------
x rhdf5-NA.OK
Attributes status: 0 common, 0 only in obj1, 1 only in obj2
Ignore attribute for YAL001C group, specifying relative path to attribute:
$ ../hdf5-1.10.7-linux-centos7-x86_64-gcc485-shared/bin/h5diff -v2 --exclude-attribute "rhdf5-NA.OK" /home/ubuntu/test-data-20210618/output/WTnone/WTnone.h5 vignette/output/WTnone/WTnone.h5 /YAL001C
dataset: </YAL001C/vignette/reads/data> and </YAL001C/vignette/reads/data>
0 differences found
obj1 obj2
--------------------------------------
x rhdf5-NA.OK
Attributes status: 0 common, 0 only in obj1, 1 only in obj2
Compare all groups, specifying relative path to attribute:
$ ../hdf5-1.10.7-linux-centos7-x86_64-gcc485-shared/bin/h5diff --exclude-attribute "rhdf5-NA.OK" /home/ubuntu/test-data-20210618/output/WTnone/WTnone.h5 vignette/output/WTnone/WTnone.h5
$ echo $?
1
Any hints would be most welcome, and apologies if I’ve missed or misinterpreted something.
thanks and best wishes,
mike