This project provides a web-based interface for visualizing BAM files using IGV.js. Users can view bam data in an interactive IGV browser, specifying loci of interest for visualization. Input bam files should be accessible and valid in the app server.
- Interactive Genomic Visualization: View genomic alignments and variations from BAM files directly in the browser using the IGV.js library.
- User Customization: Users can input the locus (chromosome region) and BAM file path, and the visualization will update dynamically.
- Genome Reference: The app uses the
hg19
reference genome, but it can be customized to support other genomes if necessary.
- Python 3.x
- Flask (for backend)
- IGV.js (JavaScript library for genomic visualization)
Clone the repository to your local machine:
git clone https://github.com/liuyanbioinfo/igv_web_app.git
cd igv_web_app
Download hg19 reference genome and index files.
(Optional) You can change to other refernce versions by editing fastaURL
and indexURL
in /templates/index.html
:
cp /path/to/hg19.fa /static/ref/hg19.fa
cp /path/to/hg19.fa.fai /static/ref/hg19.fa.fai
Install the required Python packages using pip
:
pip install -r requirements.txt
Start the Flask application:
python run.py
The application will be available at http://127.0.0.1:5000/
by default.
- Open the Web Application: Go to
http://127.0.0.1:5000/
in your web browser. - Input Locus: In the "Locus" input field, provide a chromosome region in the format
chr7:55241607-55241807
. This will specify the region of the genome to display in the IGV viewer. - Input BAM File Path: Provide the absolute file path to the BAM file you wish to visualize. Ensure the path is valid and the file is accessible.
- Click Update IGV: Once the locus and BAM path are entered, click the "Update IGV" button. The IGV viewer will refresh and display the BAM file content for the specified locus.
- Visualize Data: The genomic alignments will be displayed in the IGV viewer. You can zoom in/out, scroll, and interact with the visualization.
This project is licensed under the MIT License - see the LICENSE
file for details.