epimetheus_methylome
A Rust library for DNA motif representation and methylation analysis, with support for IUPAC nucleotide codes and Nanopore methylation data.
Features
- DNA Motif Handling: Create, manipulate, and search for DNA motifs with modification sites
- IUPAC Support: Full support for IUPAC nucleotide codes (including ambiguous bases like R, Y, N, etc.)
- Methylation Types: Support for common DNA modifications:
- 6mA (N6-methyladenine)
- 5mC (5-methylcytosine)
- 4mC (4-methylcytosine)
- Motif Operations: Reverse complement, regex conversion, motif clustering/hierarchy
- Nanopore Integration: Parse methylation data from FASTQ records with MM/ML tags
Installation
Add this to your Cargo.toml:
[]
= "1.1.0"
Usage
Creating and Working with Motifs
use ;
// Create a GATC motif with 6mA modification at position 1
let motif = new.unwrap;
assert_eq!;
// Get reverse complement
let rev_comp = motif.reverse_complement;
assert_eq!;
// Convert to regex pattern
let regex = motif.to_regex;
assert_eq!;
IUPAC Nucleotide Codes
use ;
// Create motif with ambiguous bases
let motif = new.unwrap;
// R = A or G, Y = C or T
// Convert to regex
let regex = motif.to_regex;
assert_eq!;
// Get all possible DNA sequences
let sequences = motif.possible_dna_sequences;
// Returns all combinations: AGATCC, AGATCT, GGATCC, GGATCT
Methylation Types
use ModType;
// Parse from pileup codes
let mod_type = "a"..unwrap;
assert_eq!;
// Get pileup code
assert_eq!;
assert_eq!;
Finding Motifs in Sequences
use ;
use Sequence;
let sequence = from_str.unwrap;
let motif = new.unwrap;
let indices = find_motif_indices_in_sequence;
assert_eq!; // Returns modification positions
Motif Hierarchy
use Motif;
// Check parent-child relationships
let parent = new.unwrap;
let child = new.unwrap;
assert!;
Working with Nanopore Data
use Read;
use noodles_fastq as fastq;
// Parse FASTQ record with MM/ML tags
let record = new;
let read = from_fastq_record.unwrap;
let modifications = read.get_modifications;
// Access methylation calls at specific positions
// first and third A should have the methylation scores 204 and 255, respectively
API Documentation
For detailed API documentation, see docs.rs/epimetheus_methylome.
Use Cases
This library is designed for:
- Bioinformatics pipelines processing Nanopore methylation data
- Restriction enzyme motif analysis
- Methylation pattern detection and quantification
- Motif clustering and hierarchical analysis
License
MIT
Contributing
This crate is part of the Epimetheus project for analyzing methylation patterns from pileup files.