mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Merged in peterjc/galaxy-central/split_blast2 (pull request #41)
This commit is contained in:
@@ -104,13 +104,41 @@ class BlastXml( GenericXml ):
|
||||
for f in split_files:
|
||||
h = open(f)
|
||||
body = False
|
||||
header = []
|
||||
header = h.readline()
|
||||
if not header:
|
||||
out.close()
|
||||
h.close()
|
||||
raise ValueError("BLAST XML file %s was empty" % f)
|
||||
if header.strip() != '<?xml version="1.0"?>':
|
||||
out.write(header) #for diagnosis
|
||||
out.close()
|
||||
h.close()
|
||||
raise ValueError("%s is not an XML file!" % f)
|
||||
line = h.readline()
|
||||
header += line
|
||||
if line.strip() not in ['<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "http://www.ncbi.nlm.nih.gov/dtd/NCBI_BlastOutput.dtd">',
|
||||
'<!DOCTYPE BlastOutput PUBLIC "-//NCBI//NCBI BlastOutput/EN" "NCBI_BlastOutput.dtd">']:
|
||||
out.write(header) #for diagnosis
|
||||
out.close()
|
||||
h.close()
|
||||
raise ValueError("%s is not a BLAST XML file!" % f)
|
||||
while True:
|
||||
line = h.readline()
|
||||
header.append(line)
|
||||
if not line:
|
||||
out.write(header) #for diagnosis
|
||||
out.close()
|
||||
h.close()
|
||||
raise ValueError("BLAST XML file %s ended prematurely" % f)
|
||||
header += line
|
||||
if "<Iteration>" in line:
|
||||
break
|
||||
header = "".join(header)
|
||||
if len(header) > 10000:
|
||||
#Something has gone wrong, don't load too much into memory!
|
||||
#Write what we have to the merged file for diagnostics
|
||||
out.write(header)
|
||||
out.close()
|
||||
h.close()
|
||||
raise ValueError("BLAST XML file %s has too long a header!" % f)
|
||||
if "<BlastOutput>" not in header:
|
||||
out.close()
|
||||
h.close()
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import os, sys
|
||||
|
||||
msg = """ERROR: Your Python version is: %s
|
||||
Galaxy is currently supported on Python 2.4, 2.5 and 2.6. To run Galaxy,
|
||||
Galaxy is currently supported on Python 2.5, 2.6 and 2.7. To run Galaxy,
|
||||
please download and install a supported version from python.org. If a
|
||||
supported version is installed but is not your default, getgalaxy.org
|
||||
contains instructions on how to force Galaxy to use a different version.""" % sys.version[:3]
|
||||
|
||||
def check_python():
|
||||
try:
|
||||
assert sys.version_info[:2] >= ( 2, 4 ) and sys.version_info[:2] <= ( 2, 7 )
|
||||
assert sys.version_info[:2] >= ( 2, 5 ) and sys.version_info[:2] <= ( 2, 7 )
|
||||
except AssertionError:
|
||||
print >>sys.stderr, msg
|
||||
raise
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="ncbi_blastn_wrapper" name="NCBI BLAST+ blastn" version="0.0.11">
|
||||
<description>Search nucleotide database with nucleotide query sequence(s)</description>
|
||||
<!-- If job splitting is enabled, break up the query file into batches of 500 sequences -->
|
||||
<!-- If job splitting is enabled, break up the query file into four -->
|
||||
<parallelism method="multi" split_inputs="query" split_mode="number_of_parts" split_size="4" shared_inputs="subject" merge_outputs="output1"></parallelism>
|
||||
<version_command>blastn -version</version_command>
|
||||
<command interpreter="python">hide_stderr.py
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="ncbi_blastp_wrapper" name="NCBI BLAST+ blastp" version="0.0.11">
|
||||
<description>Search protein database with protein query sequence(s)</description>
|
||||
<!-- If job splitting is enabled, break up the query file into batches of 500 sequences -->
|
||||
<!-- If job splitting is enabled, break up the query file into four -->
|
||||
<parallelism method="multi" split_inputs="query" split_mode="number_of_parts" split_size="4" shared_inputs="subject" merge_outputs="output1"></parallelism>
|
||||
<version_command>blastp -version</version_command>
|
||||
<command interpreter="python">hide_stderr.py
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="ncbi_blastx_wrapper" name="NCBI BLAST+ blastx" version="0.0.11">
|
||||
<description>Search protein database with translated nucleotide query sequence(s)</description>
|
||||
<!-- If job splitting is enabled, break up the query file into batches of 500 sequences -->
|
||||
<!-- If job splitting is enabled, break up the query file into four -->
|
||||
<parallelism method="multi" split_inputs="query" split_mode="number_of_parts" split_size="4" shared_inputs="subject" merge_outputs="output1"></parallelism>
|
||||
<version_command>blastx -version</version_command>
|
||||
<command interpreter="python">hide_stderr.py
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="ncbi_tblastn_wrapper" name="NCBI BLAST+ tblastn" version="0.0.11">
|
||||
<description>Search translated nucleotide database with protein query sequence(s)</description>
|
||||
<!-- If job splitting is enabled, break up the query file into batches of 500 sequences -->
|
||||
<!-- If job splitting is enabled, break up the query file into four -->
|
||||
<parallelism method="multi" split_inputs="query" split_mode="number_of_parts" split_size="4" shared_inputs="subject" merge_outputs="output1"></parallelism>
|
||||
<version_command>tblastn -version</version_command>
|
||||
<command interpreter="python">hide_stderr.py
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<tool id="ncbi_tblastx_wrapper" name="NCBI BLAST+ tblastx" version="0.0.11">
|
||||
<description>Search translated nucleotide database with translated nucleotide query sequence(s)</description>
|
||||
<!-- If job splitting is enabled, break up the query file into batches of 500 sequences -->
|
||||
<!-- If job splitting is enabled, break up the query file into four -->
|
||||
<parallelism method="multi" split_inputs="query" split_mode="number_of_parts" split_size="4" shared_inputs="subject" merge_outputs="output1"></parallelism>
|
||||
<version_command>tblastx -version</version_command>
|
||||
<command interpreter="python">hide_stderr.py
|
||||
|
||||
Reference in New Issue
Block a user