# HG changeset patch # User artbio # Date 1529399911 14400 # Node ID 36103afa0934d26aff4c20f18ecab82d2870be51 # Parent 9beb85dba28012ccdcd77944f9f9b7d09e48ed12 planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/blastparser_and_hits commit 22ac2287a510708784dec78647afea4eff658f02 diff -r 9beb85dba280 -r 36103afa0934 BlastParser_and_hits.py --- 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 diff -r 9beb85dba280 -r 36103afa0934 BlastParser_and_hits.xml --- 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 @@ - + for virus discovery