A SNP data source that exposes and organizes variant data from the SNPseek backend database, supporting the SNPseek web application and related analytical and integration use cases.
SNPseek Datasource is a Java-based application built on the Spring Framework that provides data access layers for managing and querying SNP-related genomic information. It is based on the CHADO database schema, with targeted modifications and extensions to tailor the model to the specific requirements of the SNPseek system, and exposes a robust API for genomic data operations.
- Data Access Layer: Comprehensive DAO (Data Access Object) implementations for genomic data
- Spring Integration: Built on Spring Framework for dependency injection and transaction management
- CHADO Schema Support: Integration with CHADO database schema for biological data
- Modular Architecture: Organized into logical packages for maintainability
- Configuration Management: Flexible XML-based Spring configuration
snpseek-datasource/
├── src/
│ ├── main/
│ │ ├── java/
│ │ │ └── org/trri/tric/ds/chado/
│ │ │ ├── dao/ # Data Access Objects
│ │ │ │ └── impl/ # DAO implementations
│ │ │ └── domain/ # Domain models
│ │ │ └── impl/ # implementations
│ │ └── resources/
│ │ ├── META-INF/
│ │ └── *.xml # Spring configuration files
│ └── test/
├── lib/ # External libraries
├── pom.xml # Maven configuration
└── README.md
- Java 8 or higher
- Maven 3.x
- Spring Framework 3.2.x
- Database server (PostgreSQL recommended for CHADO)
- Eclipse IDE or similar Java IDE
-
Clone the repository
git clone <repository-url> cd snpseek-datasource
-
Configure database connection
- Configure database connection and data source properties
- Review and adjust connection-related settings as needed
- Credentials are read from environment variables by default
- Values defined in the configuration file may override the environment variables if explicitly provided
-
Build the project
mvn clean install
-
Run tests
mvn test
Update your database connection settings in the Spring configuration files:
<!-- Example configuration in incDS_prod_crud-dao-context.xml -->
<bean class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close" name="IRIC_ProductionDS_PG">
<property name="driverClassName"
value="org.postgresql.Driver" />
<property name="username" value="${DB_USERNAME}" />
<property name="password" value="${DB_PASSWORD}" />
<property name="url" value="${DB_URL}" />
<property name="maxIdle" value="1" />
<property name="maxActive" value="10" />
</bean>The application uses Spring XML configuration for:
- Component scanning
- Transaction management
- Data source configuration
- DAO bean definitions
// Example usage of DAO classes
@Autowired
private YourDao yourDao;
// Perform database operations
List<Entity> results = yourDao.findAll();Include SNPseek Datasource as a dependency in your project:
<dependency>
<groupId>org.trri.tric</groupId>
<artifactId>snpseek-datasource</artifactId>
<version>1.0.0</version>
</dependency>-
Import project into Eclipse:
- File → Import → Maven → Existing Maven Projects
- Select the project directory
- Eclipse will automatically configure the build path
-
Configure application servers if needed
-
Run the application or tests from Eclipse
- DAO Layer:
org.irri.tric.ds.chado.dao - Implementation:
org.irri.tric.ds.chado.dao.impl - Domain Models:
org.irri.tric.ds.chado.domain - Configuration:
src/resources/*.xml
Run the test suite:
# Run all tests
mvn test
# Run specific test class
mvn test -Dtest=YourTestClass
# Run with coverage
mvn clean test jacoco:reportIssue: XML Configuration Errors
- Ensure all Spring schema locations are correctly defined
- Verify namespace declarations in XML files
- Check that external resources can be downloaded
Issue: Database Connection Failures
- Verify database credentials
- Check network connectivity
- Ensure database server is running
Issue: Maven Build Failures
- Clear Maven cache:
mvn clean - Update dependencies:
mvn dependency:resolve - Check for conflicting library versions
- Fork the repository
- Create a feature branch (
git checkout -b feature/your-feature) - Commit your changes (
git commit -am 'Add new feature') - Push to the branch (
git push origin feature/your-feature) - Create a Pull Request
- Follow Java naming conventions
- Write unit tests for new features
- Document public APIs with Javadoc
- Keep commits atomic and well-described
- Developer: [Lord Hendrix Barboza]
- Email: [l.h.barboza@cgiar.org]
- Organization: IRRI/Bioinformatics
- Built with Spring Framework
- Uses CHADO database schema
Note: This is an active development project. Please refer to the issue tracker for known issues and planned features.