@@ -0,0 +1,1926 @@
+import os%0Aimport shutil%0Aimport glob%0Aimport sys%0Afrom optparse import OptionParser%0Aimport argparse%0A%0A%0A%0A%0A%0Aclass Options(argparse.ArgumentParser):%0A    def  __init__(self, prog=%22sequana_taxonomy%22):%0A        usage = %22%22%22Welcome to SEQUANA - Taxonomy standalone%0A%0A            sequana_taxonomy --file1 R1.fastq --file2 R2.fastq --database db%0A%0AAUTHORS: Thomas Cokelaer%0ADocumentation: http://sequana.readthedocs.io%0AIssues: http://github.com/sequana/sequana%0A        %22%22%22%0A        description = %22%22%22DESCRIPTION:%0A        %22%22%22%0A%0A        super(Options, self).__init__(usage=usage, prog=prog,%0A                description=description)%0A%0A        # options to fill the config file%0A        self.add_argument(%22--file1%22, dest=%22file1%22, type=str,%0A            help=%22%22%22R1 fastq file (zipped) %22%22%22)%0A        self.add_argument(%22--file2%22, dest=%22file2%22, type=str,%0A            help=%22%22%22R2 fastq file (zipped) %22%22%22)%0A        self.add_argument(%22--database%22, dest=%22database%22, type=str,%0A            help=%22%22%22Kraken DB %22%22%22)%0A        self.add_argument(%22--output%22, dest=%22output%22, type=str,%0A            help=%22%22%22Kraken DB %22%22%22, default=%22krona.html%22)%0A        self.add_argument(%22--thread%22, dest=%22thread%22, type=int,%0A            help=%22%22%22number of threads to use %22%22%22, default=4)%0A%0A%0Adef main(args=None):%0A%0A    if args is None:%0A        args = sys.argv%5B:%5D%0A%0A    user_options = Options(prog=%22sequana%22)%0A%0A    # If --help or no options provided, show the help%0A    if len(args) == 1:%0A        user_options.parse_args(%5B%22prog%22, %22--help%22%5D)%0A    else:%0A       options = user_options.parse_args(args%5B1:%5D)%0A%0A    # We put the import here to make the --help faster%0A    from sequana import KrakenTaxon%0A%0A    fastq = %5B%5D%0A    if options.file1:%0A        fastq.append(options.file1)%0A    if options.file2:%0A        fastq.append(options.file2)%0A    k = KrakenTaxon(fastq, options.database, threads=options.thread, %0A            output=options.output)%0A    k.run()%0A%0A%0Aif __name__ == %22__main__%22:%0A   import sys%0A   main(sys.argv)%0A%0A

add new standalone application