Skip to content

About

A Web Database for High-Resolution Ensemble Models of 3D Single-Cell Chromatin Conformations

Resources

Stars

1 star

Watchers

1 watching

Forks

Latest commit

 

History

778 Commits

Folders and files

Repository files navigation

INSTRUCTION

  1. Install Docker to your laptop

  2. Prepare the data and create a Data folder under the root project directory.

  3. Prepare the example data and create a example_data folder under the Backend directory.

  4. Create a .env file under the root project directory

    DB_USERNAME=admin
    DB_HOST=db
    DB_NAME=chromosome_db
    DB_PASSWORD=chromosome
    DB_PORT=5432
    
    PGADMIN_DEFAULT_EMAIL=[email protected]
    PGADMIN_DEFAULT_PASSWORD=chromosome
    
    REDIS_HOST=redis
    REDIS_PORT=6379
    REDIS_DB=0
    REDIS_BROKER_DB=1
    REDIS_TASK_DB=2
  5. For development, under this project folder, and run

    docker compose up -d --build

DEPLOY

  1. Switch to publish branch
    git switch publish
    
  2. Build
    docker compose -f docker-compose.prod.yml up -d --build

TROUBLESHOOTING

Project Structure

ChromPolymerDB/
├── .env
├── .gitignore
├── docker-compose.yml
├── LICENSE
├── README.md
├── Backend/
│   ├── app.py
│   ├── cell_line_labels.py
│   ├── chromosome_sizes.txt
│   ├── Dockerfile
│   ├── init_db.py
│   ├── insert_new_data.py
│   ├── process.py
│   ├── requirements.txt
│   ├── sBIF.sh
│   ├── Bintu/
│   ├── Example_data/
│   ├── Folding_input/
│   ├── GSE/
│   ├── New_cell_line/
├── Cron/
│   ├── crontab
│   └── Dockerfile
├── Data/
│   ├── chromosome_sizes.txt
│   ├── gene_list.csv
│   ├── human_gene_locations_with_names.csv
│   ├── Bintu/
│   ├── epigenetic_tracks/
│   ├── GSE/
│   ├── refined_processed_HiC/
│   └── valid_regions/
├── DB/
│   ├── Dockerfile
│   └── init-cron.sh
├── Frontend/
│   ├── .gitignore
│   ├── Dockerfile
│   ├── package-lock.json
│   ├── package.json
│   ├── build/
│   ├── node_modules/
│   ├── public/
│   └── src/
└── Scripts/
    ├── bintu_process.ipynb
    ├── hic_process.ipynb
    ├── preprocess.ipynb
    ├── test_corr.ipynb
    └── verification.ipynb

View Logs

# All services
docker compose logs -f

# Specific service
docker compose logs -f backend

Restart Services

If you want to restart a service that has already been deployed on the server, you need to add -f docker-compose.prod.yml, for example:

# Restart all service on the server
docker compose -f docker-compose.prod.yml restart

Otherwise, using:

# Restart all
docker compose restart

# Restart specific service
docker compose restart backend

Database Issues

# Check database connection
docker compose exec db psql -U $DB_USERNAME -d $DB_NAME

Clean Redis

docker exec -it Redis redis-cli FLUSHALL

Clean the Docker Build Cache

docker builder prune --all

Container Operation

docker exec -it <container ID> bash

Download distance data from the database

Take GM12878-chr8-127300000-128300000 as an example

psql -U admin -d chromosome_db \
  --command "\copy (SELECT * FROM public.distance WHERE cell_line = 'GM12878' AND chrid = 'chr8' AND start_value = 127300000 AND end_value = 128300000) TO '/opt/GM12878_chr8_127300000_128300000_original_distance.csv' WITH (FORMAT csv, HEADER, DELIMITER ',', QUOTE '\"', ESCAPE '''');"

If your Docker is running on the server, you need to download this file from the container to your server

# Exit DB Container
exit

# Run
docker cp <container>:/path/in/container /path/on/host

About

A Web Database for High-Resolution Ensemble Models of 3D Single-Cell Chromatin Conformations

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages