mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-10-28 02:58:18 +08:00
add vel datatype,register and example
This commit is contained in:
@@ -575,6 +575,7 @@
|
||||
<datatype extension="pdbqt" type="galaxy.datatypes.molecules:PDBQT" display_in_upload="true"/>
|
||||
<datatype extension="trr" type="galaxy.datatypes.binary:Trr" display_in_upload="true"/>
|
||||
<datatype extension="dcd" type="galaxy.datatypes.binary:Dcd" display_in_upload="true"/>
|
||||
<datatype extension="vel" type="galaxy.datatypes.binary:Vel" display_in_upload="true"/>
|
||||
<datatype extension="grd" type="galaxy.datatypes.molecules:grd" display_in_upload="true"/>
|
||||
<datatype extension="grd.tgz" type="galaxy.datatypes.molecules:grdtgz" display_in_upload="true"/>
|
||||
<!-- mothur formats -->
|
||||
@@ -727,6 +728,7 @@
|
||||
<sniffer type="galaxy.datatypes.binary:Idat"/>
|
||||
<sniffer type="galaxy.datatypes.binary:Trr"/>
|
||||
<sniffer type="galaxy.datatypes.binary:Dcd"/>
|
||||
<sniffer type="galaxy.datatypes.binary:Vel"/>
|
||||
<sniffer type="galaxy.datatypes.annotation:Augustus"/>
|
||||
<sniffer type="galaxy.datatypes.triples:Rdf"/>
|
||||
<sniffer type="galaxy.datatypes.blast:BlastXml"/>
|
||||
|
||||
@@ -1959,6 +1959,58 @@ class Dcd(Binary):
|
||||
return "Binary CHARMM/NAMD dcd file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
class Vel(Binary):
|
||||
"""
|
||||
Class describing a velocity file from the CHARMM molecular simulation program
|
||||
|
||||
>>> from galaxy.datatypes.sniff import get_test_fname
|
||||
>>> fname = get_test_fname('test_charmm.vel')
|
||||
>>> Vel().sniff(fname)
|
||||
True
|
||||
>>> fname = get_test_fname('interval.interval')
|
||||
>>> Vel().sniff(fname)
|
||||
False
|
||||
"""
|
||||
file_ext = "vel"
|
||||
edam_format = "format_3842" # molecular simulation data
|
||||
|
||||
def __init__(self, **kwd):
|
||||
Binary.__init__(self, **kwd)
|
||||
self._magic_number = b'VELD'
|
||||
|
||||
def sniff(self, filename):
|
||||
# Match the keyword 'VELD' at position 4 or 8 - intsize dependent
|
||||
# Not checking for endianness
|
||||
try:
|
||||
with open(filename, 'rb') as header:
|
||||
intsize = 4
|
||||
header.seek(intsize)
|
||||
if header.read(intsize) == self._magic_number:
|
||||
return True
|
||||
else:
|
||||
intsize = 8
|
||||
header.seek(intsize)
|
||||
if header.read(intsize) == self._magic_number:
|
||||
return True
|
||||
return False
|
||||
except Exception:
|
||||
return False
|
||||
|
||||
def set_peek(self, dataset, is_multi_byte=False):
|
||||
if not dataset.dataset.purged:
|
||||
dataset.peek = "Binary CHARMM velocity 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 "Binary CHARMM velocity file (%s)" % (nice_size(dataset.get_size()))
|
||||
|
||||
|
||||
class DAA(Binary):
|
||||
"""
|
||||
Class describing an DAA (diamond alignment archive) file
|
||||
|
||||
Executable
BIN
Binary file not shown.
Reference in New Issue
Block a user