Skip to content

CAST-genomics/pangenome-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pangenome-api

This is the API for the backend of the Pangenome Browser.

How to Install

If you are using the AWS instance, you can skip this part and directly navigate to the How to Use section. If you are using the pangenome-api on your own computer instead, please follow the steps below to install. (Note that the minigraph functions are not compatible with the MacOS system)

Step 1: Clone the repository

Step 2: Install gbz-base and gfabase

To check if gbz-base is correctly installed, run:

#gbz-base
which gbz2db
which query

#gfabase
which gfabase

Step 3: Install python packages

pip install panct pathlib fastapi 

Step 4: Download the graph files and store them in the pangenome-api folder

We will use the database from HPRC which you can find more through this link.

How to Use:

In the pangenome-api folder, run:

fastapi dev main.py

You can then open the interactive API doc at http://127.0.0.1:8000/docs.

fastapi_doc

Click "try it out" and input the genome region of interest. Then click "execute" to generate the url.

Alternatively, you can run the API directly from the url http://127.0.0.1:8000/subgraph/?chrom=chrX&start=1000&end=100000&graphtype=MC by manually changing the chromosome(eg. chr1, chrX), start location, end location, and graphtype("MC" for minigraph-cactus, or "minigraph").

(Note: the api will likely take a couple of minutes to load when you run the function for the first time. The code will need to indexing the gbz file and gfa file first. This may take around 5 minutes.)

Example:

http://127.0.0.1:8000/subgraph/?chrom=chrX&start=100000&end=150000&graphtype=MC

This will return a Minigraph-cactus(MC) GFA stored in a dictionary of a region in chromosome X, starting from 100000bp, and ending at 150000bp.

example

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages