Committing changes to 'extract genomic dna' tool - twobit file will be opened only once per job. (Courtesy: Gordon).

This commit is contained in:
Guruprasad Anada
2009-07-20 16:57:55 -04:00
parent 4e6b7d1cff
commit 0e29e97366
2 changed files with 6 additions and 7 deletions
+5 -6
View File
@@ -70,7 +70,8 @@ def __main__():
fout = open( output_filename, "w" )
warnings = []
warning = ''
twobitfile = None
for i, line in enumerate( open( input_filename ) ):
line = line.rstrip( '\r\n' )
if line and not line.startswith( "#" ):
@@ -118,12 +119,10 @@ def __main__():
invalid_line = line
continue
elif seq_path and os.path.isfile( seq_path ):
if chrom in twobits:
t = twobits[chrom]
else:
twobits[chrom] = t = bx.seq.twobit.TwoBitFile( file( seq_path ) )
if not(twobitfile):
twobitfile = bx.seq.twobit.TwoBitFile( file( seq_path ) )
try:
sequence = t[chrom][start:end]
sequence = twobitfile[chrom][start:end]
except:
warning = "Unable to fetch the sequence from '%d' to '%d' for build '%s'. " %( start, end-start, dbkey )
warnings.append( warning )
+1 -1
View File
@@ -1,4 +1,4 @@
<tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="2.1.0">
<tool id="Extract genomic DNA 1" name="Extract Genomic DNA" version="2.2.0">
<description>using coordinates from assembled/unassembled genomes</description>
<command interpreter="python">extract_genomic_dna.py $input $out_file1 -1 ${input.metadata.chromCol},${input.metadata.startCol},${input.metadata.endCol},${input.metadata.strandCol} -d $dbkey -o $out_format -g ${GALAXY_DATA_INDEX_DIR}</command>
<inputs>