Skip to content

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

License

Notifications You must be signed in to change notification settings

ScheWann/ChromPolymerDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

772 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

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

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

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •