@staticmethod<EOL><INDENT>def import_from_daa_file(daa_filename):<DEDENT>
<EOL>res = DiamondSearchResult()<EOL>res.fields = [<EOL>SequenceSearchResult.QUERY_ID_FIELD,<EOL>SequenceSearchResult.HIT_ID_FIELD,<EOL>SequenceSearchResult.PERCENT_ID_FIELD,<EOL>SequenceSearchResult.ALIGNMENT_LENGTH_FIELD,<EOL>SequenceSearchResult.MISMATCH_FIELD,<EOL>SequenceSearchResult.QUERY_FROM_FIELD,<EOL>SequenceSearchResult.QUERY_TO_FIELD,<EOL>SequenceSearchResult.HIT_FROM_FIELD,<EOL>SequenceSearchResult.HIT_TO_FIELD,<EOL>SequenceSearchResult.EVALUE_FIELD,<EOL>SequenceSearchResult.ALIGNMENT_BIT_SCORE,<EOL>SequenceSearchResult.ALIGNMENT_DIRECTION,<EOL>SequenceSearchResult.HMM_NAME_FIELD<EOL>]<EOL>cmd = "<STR_LIT>" % daa_filename<EOL>logging.debug("<STR_LIT>" % cmd)<EOL>process = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True)<EOL>stdout, stderr = process.communicate()<EOL>reader = csv.reader(stdout.decode('<STR_LIT:ascii>').splitlines(),<EOL>delimiter='<STR_LIT:\t>')<EOL>if process.returncode != <NUM_LIT:0>:<EOL><INDENT>raise Exception("<STR_LIT>" <EOL>"<STR_LIT>" % (cmd, stderr))<EOL><DEDENT>for row in reader:<EOL><INDENT>query_start = int(row[<NUM_LIT:6>])<EOL>query_end = int(row[<NUM_LIT:7>])<EOL>res.results.append([row[<NUM_LIT:0>],<EOL>row[<NUM_LIT:1>],<EOL>row[<NUM_LIT:2>],<EOL>row[<NUM_LIT:3>],<EOL>row[<NUM_LIT:4>],<EOL>query_start,<EOL>query_end,<EOL>int(row[<NUM_LIT:8>]),<EOL>int(row[<NUM_LIT:9>]),<EOL>row[<NUM_LIT:10>],<EOL>row[<NUM_LIT:11>],<EOL>query_start < query_end,<EOL>os.path.basename(daa_filename)<EOL>])<EOL><DEDENT>return res<EOL>
Generate new results object from the output of diamond blastx/p