Skip to main content

Automating NGS Projects

With Basepair, you can fully automate an NGS project—create a project, add multiple samples, run analyses, and share everything with another user. Here are the steps:

  1. Sign in to your Basepair account → https://{domain}/

  2. Download your API config file — follow the steps in Setup to download it from your dashboard. Then make it available to the CLI using one of:

    # Option A — environment variable (persists for the session)
    export BP_CONFIG_FILE=/path/to/basepair.config.json

    # Option B — per-command flag
    basepair -c /path/to/basepair.config.json <subcommand>
  3. Install the Basepair package

    pip install basepair
  4. Create a new project for this data (note the returned project ID)

    basepair project create --name desired_project_name
  5. Add your samples (note each sample ID)

    basepair sample create --name Treat_1   --genome hg19 --type rna-seq \
    --file1 /path/to/file1_R1.fq.gz --file2 /path/to/file1_R2.fq.gz

    basepair sample create --name Control_1 --genome hg19 --type rna-seq \
    --file1 /path/to/file2_R1.fq.gz --file2 /path/to/file2_R2.fq.gz

    # <add all your other samples>
  6. Run differential-expression analysis (pipeline ID 8) using the sample and control IDs from step 4

    basepair analysis create --pipeline 8 \
    --sample 30754 30755 30756 \
    --control 30757 30758 30759
  7. Share the project with another user (example: give edit permission; you can also use view or admin)

    basepair project update -u 1926 --team <team_id> \
    --emails collaborator@example.com --perm edit