diff --git a/lib/galaxy/config/sample/datatypes_conf.xml.sample b/lib/galaxy/config/sample/datatypes_conf.xml.sample
index 48060f2f97d..1c492509282 100644
--- a/lib/galaxy/config/sample/datatypes_conf.xml.sample
+++ b/lib/galaxy/config/sample/datatypes_conf.xml.sample
@@ -272,6 +272,7 @@
+
@@ -935,6 +936,7 @@
+
diff --git a/lib/galaxy/datatypes/binary.py b/lib/galaxy/datatypes/binary.py
index e6578e0c0e3..25bfe652b33 100644
--- a/lib/galaxy/datatypes/binary.py
+++ b/lib/galaxy/datatypes/binary.py
@@ -236,6 +236,33 @@ class Meryldb(CompressedArchive):
return False
+class Bref3(Binary):
+ """Bref3 format is a binary format for storing phased, non-missing genotypes for a list of samples."""
+
+ file_ext = "bref3"
+
+ def __init__(self, **kwd):
+ super().__init__(**kwd)
+ self._magic = binascii.unhexlify("7a8874f400156272")
+
+ def sniff_prefix(self, sniff_prefix):
+ return sniff_prefix.startswith_bytes(self._magic)
+
+ def set_peek(self, dataset, is_multi_byte=False):
+ if not dataset.dataset.purged:
+ dataset.peek = "Binary bref3 file"
+ dataset.blurb = nice_size(dataset.get_size())
+ else:
+ dataset.peek = 'file does not exist'
+ dataset.blurb = 'file purged from disk'
+
+ def display_peek(self, dataset):
+ try:
+ return dataset.peek
+ except Exception:
+ return f"Binary bref3 file ({nice_size(dataset.get_size())})"
+
+
class DynamicCompressedArchive(CompressedArchive):
def matches_any(self, target_datatypes):
diff --git a/lib/galaxy/datatypes/test/ref.bref3 b/lib/galaxy/datatypes/test/ref.bref3
new file mode 100644
index 00000000000..3225ac6c67a
Binary files /dev/null and b/lib/galaxy/datatypes/test/ref.bref3 differ