changeset 1:28fda7631857 draft

minor fixes
author Matt Shirley <mdshw5@gmail.com>
date Wed, 29 May 2013 22:08:19 -0400
parents ffdd41766195
children d529eff98834
files fastq_dump.xml sra.py
diffstat 2 files changed, 14 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
 <tool id="fastq_dump" name="Extract fastq" version="1.0.0">
   <description> format reads from NCBI SRA.</description>
-  <command>./fastq-dump --log-level fatal --report never --accession '${input.name}' --stdout $split $aligned '$input' > $output </command>
+  <command>fastq-dump --log-level fatal --report never --accession '${input.name}' --stdout $split $aligned '$input' > $output </command>
   <version_string>fastq-dump --version</version_string>
   <inputs>
     <param format="sra" name="input" type="data" label="sra archive"/>
--- 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)