Command Line API

Modified on Tue, 24 May, 2022 at 10:53 AM

Updated for basepair version 2.0.0


Command Line (CLI) bindings for Basepair's API. The CLI bindings are just a wrapper around the Python bindings, which are more fully featured. So if there is something you cannot do via the command line, then check out the Python API. An outline of the contents on this page:


  1. Creating a project
  2. Creating a sample
  3. Running an analysis
  4. Downloading results

1. Creating a project


First, check your available projects. Your initial Basepair account starts with two existing projects, one containing example data and an empty "Project 1":

basepair project list -c /path/to/basepair.config.json
Generic
id  name          owner fullname    last updated                visibility
----  ------------  ----------------  --------------------------  ------------
 784  Example Data  Amit Sinha        2022-03-11T14:01:19.850152  public
8611  Project 1     Username     2022-05-15T19:20:06.378477  private
Generic

Now, create a new project:

basepair project create --name new_project -c /path/to/basepair.config.json
Generic
created: project with id 8658
Generic

2. Creating a sample


Create a sample within your new project, specifying the sample name, data type, genome of interest, and location of data files:

basepair sample create --project 8658 \
--name Untreat1 \
--type atac-seq \
--genome hg19 \
--file1 /path/to/read_1.fastq.gz \
--file2 /path/to/read_2.fastq.gz \
-c /path/to/basepair.config.json
Generic
created: sample with id 75042
Sample id: 75042
Creating upload read_1.fastq.gz
  created: upload with id 138264
Creating upload read_2.fastq.gz
  created: upload with id 138265
Sample created successfully.
Generic


To see all available data types and other available metadata:

basepair sample create -h
Generic


To see all available genomes:

basepair genome list -c /path/to/basepair.config.json
HTML


You can check the samples in a project with:

basepair sample list --project 8658 -c /path/to/basepair.config.json
Generic

3. Running an analysis


To run an analysis, such as ATAC-seq alignment with bowtie2 in this case, specify the project, sample, and pipeline:

basepair analysis create --project 8658 \
--sample 75042 \
--pipeline 19 \
-c /path/to/basepair.config.json
Generic
created: analysis 91182 with sample id(s) 75042
HTML


To see all available pipelines:

basepair pipeline list -c /path/to/basepair.config.json
Generic

4. Downloading results


Download the entire analysis directory tree and all associated files to the current directory by specifying the analysis ID:

basepair analysis download -u 91182 -c /path/to/basepair.config.json
Generic


To download only the alignment BAM and BAM index files from an analysis and the associated directory tree:

basepair analysis download -u 91182 \
--tags dedup \
--tagkind subset \
-c /path/to/basepair.config.json
Generic

To see all files of an analysis and their associated tags:

basepair analysis get -u 91182 -c /path/to/basepair.config.json
Generic


To download only the heatmaps and bigwig track from an analysis:

basepair analysis download -u 90747 \
--tags png igv \
--tagkind subset \
-c /path/to/basepair.config.json
Generic




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article