mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merged in nsoranzo/galaxy-central (pull request #135)
Add generic ASN.1 text and binary datatypes
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
<registration converters_path="lib/galaxy/datatypes/converters" display_path="display_applications">
|
||||
<datatype extension="ab1" type="galaxy.datatypes.binary:Ab1" mimetype="application/octet-stream" display_in_upload="true"/>
|
||||
<datatype extension="afg" type="galaxy.datatypes.assembly:Amos" display_in_upload="false"/>
|
||||
<datatype extension="asn1" type="galaxy.datatypes.data:GenericAsn1" mimetype="text/plain" display_in_upload="true" />
|
||||
<datatype extension="asn1-binary" type="galaxy.datatypes.binary:GenericAsn1Binary" mimetype="application/octet-stream" display_in_upload="true" />
|
||||
<datatype extension="axt" type="galaxy.datatypes.sequence:Axt" display_in_upload="true"/>
|
||||
<datatype extension="fli" type="galaxy.datatypes.tabular:FeatureLocationIndex" display_in_upload="false"/>
|
||||
<datatype extension="bam" type="galaxy.datatypes.binary:Bam" mimetype="application/octet-stream" display_in_upload="true">
|
||||
|
||||
@@ -85,6 +85,12 @@ class Ab1( Binary ):
|
||||
|
||||
Binary.register_unsniffable_binary_ext("ab1")
|
||||
|
||||
class GenericAsn1Binary( Binary ):
|
||||
"""Class for generic ASN.1 binary format"""
|
||||
file_ext = "asn1-binary"
|
||||
|
||||
Binary.register_unsniffable_binary_ext("asn1-binary")
|
||||
|
||||
class Bam( Binary ):
|
||||
"""Class describing a BAM binary file"""
|
||||
file_ext = "bam"
|
||||
|
||||
@@ -739,6 +739,10 @@ class Text( Data ):
|
||||
f.close()
|
||||
split = classmethod(split)
|
||||
|
||||
class GenericAsn1( Text ):
|
||||
"""Class for generic ASN.1 text format"""
|
||||
file_ext = 'asn1'
|
||||
|
||||
class LineCount( Text ):
|
||||
"""
|
||||
Dataset contains a single line with a single integer that denotes the
|
||||
|
||||
@@ -247,7 +247,7 @@ def add_file( dataset, registry, json_file, output_path ):
|
||||
#binary_ok = False
|
||||
parts = dataset.name.split( "." )
|
||||
if len( parts ) > 1:
|
||||
ext = parts[1].strip().lower()
|
||||
ext = parts[-1].strip().lower()
|
||||
if not Binary.is_ext_unsniffable(ext):
|
||||
file_err( 'The uploaded binary file contains inappropriate content', dataset, json_file )
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user