James Taylor avatar James Taylor committed 0b8c531

More import fixes

Comments (0)

Files changed (15)

interval_count_intersections.py

 
 import psyco_full
 
-from bx import align.maf
 from bx import intervals
 from bx import misc
 import string
 import psyco_full
 
 import sys
-from bx import align.maf
 
 def __main__():
 

maf_build_index.py

 from bx import interval_index_file
 import sys
 
-from bx import align.maf
+import bx.align.maf
 
 def main():
 
     except:
         cookbook.doc_optparse.exit()
 
-    maf_reader = align.maf.Reader( open( maf_file ) )
+    maf_reader = bx.align.maf.Reader( open( maf_file ) )
 
     indexes = interval_index_file.Indexes()
 
 usage = "usage: %prog chunk_size out_dir"
 
 import sys
-from bx import align.maf
 from optparse import OptionParser
+import bx.align.maf
 import psyco_full
 import random
 
     out_dir = args[1]
     prob = options.prob
 
-    maf_reader = align.maf.Reader( sys.stdin )
+    maf_reader = bx.align.maf.Reader( sys.stdin )
 
     maf_writer = None
 
             if prob: write_current_chunk = bool( random.random() <= prob )
             else: write_current_chunk = True
             if write_current_chunk:
-                maf_writer = align.maf.Writer( file( "%s/%09d.maf" % ( out_dir, current_chunk ), "w" ) )
+                maf_writer = bx.align.maf.Writer( file( "%s/%09d.maf" % ( out_dir, current_chunk ), "w" ) )
             else:
                 maf_writer = None
             count = 0
 import cookbook.doc_optparse
 import sys
 
-from bx import align.maf
+import bx.align.maf
 
 def __main__():
 
     except:
         cookbook.doc_optparse.exit()
 
-    maf_reader = align.maf.Reader( sys.stdin )
+    maf_reader = bx.align.maf.Reader( sys.stdin )
 
     count = 0
 

maf_drop_overlapping.py

 
 import cookbook.doc_optparse
 
-from bx import align.maf
+import bx.align.maf
 from bx import intervals
 import sys
 
 
     # Start MAF on stdout
 
-    out = align.maf.Writer( sys.stdout )
+    out = bx.align.maf.Writer( sys.stdout )
 
     # Iterate over input MAF
 
-    for maf in align.maf.Reader( sys.stdin ):
+    for maf in bx.align.maf.Reader( sys.stdin ):
         # Find overlap with reference component
         intersections = intersector.find( maf.components[0].start, maf.components[0].end )
         # Write only if no overlap

maf_extract_chrom_ranges.py

 
 import cookbook.doc_optparse
 
-from bx import align.maf
+import bx.align.maf
 from bx import intervals
 import sys
 
 
     # Start MAF on stdout
 
-    out = align.maf.Writer( sys.stdout )
+    out = bx.align.maf.Writer( sys.stdout )
 
     # Iterate over input MAF
 
-    for maf in align.maf.Reader( sys.stdin ):
+    for maf in bx.align.maf.Reader( sys.stdin ):
         ref_component = maf.components[ refindex ]
         # Find overlap with reference component
         if not ( ref_component.src in intersecters ): continue

maf_extract_ranges.py

 
 import cookbook.doc_optparse
 
-from bx import align.maf
+import bx.align.maf
 from bx import intervals
 import sys
 
 
     # Start MAF on stdout
 
-    out = align.maf.Writer( sys.stdout )
+    out = bx.align.maf.Writer( sys.stdout )
 
     # Iterate over input MAF
 
-    for maf in align.maf.Reader( sys.stdin ):
+    for maf in bx.align.maf.Reader( sys.stdin ):
         ref_component = maf.components[ refindex ]
         # Find overlap with reference component
         intersections = intersecter.find( ref_component.start, ref_component.end )

maf_gap_frequency.py

 from __future__ import division
 
 import sys
-from bx import align.maf
+import bx.align.maf
 
 
 def main():    
-    for m in align.maf.Reader( sys.stdin ):  
+    for m in bx.align.maf.Reader( sys.stdin ):  
         gaps = 0        
         for col in m.column_iter():
             if ( '-' in col ): gaps += 1          

maf_mean_length_ungapped_piece.py

 from __future__ import division
 
 import sys
-from bx import align.maf
+import bx.align.maf
 
 def main():
     
-    for m in align.maf.Reader( sys.stdin ):  
+    for m in bx.align.maf.Reader( sys.stdin ):  
     
         ungapped_columns = 0
         ungapped_runs = 0
 import psyco_full
 
 import sys
-from bx import align.maf
+import bx.align.maf
 
 def __main__():
 
     
     feature_vector = [ int( line ) for line in file( feature_file ) ]
 
-    maf_reader = align.maf.Reader( sys.stdin )
-    maf_writer = align.maf.Writer( sys.stdout )
+    maf_reader = bx.align.maf.Reader( sys.stdin )
+    maf_writer = bx.align.maf.Writer( sys.stdout )
 
     index = 0
 

maf_split_by_src.py

 usage = "usage: %prog"
 
 import sys, string
-from bx import align.maf
+import bx.align.maf
 from optparse import OptionParser
 
 import psyco_full
 
     out_prefix = options.outprefix
 
-    maf_reader = align.maf.Reader( sys.stdin )
+    maf_reader = bx.align.maf.Reader( sys.stdin )
 
     writers = {}
 
         writer_key = string.join( [ c.src for c in m.components ], '_' )
 
         if not writers.has_key( writer_key ):
-            writer = align.maf.Writer( file( "%s%s.maf" % ( out_prefix, writer_key ), "w" ) )
+            writer = bx.align.maf.Writer( file( "%s%s.maf" % ( out_prefix, writer_key ), "w" ) )
             writers[ writer_key ] = writer
         else:
             writer = writers[ writer_key ] 
 
 import cookbook.doc_optparse
 
-from bx import align.maf
+import bx.align.maf
 from bx import misc
-from bx import seq.nib
+import bx.seq.nib
 import os
 import string
 import sys
 
     sources = sys.argv[1].translate( tree_tx ).split()
     seq_db = load_seq_db( sys.argv[2] )
-    index = align.maf.MultiIndexed( sys.argv[3:] )
+    index = bx.align.maf.MultiIndexed( sys.argv[3:] )
 
-    out = align.maf.Writer( sys.stdout )
+    out = bx.align.maf.Writer( sys.stdout )
 
     for line in sys.stdin:
         ref_src, start, end = line.split()[0:3]
 
     for ss, ee, index in intervals_from_mask( mask ):
         if index < 0:
-            tiled[0].append( seq.nib.NibFile( open( seq_db[ ref.src ] ) ).get( start+ss, ee-ss ) )
+            tiled[0].append( bx.seq.nib.NibFile( open( seq_db[ ref.src ] ) ).get( start+ss, ee-ss ) )
             for row in tiled[1:]:
                 row.append( "*" * ( ee - ss ) )
         else:

maf_to_int_seqs.py

 
 from numarray import *
 
-from bx import align.maf
+import bx.align.maf
 from bx import alphabet
 from bx import seq_numarray
 import string
     else:
         alpha_map = None
 
-    for maf in align.maf.Reader( sys.stdin ):
+    for maf in bx.align.maf.Reader( sys.stdin ):
         # Translate alignment to ints
         int_seq = seq_numarray.DNA.translate_alignment( [ c.text for c in maf.components ] )
         # Apply mapping 
 import unittest
-from bx import align
-from bx import align.maf as maf
+import bx.align as align
+import bx.align.maf as maf
 
 from StringIO import StringIO
 
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.