Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Pre-commit configuration for IM2Deep
# Install with: pip install pre-commit && pre-commit install

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict
- id: debug-statements

- repo: https://github.com/psf/black
rev: 23.3.0
hooks:
- id: black
language_version: python3

- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
args: ["--profile", "black"]

- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
args: [--max-line-length=99]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.3.0
hooks:
- id: mypy
additional_dependencies: [types-requests]
31 changes: 31 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
- This CHANGELOG file
- Comprehensive documentation with API reference, development guide, and tutorial
- Enhanced error handling with custom exceptions
- Input validation throughout the codebase
- Type hints for better code clarity
- Detailed logging with different verbosity levels

### Changed
- Improved function signatures with better parameter validation
- Enhanced docstrings with NumPy style documentation
- Better error messages with more context
- Improved CLI with better help text and validation
- More robust file handling with proper encoding
- Enhanced calibration functions with edge case handling

### Fixed
- Import error handling for optional dependencies
- File path validation in CLI
- Memory management improvements
- Edge cases in CCS/ion mobility conversions
- Calibration edge cases with insufficient data
63 changes: 63 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Contributing to IM2Deep

We welcome contributions to IM2Deep! This document provides guidelines for contributing to the project.

## Getting Started

1. Fork the repository on GitHub
2. Clone your fork locally
3. Set up the development environment
4. Create a feature branch
5. Make your changes
6. Run tests
7. Submit a pull request

## Development Setup

```bash
# Clone your fork
git clone https://github.com/yourusername/IM2Deep.git
cd IM2Deep

# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate

# Install in development mode
pip install -e .[dev,test]
```

## Code Standards

### Style Guide
- Follow PEP 8
- Use Black for code formatting: `black im2deep/`
- Use isort for imports: `isort im2deep/`
- Maximum line length: 99 characters

### Documentation
- Use NumPy-style docstrings
- Include type hints
- Provide examples in docstrings
- Update documentation for new features

## Pull Request Process

1. Create a feature branch from `main`
2. Make your changes
3. Add tests for new functionality
4. Update documentation
5. Ensure all tests pass
6. Update CHANGELOG.md
7. Submit pull request

## Code of Conduct

- Be respectful and inclusive
- Provide constructive feedback
- Focus on the code, not the person
- Help others learn and grow

## Questions?

Feel free to open an issue for questions or discussion!
55 changes: 53 additions & 2 deletions im2deep/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,54 @@
"""IM2Deep: Deep learning framework for peptide collisional cross section prediction."""
"""
IM2Deep: Deep learning framework for peptide collisional cross section prediction.

__version__ = "1.0.3"
IM2Deep is a Python package that provides accurate CCS (Collisional Cross Section)
prediction for peptides and modified peptides using deep learning models trained
specifically for TIMS (Trapped Ion Mobility Spectrometry) data.

Key Features:
- Single-conformer CCS prediction using ensemble of neural networks
- Multi-conformer CCS prediction for peptides with multiple conformations
- Linear calibration using reference datasets
- Support for modified peptides
- Ion mobility conversion utilities
- Command-line interface for easy usage

Example:
Basic usage for CCS prediction:

>>> from im2deep.im2deep import predict_ccs
>>> from psm_utils.psm_list import PSMList
>>> predictions = predict_ccs(psm_list, calibration_data)

Dependencies:
- deeplc: For deep learning model infrastructure
- psm_utils: For peptide and PSM handling
- pandas: For data manipulation
- numpy: For numerical computations
- click: For command-line interface

Authors:
- Robbe Devreese
- Robbin Bouwmeester
- Ralf Gabriels

License:
Apache License 2.0
"""

__version__ = "1.1.0"

# Import main functionality for easier access
from im2deep.im2deep import predict_ccs
from im2deep.calibrate import linear_calibration
from im2deep.utils import ccs2im, im2ccs
from im2deep._exceptions import IM2DeepError, CalibrationError

__all__ = [
"predict_ccs",
"linear_calibration",
"ccs2im",
"im2ccs",
"IM2DeepError",
"CalibrationError",
]
Loading