fasta_lake.rust.binaries#
fasta_lake.rust.binaries
#
Rust binary discovery and execution.
Locates compiled Rust binaries (fasta_extractor, lake_builder)
and provides Python wrappers for invoking them with proper arguments.
find_binary
#
find_binary(name: str, search_dir: str | Path | None = None, explicit_path: str | Path | None = None) -> Path
Locate a compiled Rust binary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Binary name (e.g., |
required |
search_dir
|
str or Path
|
Base directory to search from. Defaults to the FastaLake repo root. |
None
|
explicit_path
|
str or Path
|
If provided, use this path directly (from config). |
None
|
Returns:
| Type | Description |
|---|---|
Path
|
Absolute path to the binary. |
Raises:
| Type | Description |
|---|---|
FileNotFoundError
|
If the binary cannot be found. |
Source code in fasta_lake/rust/binaries.py
run_fasta_extractor
#
run_fasta_extractor(database: str | Path, predictions: str | Path, output: str | Path, source_tag: str = 'REF', normalize_il: bool = True, min_length: int = 9, max_length: int = 50, top_percent: float | None = None, output_hits: str | Path | None = None, threads: int | None = None, binary_path: str | Path | None = None) -> dict
Run the Rust fasta_extractor binary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
database
|
str or Path
|
Reference FASTA database. |
required |
predictions
|
str or Path
|
Predictions CSV file or directory. |
required |
output
|
str or Path
|
Output FASTA path. |
required |
source_tag
|
str
|
Source tag for output headers. |
'REF'
|
normalize_il
|
bool
|
Enable I/L normalization. |
True
|
min_length
|
int
|
Minimum peptide length. |
9
|
max_length
|
int
|
Maximum peptide length. |
50
|
top_percent
|
float
|
Keep top N% peptides per sample by score. |
None
|
output_hits
|
str or Path
|
Path for peptide-protein hits TSV. |
None
|
threads
|
int
|
Number of threads. |
None
|
binary_path
|
str or Path
|
Explicit path to binary. |
None
|
Returns:
| Type | Description |
|---|---|
dict
|
Stats from the |
Source code in fasta_lake/rust/binaries.py
106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 | |
run_lake_builder
#
run_lake_builder(sources: list[tuple[str, int, str]], output: str | Path, threads: int | None = None, binary_path: str | Path | None = None) -> None
Run the Rust lake_builder binary.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sources
|
list[tuple[str, int, str]]
|
List of (tag, priority, path) tuples for each source database. |
required |
output
|
str or Path
|
Output lake FASTA path. |
required |
threads
|
int
|
Number of threads. |
None
|
binary_path
|
str or Path
|
Explicit path to binary. |
None
|