Example #1
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.proteins is not None:
        align(pangenome=pangenome,
              proteinFile=args.proteins,
              output=args.output,
              tmpdir=args.tmpdir,
              identity=args.identity,
              coverage=args.coverage,
              defrag=args.defrag,
              cpu=args.cpu,
              getinfo=args.getinfo,
              draw_related=args.draw_related)

    if args.annotation is not None:
        projectRGP(pangenome,
                   args.annotation,
                   args.output,
                   args.tmpdir,
                   args.identity,
                   args.coverage,
                   args.defrag,
                   args.cpu,
                   args.translation_table,
                   pseudo=args.use_pseudo)
Example #2
0
def launch(args):
    """
        main code when launch partition from the command line.
    """
    if args.draw_ICL or args.keep_tmp_files:
        mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    partition(pangenome,
              args.tmpdir,
              args.output,
              args.force,
              args.beta,
              args.max_degree_smoothing,
              args.free_dispersion,
              args.chunk_size,
              args.nb_of_partitions,
              args.krange,
              args.ICL_margin,
              args.draw_ICL,
              args.cpu,
              args.seed,
              args.keep_tmp_files,
              show_bar=args.show_prog_bars)
    writePangenome(pangenome,
                   pangenome.file,
                   args.force,
                   show_bar=args.show_prog_bars)
Example #3
0
def launch(args):
    """ launch the clustering step"""
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.clusters is None:
        clustering(pangenome,
                   args.tmpdir,
                   args.cpu,
                   defrag=not args.no_defrag,
                   code=args.translation_table,
                   coverage=args.coverage,
                   identity=args.identity,
                   mode=args.mode,
                   force=args.force,
                   disable_bar=args.disable_prog_bar)
        logging.getLogger().info("Done with the clustering")
    else:
        readClustering(pangenome,
                       args.clusters,
                       args.infer_singletons,
                       args.force,
                       disable_bar=args.disable_prog_bar)
        logging.getLogger().info("Done reading the cluster file")
    writePangenome(pangenome,
                   pangenome.file,
                   args.force,
                   disable_bar=args.disable_prog_bar)
Example #4
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    writeFlatFiles(pangenome,
                   args.output,
                   cpu=args.cpu,
                   soft_core=args.soft_core,
                   dup_margin=args.dup_margin,
                   csv=args.csv,
                   genePA=args.Rtab,
                   gexf=args.gexf,
                   light_gexf=args.light_gexf,
                   projection=args.projection,
                   stats=args.stats,
                   json=args.json,
                   partitions=args.partitions,
                   regions=args.regions,
                   families_tsv=args.families_tsv,
                   all_genes=args.all_genes,
                   all_prot_families=args.all_prot_families,
                   all_gene_families=args.all_gene_families,
                   spots=args.spots,
                   borders=args.borders,
                   compress=args.compress)
Example #5
0
def launch(args):
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.spot_graph or args.draw_hotspots:
        mkOutdir(args.output, args.force)
    predictHotspots(pangenome, args.output, force=args.force, cpu = args.cpu, spot_graph=args.spot_graph, overlapping_match=args.overlapping_match, set_size=args.set_size, exact_match=args.exact_match_size, draw_hotspot=args.draw_hotspots, interest=args.interest)
    writePangenome(pangenome, pangenome.file, args.force)
Example #6
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.tile_plot:
        drawTilePlot(pangenome, args.output, args.nocloud)
    if args.ucurve:
        drawUCurve(pangenome, args.output, soft_core = args.soft_core)
Example #7
0
def launchSequences(args):
    checkOptions(args)
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    writeSequenceFiles(pangenome, args.output, fasta=args.fasta, anno=args.anno, soft_core=args.soft_core,
                       regions=args.regions, genes=args.genes, gene_families=args.gene_families,
                       prot_families=args.prot_families, compress=args.compress, disable_bar=args.disable_prog_bar)
Example #8
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    writeFlatFiles(pangenome, args.output, args.cpu, args.soft_core,
                   args.dup_margin, args.csv, args.Rtab, args.gexf,
                   args.light_gexf, args.projection, args.stats, args.json,
                   args.partitions, args.families_tsv, args.all_genes,
                   args.all_prot_families, args.all_gene_families,
                   args.compress)
Example #9
0
def launch(args):
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    predictRGP(pangenome,
               force=args.force,
               persistent_penalty=args.persistent_penalty,
               variable_gain=args.variable_gain,
               min_length=args.min_length,
               min_score=args.min_score,
               dup_margin=args.dup_margin,
               cpu=args.cpu)
    writePangenome(pangenome, pangenome.file, args.force)
Example #10
0
def launchMSA(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    writeMSAFiles(pangenome,
                  args.output,
                  cpu=args.cpu,
                  partition=args.partition,
                  tmpdir=args.tmpdir,
                  source=args.source,
                  force=args.force,
                  show_bar=args.show_prog_bars)
Example #11
0
def launch(args):
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.spot_graph:
        mkOutdir(args.output, args.force)
    if args.draw_hotspots or args.interest or args.fig_margin or args.priority:
        logging.getLogger().warning(
            "Options to draw the spots with the 'ppanggolin spot' subcommand have been deprecated, "
            "and are now dealt with in a dedicated subcommand 'ppanggolin drawspot'.")
    predictHotspots(pangenome, args.output, force=args.force, cpu=args.cpu, spot_graph=args.spot_graph,
                    overlapping_match=args.overlapping_match, set_size=args.set_size, exact_match=args.exact_match_size,
                    disable_bar=args.disable_prog_bar)
    writePangenome(pangenome, pangenome.file, args.force, disable_bar=args.disable_prog_bar)
Example #12
0
def launch(args):
    """ launch the clustering step"""
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.clusters is None:
        clustering(pangenome, args.tmpdir, args.cpu, args.defrag,
                   args.translation_table, args.coverage, args.identity,
                   args.force)
        logging.getLogger().info("Done with the clustering")
    else:
        readClustering(pangenome, args.clusters, args.infer_singletons,
                       args.force)
        logging.getLogger().info("Done reading the cluster file")
    writePangenome(pangenome, pangenome.file, args.force)
Example #13
0
def launchSequences(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    checkOptions(args)
    writeSequenceFiles(pangenome,
                       args.output,
                       fasta=args.fasta,
                       anno=args.anno,
                       cpu=args.cpu,
                       regions=args.regions,
                       genes=args.genes,
                       prot_families=args.prot_families,
                       gene_families=args.gene_families,
                       compress=args.compress,
                       show_bar=args.show_prog_bars)
Example #14
0
def launch(args):
    if not any(x for x in [args.genome_fluidity, args.family_fluidity, args.info_modules, args.all]):
        raise Exception("You did not indicate which metric you want to compute.")

    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)

    logging.getLogger().debug("Check if one of the metrics was already compute")
    check_metric(pangenome, all=args.all, genome_fluidity=args.genome_fluidity, family_fluidity=args.family_fluidity,
                 info_modules=args.info_modules, force=args.force)
    logging.getLogger().info("Metrics computation begin")
    metrics_dictionary = compute_metrics(pangenome, all=args.all, genome_fluidity=args.genome_fluidity,
                                         family_fluidity=args.family_fluidity, info_modules=args.info_modules,
                                         disable_bar=args.disable_prog_bar)
    logging.getLogger().info("Metrics computation done")

    write_metrics(pangenome, metrics_dictionary, no_print_info=args.no_print_info)
Example #15
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.tile_plot:
        drawTilePlot(pangenome,
                     args.output,
                     args.nocloud,
                     disable_bar=args.disable_prog_bar)
    if args.ucurve:
        drawUCurve(pangenome,
                   args.output,
                   soft_core=args.soft_core,
                   disable_bar=args.disable_prog_bar)
    if args.spots != '':
        drawSpots(pangenome=pangenome,
                  output=args.output,
                  spot_list=args.spots,
                  disable_bar=args.disable_prog_bar)
Example #16
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    if args.interest or args.fig_margin or args.label_priority:
        logging.getLogger().warning(
            "Options --interest, --fig_margin and --label_priority are deprecated, "
            "and the actions they defined are now doable directly in the interactive figures "
            "that are drawn")
    align(pangenome=pangenome,
          sequenceFile=args.sequences,
          output=args.output,
          tmpdir=args.tmpdir,
          cpu=args.cpu,
          identity=args.identity,
          coverage=args.coverage,
          no_defrag=args.no_defrag,
          getinfo=args.getinfo,
          draw_related=args.draw_related,
          disable_bar=args.disable_prog_bar)
Example #17
0
def launch(args):
    """
        main code when launch partition from the command line.
    """
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    makeRarefactionCurve( pangenome = pangenome,
                        output = args.output,
                        tmpdir = args.tmpdir,
                        beta =args.beta,
                        depth = args.depth,
                        minSampling=args.min,
                        maxSampling=args.max,
                        sm_degree=args.max_degree_smoothing,
                        free_dispersion=args.free_dispersion,
                        chunk_size=args.chunk_size,
                        K=args.nb_of_partitions,
                        cpu = args.cpu,
                        seed = args.seed,
                        kestimate=args.reestimate_K,
                        krange = args.krange,
                        soft_core = args.soft_core)
Example #18
0
def launch(args):
    logging.getLogger().debug(f"Ram used at the start : {getCurrentRAM()}")
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    computeNeighborsGraph(pangenome, args.remove_high_copy_number, args.force)
    writePangenome(pangenome, pangenome.file, args.force)
Example #19
0
def launch(args):
    mkOutdir(args.output, args.force)
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    align(pangenome, args.proteins, args.output, args.tmpdir, args.identity,
          args.coverage, args.defrag, args.cpu)
Example #20
0
def launch(args):
    pangenome = Pangenome()
    pangenome.addFile(args.pangenome)
    computeNeighborsGraph(pangenome, args.remove_high_copy_number, args.force, show_bar=args.show_prog_bars)
    writePangenome(pangenome, pangenome.file, args.force, show_bar=args.show_prog_bars)