diff cufflinks_wrapper.py @ 2:da11bfc10e81

Update to the new data table specification.
author Dave Bouvier <dave@bx.psu.edu>
date Wed, 04 Dec 2013 13:24:49 -0500
parents b50aacc8ae49
children 5346d5eea8b1
line wrap: on
line diff
--- a/cufflinks_wrapper.py	Tue Oct 01 15:12:55 2013 -0400
+++ b/cufflinks_wrapper.py	Wed Dec 04 13:24:49 2013 -0500
@@ -10,20 +10,6 @@
     sys.stderr.write( "%s\n" % msg )
     sys.exit()
     
-# Copied from sam_to_bam.py:
-def check_seq_file( dbkey, cached_seqs_pointer_file ):
-    seq_path = ''
-    for line in open( cached_seqs_pointer_file ):
-        line = line.rstrip( '\r\n' )
-        if line and not line.startswith( '#' ) and line.startswith( 'index' ):
-            fields = line.split( '\t' )
-            if len( fields ) < 3:
-                continue
-            if fields[1] == dbkey:
-                seq_path = fields[2].strip()
-                break
-    return seq_path
-	
 def __main__():
     #Parse Command Line
     parser = optparse.OptionParser()
@@ -53,8 +39,7 @@
 
     # Bias correction options.
     parser.add_option( '-b', dest='do_bias_correction', action="store_true", help='Providing Cufflinks with a multifasta file via this option instructs it to run our new bias detection and correction algorithm which can significantly improve accuracy of transcript abundance estimates.')
-    parser.add_option( '', '--dbkey', dest='dbkey', help='The build of the reference dataset' )
-    parser.add_option( '', '--index_dir', dest='index_dir', help='GALAXY_DATA_INDEX_DIR' )
+    parser.add_option( '', '--index', dest='index', help='The path of the reference genome' )
     parser.add_option( '', '--ref_file', dest='ref_file', help='The reference dataset from the history' )
     
     # Global model.
@@ -83,22 +68,16 @@
     
     # If doing bias correction, set/link to sequence file.
     if options.do_bias_correction:
-        if options.ref_file != 'None':
+        if options.ref_file:
             # Sequence data from history.
             # Create symbolic link to ref_file so that index will be created in working directory.
             seq_path = "ref.fa"
             os.symlink( options.ref_file, seq_path )
         else:
-            # Sequence data from loc file.
-            cached_seqs_pointer_file = os.path.join( options.index_dir, 'sam_fa_indices.loc' )
-            if not os.path.exists( cached_seqs_pointer_file ):
-                stop_err( 'The required file (%s) does not exist.' % cached_seqs_pointer_file )
-            # If found for the dbkey, seq_path will look something like /galaxy/data/equCab2/sam_index/equCab2.fa,
-            # and the equCab2.fa file will contain fasta sequences.
-            seq_path = check_seq_file( options.dbkey, cached_seqs_pointer_file )
-            if seq_path == '':
-                stop_err( 'No sequence data found for dbkey %s, so bias correction cannot be used.' % options.dbkey  )
-    
+            if not os.path.exists( options.index ):
+                stop_err( 'Reference genome %s not present, request it by reporting this error.' % options.index )
+            seq_path = options.index
+
     # Build command.
     
     # Base; always use quiet mode to avoid problems with storing log output.