changeset 2:36103afa0934 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/blastparser_and_hits commit 22ac2287a510708784dec78647afea4eff658f02
author artbio
date Tue, 19 Jun 2018 05:18:31 -0400
parents 9beb85dba280
children b4c9c085d709
files BlastParser_and_hits.py BlastParser_and_hits.xml
diffstat 2 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/BlastParser_and_hits.py	Fri Feb 16 04:54:52 2018 -0500
+++ b/BlastParser_and_hits.py	Tue Jun 19 05:18:31 2018 -0400
@@ -217,13 +217,16 @@
 
     F = open(F, "w")
     Fasta = open(Fasta, "w")
-    blasted_transcripts = []
+    blasted_transcripts = dict()
     filter_results(results, filter_relativeCov, filter_maxScore,
                    filter_meanScore, filter_term_in, filter_term_out)
     for subject in results:
         for transcript in Xblastdict[subject]:
-            blasted_transcripts.append(transcript)
-    blasted_transcripts = list(set(blasted_transcripts))
+            blasted_transcripts[transcript] = ">%s\n%s\n" % (transcript,
+                                                             insert_newlines(
+                                                                 fastadict[
+                                                                     transcript
+                                                                     ]))
     if mode == "verbose":
         F.write("--- %s ---\n" % dataset_name)
         F.write("# %s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n" % ("SeqId", "%Identity",
@@ -301,14 +304,11 @@
     F_matched = open(matched_sequences, "w")
     F_unmatched = open(unmatched_sequences, "w")
     for transcript in fastadict:
-        if transcript in blasted_transcripts:
-            ''''list of blasted_transcripts is generated
-            by the outputParsing function'''
-            F_matched.write(">%s\n%s\n" % (transcript, insert_newlines(
-                                           fastadict[transcript])))
-        else:
+        try:
+            F_matched.write(blasted_transcripts[transcript])
+        except KeyError:
             F_unmatched.write(">%s\n%s\n" % (transcript, insert_newlines(
-                                             fastadict[transcript])))
+                                            fastadict[transcript])))
     F_matched.close()
     F_unmatched.close()
     return
--- a/BlastParser_and_hits.xml	Fri Feb 16 04:54:52 2018 -0500
+++ b/BlastParser_and_hits.xml	Tue Jun 19 05:18:31 2018 -0400
@@ -1,4 +1,4 @@
-<tool id="BlastParser_and_hits" name="Parse blast output and compile hits" version="2.5.1">
+<tool id="BlastParser_and_hits" name="Parse blast output and compile hits" version="2.6.0">
 <description>for virus discovery</description>
 <requirements></requirements>
 <command><![CDATA[