Loading lib/galaxy/config/sample/datatypes_conf.xml.sample +2 −0 Original line number Diff line number Diff line Loading @@ -361,6 +361,7 @@ <datatype extension="fast5.tar.gz" type="galaxy.datatypes.binary:Fast5ArchiveGz" display_in_upload="true"/> <datatype extension="fast5.tar.bz2" type="galaxy.datatypes.binary:Fast5ArchiveBz2" display_in_upload="true"/> <datatype extension="fast5.tar.xz" type="galaxy.datatypes.binary:Fast5ArchiveXz" display_in_upload="true"/> <datatype extension="pod5" type="galaxy.datatypes.binary:Pod5" display_in_upload="true"/> <datatype extension="peptideshaker_archive" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/> <datatype extension="percin" type="galaxy.datatypes.tabular:Tabular" subclass="true"/> <datatype extension="percout" type="galaxy.datatypes.xml:GenericXml" subclass="true"/> Loading Loading @@ -1079,6 +1080,7 @@ <sniffer type="galaxy.datatypes.binary:Fast5ArchiveXz"/> <sniffer type="galaxy.datatypes.binary:Fast5ArchiveBz2"/> <sniffer type="galaxy.datatypes.binary:Fast5Archive"/> <sniffer type="galaxy.datatypes.binary:Pod5"/> <sniffer type="galaxy.datatypes.binary:Meryldb" /> <sniffer type="galaxy.datatypes.binary:Bref3" /> <sniffer type="galaxy.datatypes.binary:PostgresqlArchive"/> Loading lib/galaxy/datatypes/binary.py +25 −0 Original line number Diff line number Diff line Loading @@ -3759,6 +3759,31 @@ class Fast5ArchiveBz2(Fast5Archive): return Fast5Archive.sniff(self, filename) class Pod5(Binary): """ Class describing a POD5 file. The POD5 Format Specification is at https://pod5-file-format.readthedocs.io/en/latest/SPECIFICATION.html >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('test.pod5') >>> Pod5().sniff(fname) True >>> fname = get_test_fname('test.fast5.tar') >>> Pod5().sniff(fname) False """ file_ext = "pod5" def sniff(self, filename: str) -> bool: expected_signature = bytes([0x8B, 0x50, 0x4F, 0x44, 0x0D, 0x0A, 0x1A, 0x0A]) with open(filename, "rb") as f: first_8_bytes = f.read(8) f.seek(-8, 2) last_8_bytes = f.read(8) return first_8_bytes == expected_signature and last_8_bytes == expected_signature class SearchGuiArchive(CompressedArchive): """Class describing a SearchGUI archive""" Loading lib/galaxy/datatypes/test/test.pod5 0 → 100644 +18.4 KiB File added.No diff preview for this file type. View file Loading
lib/galaxy/config/sample/datatypes_conf.xml.sample +2 −0 Original line number Diff line number Diff line Loading @@ -361,6 +361,7 @@ <datatype extension="fast5.tar.gz" type="galaxy.datatypes.binary:Fast5ArchiveGz" display_in_upload="true"/> <datatype extension="fast5.tar.bz2" type="galaxy.datatypes.binary:Fast5ArchiveBz2" display_in_upload="true"/> <datatype extension="fast5.tar.xz" type="galaxy.datatypes.binary:Fast5ArchiveXz" display_in_upload="true"/> <datatype extension="pod5" type="galaxy.datatypes.binary:Pod5" display_in_upload="true"/> <datatype extension="peptideshaker_archive" type="galaxy.datatypes.binary:CompressedArchive" subclass="true" display_in_upload="true"/> <datatype extension="percin" type="galaxy.datatypes.tabular:Tabular" subclass="true"/> <datatype extension="percout" type="galaxy.datatypes.xml:GenericXml" subclass="true"/> Loading Loading @@ -1079,6 +1080,7 @@ <sniffer type="galaxy.datatypes.binary:Fast5ArchiveXz"/> <sniffer type="galaxy.datatypes.binary:Fast5ArchiveBz2"/> <sniffer type="galaxy.datatypes.binary:Fast5Archive"/> <sniffer type="galaxy.datatypes.binary:Pod5"/> <sniffer type="galaxy.datatypes.binary:Meryldb" /> <sniffer type="galaxy.datatypes.binary:Bref3" /> <sniffer type="galaxy.datatypes.binary:PostgresqlArchive"/> Loading
lib/galaxy/datatypes/binary.py +25 −0 Original line number Diff line number Diff line Loading @@ -3759,6 +3759,31 @@ class Fast5ArchiveBz2(Fast5Archive): return Fast5Archive.sniff(self, filename) class Pod5(Binary): """ Class describing a POD5 file. The POD5 Format Specification is at https://pod5-file-format.readthedocs.io/en/latest/SPECIFICATION.html >>> from galaxy.datatypes.sniff import get_test_fname >>> fname = get_test_fname('test.pod5') >>> Pod5().sniff(fname) True >>> fname = get_test_fname('test.fast5.tar') >>> Pod5().sniff(fname) False """ file_ext = "pod5" def sniff(self, filename: str) -> bool: expected_signature = bytes([0x8B, 0x50, 0x4F, 0x44, 0x0D, 0x0A, 0x1A, 0x0A]) with open(filename, "rb") as f: first_8_bytes = f.read(8) f.seek(-8, 2) last_8_bytes = f.read(8) return first_8_bytes == expected_signature and last_8_bytes == expected_signature class SearchGuiArchive(CompressedArchive): """Class describing a SearchGUI archive""" Loading
lib/galaxy/datatypes/test/test.pod5 0 → 100644 +18.4 KiB File added.No diff preview for this file type. View file