mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-21 13:50:20 +08:00
Committing changes to 'extract genomic dna' tool - twobit file will be opened only once per job. (Courtesy: Gordon).
This commit is contained in:
@@ -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,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>
|
||||
|
||||
Reference in New Issue
Block a user