1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
use crate;
/// Gene finding results from Orphos analysis.
///
/// Contains all information from a gene prediction run including
/// predicted genes, training parameters, and sequence statistics.
///
/// # Fields
///
/// - `genes`: Vector of predicted genes sorted by position
/// - `training_used`: Statistical model parameters from training
/// - `sequence_info`: Metadata about the analyzed sequence
/// - `metagenomic_model`: Model name if metagenomic mode was used
///
/// # Examples
///
/// ```rust,no_run
/// use orphos_core::{OrphosAnalyzer, config::OrphosConfig, config::OutputFormat};
/// use orphos_core::output::write_results;
///
/// let mut analyzer = OrphosAnalyzer::new(OrphosConfig::default());
/// let results = analyzer.analyze_sequence("ATGCGATCG...", None)?;
///
/// println!("Sequence: {}", results.sequence_info.header);
/// println!("Length: {} bp", results.sequence_info.length);
/// println!("GC%: {:.2}", results.sequence_info.gc_content * 100.0);
/// println!("Genes: {}", results.genes.len());
///
/// // Write results to file
/// let mut output = std::fs::File::create("output.gbk")?;
/// write_results(&mut output, &results, OutputFormat::Genbank)?;
/// # Ok::<(), Box<dyn std::error::Error>>(())
/// ```
/// Information about a processed sequence.
///
/// Contains metadata and statistics for a sequence that was analyzed.
///
/// # Examples
///
/// ```rust,no_run
/// # use orphos_core::results::SequenceInfo;
/// let info = SequenceInfo {
/// length: 4_641_652,
/// gc_content: 0.5079,
/// num_genes: 4321,
/// header: "E. coli K12".to_string(),
/// description: Some("Complete genome".to_string()),
/// };
///
/// println!("{}: {} bp, {:.2}% GC, {} genes",
/// info.header,
/// info.length,
/// info.gc_content * 100.0,
/// info.num_genes);
/// ```