Skip to content

Usage

Using as a command line interface


This is the main intention of BGCFlow wrapper usage.

Overview

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
$ bgcflow

Usage: bgcflow [OPTIONS] COMMAND [ARGS]...

  A snakemake wrapper and utility tools for BGCFlow
  (https://github.com/NBChub/bgcflow)

Options:
  --version   Show the version and exit.
  -h, --help  Show this message and exit.

Commands:
  build       Use DBT to build DuckDB database from BGCFlow results.
  clone       Use git to clone BGCFlow to local directory.
  deploy      [EXPERIMENTAL] Deploy BGCFlow locally using snakedeploy.
  get-result  View a tree of a project results or get a copy using Rsync.
  init        Create projects or initiate BGCFlow config.
  rules       Get description of available rules from BGCFlow.
  run         A snakemake CLI wrapper to run BGCFlow.
  serve       Generate static HTML report for BGCFlow run(s)

Typical Usage

  • The first step of using BGCFlow wrapper is to get a copy (or clone) of the main BGCFlow Snakemake workflow.

    1
    2
    # get a clone of BGCFlow in your local machine
    bgcflow clone MY_BGCFLOW_PATH #change PATH accordingly
    

  • Then, initiate a project config by:

    1
    2
    # initiate an example config and projects from template
    bgcflow init --bgcflow_dir MY_BGCFLOW_PATH
    

    This will generate a file called config.yaml in the config/ folder inside the cloned BGCFlow directory

  • Once the config files are set, we can do a snakemake dry-run:

    1
    2
    # do a dry-run
    bgcflow run -n --bgcflow_dir MY_BGCFLOW_PATH
    

    While the workflow is running, the command automatically serve Panoptes-UI at localhost:5000` to monitor jobs.

  • To find out all the rules that can be added in the configuration file, do:

    1
    2
    # find out available rules
    bgcflow rules --bgcflow_dir MY_BGCFLOW_PATH
    

  • To get more details about each individual rules, do:

    1
    2
    # get description of a rule
    bgcflow rules --describe antismash --bgcflow_dir MY_BGCFLOW_PATH/
    

  • To find out how to cite each rules, do:

    1
    2
    # get citation of a rule
    bgcflow rules --cite antismash --bgcflow_dir MY_BGCFLOW_PATH/
    

Using as a python library


You can also generate new projects via python or Jupyter notebooks:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from bgcflow.projects_util import generate_project
import pandas as pd

df_samples = pd.read_csv('samples.csv', index_col=0)
description = "Project generated from notebook"

generate_project("BGCFLOW_PATH",
                "MY_PROJECT",
                use_project_rules=True,
                samples_csv=df_samples,
                prokka_db="prokka-db.csv",
                gtdb_tax="gtdbtk.bac120.summary.tsv",
                description=description
                )