nanoCAS (Nanopore Classification & Alerting System) is a web application designed to run simultaneously with the Nanopore DNA sequencer. This application provides an alerting system through which scientists performing DNA sequencing runs can be notified when sequences of interest arise in their sample. This enables researchers to use their time more efficiently by allowing them to focus on other tasks rather than waiting for significant sequences to appear.
- Real-time Monitoring: Track sequencing progress and receive alerts when sequences of interest are detected
- Flexible Configuration: Set up custom alerting thresholds for different sequence targets
- Interactive Dashboard: Visualize coverage statistics and match percentages in real-time
- Cross-platform Support: Run on Linux, macOS, Windows, or SLURM cluster environments
- Distributed Computing: Scale processing across multiple workers for improved performance
- Containerized Deployment: Easy deployment with Docker and Docker Compose
- Responsive Design: User-friendly interface that works on desktop and mobile devices
- CPU: 2+ cores
- RAM: 4GB+
- Storage: 10GB+ free space
- Operating System: Linux, macOS, or Windows
- Network: Internet connection for dependency installation
- CPU: 4+ cores
- RAM: 8GB+
- Storage: 50GB+ SSD
- Operating System: Ubuntu 20.04+, macOS 12+, or Windows 10/11
- Network: High-speed internet connection
nanoCAS offers multiple installation methods to accommodate different environments and use cases.
The easiest way to get started with nanoCAS is using Docker and Docker Compose:
- Ensure Docker and Docker Compose are installed on your system
- Clone the repository or extract the application files
- Run the setup script:
# For Linux/macOS
chmod +x setup.sh
./setup.sh
# For Windows
python setup.py
This will start the application with the default configuration. The frontend will be available at http://localhost:3000 and the backend at http://localhost:5007.
nanoCAS supports sending SMS alerts using Twilio when a sequence of interest meets the specified coverage threshold. Since nanoCAS is open-source, you’ll need to set up your own Twilio account and configure it yourself. Follow these steps to enable SMS notifications:
- Visit Twilio's website and sign up for a free account.
- Complete the verification process by providing your email and phone number.
- Log in to your Twilio Console at https://console.twilio.com/.
- Navigate to the "Phone Numbers" section under "All Products & Services".
- Click "Buy a Number", search for a number that supports SMS (check the capabilities), and purchase it.
- Note down your Twilio phone number (e.g.,
+12345678901
).
- In the Twilio Console dashboard, locate your "Account SID" and "Auth Token" under the "Account Info" section.
- These credentials are required to authenticate API requests. Keep them secure.
-
In the root directory of your nanoCAS project, create or edit the
.env
file to include the following Twilio configuration:TWILIO_ACCOUNT_SID=your_account_sid TWILIO_AUTH_TOKEN=your_auth_token TWILIO_PHONE_NUMBER=your_twilio_phone_number ALERT_RECIPIENT_PHONE=recipient_phone_number
-
Redis Port: Set
REDIS_PORT
in.env
(e.g.,REDIS_PORT=6380
) to change the Redis port. -
API Endpoint: Set
REACT_APP_API_ENDPOINT
infrontend/.env
(e.g.,REACT_APP_API_ENDPOINT=http://my-server:5007
) to change the backend URL.
For environments where Docker is not available or for development purposes:
- Python 3.10+
- Node.js 16+
- npm 8+
- Samtools
- Minimap2
- Clone the repository or extract the application files
- Install backend dependencies:
cd server
pip install -r requirements.txt
- Install frontend dependencies:
cd frontend
npm install
- Start the backend server:
cd server
python nanocas.py
- Start the frontend development server:
cd frontend
npm start
For more advanced configurations, including distributed computing and SLURM cluster deployment, use the Python setup script with appropriate options:
python setup.py --env production --distributed --backend-port 5007 --frontend-port 3000
Available options:
--env
: Set environment (development, production)--distributed
: Enable distributed computing mode--slurm
: Configure for SLURM cluster environment--backend-port
: Specify backend server port--frontend-port
: Specify frontend server port--no-docker
: Skip Docker setup and use local installation--install-deps
: Install system dependencies--setup-redis
: Setup Redis for distributed computing--setup-celery
: Setup Celery for distributed computing
- Navigate to the nanoCAS web interface at http://localhost:3000
- Click on "Start New Analysis" on the home page
- Configure your analysis parameters:
- Specify the Nanopore data directory location
- Add query sequences for alerting
- Set match percentage thresholds
- Configure notification settings
- Click "Create Analysis" to start monitoring
- Navigate to the "Analysis" page
- Select your analysis from the list
- View real-time statistics and visualizations:
- Sequence match percentages
- Coverage depth over time
- Alert history
- Start or stop the file listener as needed
- To stop monitoring: Click "Stop File Listener" on the analysis page
- To resume monitoring: Click "Start File Listener" on the analysis page
- To remove an analysis: Click "Remove Analysis" on the analysis page
nanoCAS follows a client-server architecture:
-
Frontend: React-based web application
- Modern, responsive UI
- Real-time data visualization
- WebSocket communication with backend
-
Backend: Flask-based server with SocketIO
- File monitoring and processing
- Sequence alignment and analysis
- Alert generation and notification
- REST API endpoints
-
Distributed Computing (optional):
- Redis for message broker and result backend
- Celery for task distribution and processing
- Multiple worker processes for parallel execution
nanoCAS/
├── frontend/ # React frontend application
│ ├── src/ # Source code
│ │ ├── components/ # Reusable UI components
│ │ ├── modules/ # Feature modules
│ │ ├── styles/ # CSS styles
│ │ └── utils/ # Utility functions
│ ├── public/ # Static assets
│ └── package.json # Node.js dependencies
├── server/ # Flask backend application
│ ├── app/ # Application code
│ │ ├── main/ # Main application module
│ │ │ ├── utils/ # Utility functions
│ │ │ ├── events.py # SocketIO event handlers
│ │ │ └── routes.py # API routes
│ ├── minknow_api/ # MinKNOW API integration
│ ├── utils/ # Utility modules
│ ├── nanocas.py # Application entry point
│ └── requirements.txt # Python dependencies
├── docker-compose.yml # Docker Compose configuration
├── setup.py # Python setup script
├── setup.sh # Bash setup script
└── README.md # Documentation
- Follow the manual installation steps above
- For frontend development:
- Run
npm start
in the frontend directory - Changes will automatically reload
- Run
- For backend development:
- Set
FLASK_ENV=development
environment variable - Run
python nanocas.py
in the server directory - Restart the server to apply changes
- Set
To build the application for production deployment:
- Build the frontend:
cd frontend
npm run build
- Configure the backend for production:
export FLASK_ENV=production
- Use the Docker Compose production configuration:
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
-
Connection refused to backend server
- Ensure the backend server is running
- Check if the port is already in use
- Verify firewall settings
-
File listener not detecting files
- Verify the Nanopore data directory path
- Ensure the application has read permissions
- Check if files match the expected format (FASTQ/BAM)
-
Distributed tasks not running
- Verify Redis server is running
- Ensure Celery workers are started
- Check Celery worker logs for errors
Log files are stored in the following locations:
- Backend logs:
server/logs/nanocas.log
- Frontend development logs: Console output
- Docker logs: Access with
docker-compose logs
- Setup logs:
nanocas_setup.log
We welcome contributions to nanoCAS! Please follow these steps:
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
CC-BY
If you use nanoCAS in your research, please cite:
Soomro T, Horovatin S, Dumonceaux TJ, Links MG. (2025) nanoCAS: A real-time monitoring tool for Nanopore sequencing data. Manuscript in preparation for BMC Bioinformatics.
Acknowledgments
- The nanoCAS development team (Tayab Soomro & Sam Horovatin)
- Dr. Tim Dumonceaux from AAFC for guidance and support
- Contributors and testers
- The open-source community for the various libraries and tools used in this project