diff blast_to_scaffold.py @ 2:61731b911f4e draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/blast_to_scaffold commit e67f150062f2076d0879bcdd3376ef53ba639d91
author drosofff
date Fri, 25 Mar 2016 17:01:52 -0400
parents 7fb07a6ab968
children e279e53a3fde
line wrap: on
line diff
--- a/blast_to_scaffold.py	Fri Jan 15 12:35:45 2016 -0500
+++ b/blast_to_scaffold.py	Fri Mar 25 17:01:52 2016 -0400
@@ -30,6 +30,10 @@
         '--blast-tab', dest="blast_tab", action="store", type=str, help="13-columns tabular blastn or tblastx output")
     the_parser.add_argument(
         '--output', action="store", type=str, help="output file path, fasta format")
+    the_parser.add_argument(
+        '--scaffold_prefix', action="store", type=str, help="the prefix that will be used for the header of the fasta scaffold")
+    the_parser.add_argument(
+        '--scaffold_suffix', action="store", type=str, help="the sufix that will be used for the header of the fasta scaffold")
     args = the_parser.parse_args()
     return args
     
@@ -98,13 +102,13 @@
         for i, nucleotide in enumerate(sequence):
             GuideDict[i+subjectStart] = nucleotide
             
-def finalAssembly (GuideDict, outputfile):
+def finalAssembly (GuideDict, outputfile, prefix, suffix):
     finalSeqList = []
     for keys in sorted(GuideDict):
         finalSeqList.append(GuideDict[keys])
     finalSequence = insert_newlines("".join(finalSeqList) )
     Out = open (outputfile, "w")
-    print >> Out, ">Scaffold"
+    print >> Out, ">Scaffold_from_%s_guided_by_%s" % (prefix, suffix)
     print >> Out, finalSequence
     Out.close()
     
@@ -114,7 +118,7 @@
     GuideDict = myGuide (args.guideSequence)
     blastlist = blatnInfo(args.blast_tab)
     updateGuide(blastlist, GuideDict, ContigsDict)
-    finalAssembly(GuideDict, args.output)
+    finalAssembly(GuideDict, args.output, args.scaffold_prefix, args.scaffold_suffix)
 
 if __name__ == "__main__":
     __main__()