# HG changeset patch # User Matt Shirley # Date 1369879699 14400 # Node ID 28fda763185755ff1d5b8b8adb0463849d600b1b # Parent ffdd41766195994ebae430b474965b3db8ecd24c minor fixes diff -r ffdd41766195 -r 28fda7631857 fastq_dump.xml --- a/fastq_dump.xml Tue Nov 27 13:44:28 2012 -0500 +++ b/fastq_dump.xml Wed May 29 22:08:19 2013 -0400 @@ -1,6 +1,6 @@ format reads from NCBI SRA. - ./fastq-dump --log-level fatal --report never --accession '${input.name}' --stdout $split $aligned '$input' > $output + fastq-dump --log-level fatal --report never --accession '${input.name}' --stdout $split $aligned '$input' > $output fastq-dump --version diff -r ffdd41766195 -r 28fda7631857 sra.py --- a/sra.py Tue Nov 27 13:44:28 2012 -0500 +++ b/sra.py Wed May 29 22:08:19 2013 -0400 @@ -10,37 +10,38 @@ from galaxy.datatypes.sniff import * from galaxy import eggs import pkg_resources -pkg_resources.require( "bx-python" ) +pkg_resources.require( 'bx-python' ) import os, subprocess, tempfile import struct class Sra( Binary ): """ Sequence Read Archive (SRA) """ - file_ext = "sra" + file_ext = 'sra' def __init__( self, **kwd ): Binary.__init__( self, **kwd ) def sniff( self, filename ): - # The first 8 bytes of any NCBI sra file is 'NCIB.sra', and the file is binary. EBI and DDBJ files may differ. For details - # about the format, see http://www.ncbi.nlm.nih.gov/books/n/helpsra/SRA_Overview_BK/#SRA_Overview_BK.4_SRA_Data_Structure + """ The first 8 bytes of any NCBI sra file is 'NCIB.sra', and the file is binary. Not sure if EBI and DDBJ files may differ. + For details about the format, see http://www.ncbi.nlm.nih.gov/books/n/helpsra/SRA_Overview_BK/#SRA_Overview_BK.4_SRA_Data_Structure + """ try: - header = open( filename ).read(8) - if binascii.b2a_hex( header ) == binascii.hexlify( 'NCBI.sra' ): + header = open(filename).read(8) + if binascii.b2a_hex(header) == binascii.hexlify('NCBI.sra'): return True return False except: return False - def set_peek( self, dataset, is_multi_byte=False ): + def set_peek(self, dataset, is_multi_byte=False): if not dataset.dataset.purged: - dataset.peek = "Binary sra file" - dataset.blurb = data.nice_size( dataset.get_size() ) + dataset.peek = 'Binary sra file' + dataset.blurb = data.nice_size(dataset.get_size()) else: dataset.peek = 'file does not exist' dataset.blurb = 'file purged from disk' - def display_peek( self, dataset ): + def display_peek(self, dataset): try: return dataset.peek except: - return "Binary sra file (%s)" % ( data.nice_size( dataset.get_size() ) ) + return 'Binary sra file (%s)' % ( data.nice_size(dataset.get_size())) -Binary.register_sniffable_binary_format("sra", "sra", Sra) +Binary.register_sniffable_binary_format('sra', 'sra', Sra)