Skip to content

Commit 1540b40

Browse files
authored
Merge pull request #12 from TravisWheelerLab/dev
v0.3.0 reelease
2 parents 64c7cdc + aba8e19 commit 1540b40

37 files changed

Lines changed: 3173 additions & 1555 deletions

Cargo.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,3 @@ opt-level = 3
1111

1212
[profile.release]
1313
opt-level = 3
14-
# lto = true
15-
# codegen-units = 1

README.md

Lines changed: 113 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ To run the `nail search` pipeline, `mmseqs search` must be available in your sys
3535
To install nail, you'll need the Rust development tooling, which means you'll need to install the Rust compiler and Cargo.
3636
The easiest way to do that is to use [rustup](https://rustup.rs/).
3737

38+
*Note: this may seem like a slight barrier to entry, but it's as simple as running a single shell command.
39+
That being said, we plan to begin releasing pre-compiled binaries for several platforms in the next release*
40+
3841
Once Cargo is installed, you can install nail with:
3942

4043
cargo install nail
@@ -55,7 +58,11 @@ For example, try running:
5558

5659
## Usage
5760

58-
The nail command line interface has two subcommands: `search` and `seed`.
61+
The nail command line interface uses subcommands.
62+
63+
Currently, there is only one subcommand: `search`
64+
65+
*Note: that may seem a little strange, but we will be adding subcommands in the near future
5966

6067
### nail search
6168

@@ -64,40 +71,19 @@ The `nail search` command runs the entire nail pipeline, including running MMseq
6471
The input to `nail search` is a query file (p7HMM or FASTA) and a target sequence database file (FASTA).
6572

6673
By default, the search results will be written to `./results.tbl` in a tabular format, and alignment output is written to stdout.
67-
In addition, a collection of temporary files required to run `mmseqs search`, will be written to the `./prep/` directory.
74+
In addition, a collection of temporary files required to run `mmseqs search`, will be written to the `./tmp/` directory.
6875

6976
For example, when running nail search, you'll see something like:
7077

71-
$ nail search query.hmm target.fa
78+
$ nail search query.hmm target.fa
79+
reading query database... done (0.00s)
80+
indexing target database... done (0.00s)
81+
running mmseqs... done (0.44s)
82+
running nail pipeline... done (0.16s)
7283

73-
== score: 257.1 bits; E-value: 9.7e-79
74-
7tm_1 2 NllVilvilrnkklrtptnifllnLavaDllvlllvlpfslvyallegdwvfgevlCklvtaldvvnltasillltaisi 81
75-
N +Vi++++r++kl+tp+n+++ +La++Dllv++lv+p+s++y++ +g+w++g++lC+++ + d++++tasi++l++i++
76-
O08892|reviewed|5-hydroxytryptamine 66 NAFVIATVYRTRKLHTPANYLIASLAFTDLLVSILVMPISTMYTV-TGRWTLGQALCDFWLSSDITCCTASIMHLCVIAL 145
77-
9********************************************06*********************************
78-
79-
7tm_1 82 DRYlaIvkplkykrirtkrralvlilvvWvlalllslppllfsgtktesaekeetvClidfpeeestwevsytlllsvlg 161
80-
DRY+aI+ ++ y+++rt+rra+ +i++vWv+++++slpp+++++ k e +e+ Cl+++++ v yt++++ ++
81-
O08892|reviewed|5-hydroxytryptamine 146 DRYWAITDAVGYSAKRTPRRAAGMIALVWVFSICISLPPFFWRQAKAE---EEVLDCLVNTDH------VLYTVYSTGGA 225
82-
*****************************************777666500099******99990000009**********
83-
84-
7tm_1 162 fllpllvilvcyvrilrtlrksakkeks.................................................... 241
85-
f+lp+l+++ +y ri+ ++r++ k++
86-
O08892|reviewed|5-hydroxytryptamine 226 FYLPTLLLIALYGRIYVEARSRILKQTPNKTGKRLTRAQLITDSPGSTSSVTSINSRAPEVPCDSGSPVYVNQVKVRVSD 305
87-
***********************9999899999999999999999999********************************
88-
89-
7tm_1 242 ....rkkksarkerkalktllvvvvvfvlcwlPyfilllldsllkeceseklve.tallitlllayvnsclNPiiY 317
90-
+kk +a++erka+ktl+v++++f++cwlP+fi++l++ + c++ + + ++++++++l+y+ns++NPiiY
91-
O08892|reviewed|5-hydroxytryptamine 306 ALLEKKKLMAARERKATKTLGVILGAFIVCWLPFFIISLVMPI---CKDACWFHMAIFDFFTWLGYLNSLINPIIY 381
92-
***9999************************************000777666551666******************
93-
...
94-
...
95-
...
96-
97-
Checking the `results.tbl` might look something like:
84+
Checking the `results.tbl` will look something like:
9885

9986
$ head -n 15 results.bl
100-
10187
# target target query query comp cell
10288
# target query start end start end score bias evalue frac
10389
# ------------------------------------------------------- --------------- ------ ------ ----- ----- ----- ---- ------- -----
@@ -115,13 +101,100 @@ Checking the `results.tbl` might look something like:
115101
E7F7V7|reviewed|Galanin 7tm_1-consensus 43 294 1 260 142.6 1.7 1.4e-43 0.073
116102

117103

118-
### nail seed
104+
nail can also produce alignment output if you supply an `--ali-out` argument:
105+
106+
$ nail search --ali-out results.ali query.hmm target.fa
107+
119108

120-
The `nail seed` command runs MMseqs2 and produces a `seeds.json` file.
109+
Checking the `results.ali` will look something like:
110+
111+
$ head -n 70 results.ali
112+
query: 7tm_1
113+
target: O08892|reviewed|5-hydroxytryptamine
114+
query start: 2
115+
query end: 260
116+
target start: 66
117+
target end: 368
118+
score: 257.7
119+
comp bias: 9.3
120+
E-value: 6.3e-79
121+
cell frac: 0.094
122+
123+
==
124+
125+
7tm_1 2 NllVilvilrnkklrtptnifllnLavaDllvlllvlpfslvyallegdwvfgevlCklvtaldvvnltasillltaisi 81
126+
N +Vi++++r++kl+tp+n+++ +La++Dllv++lv+p+s++y++ +g+w++g++lC+++ + d++++tasi++l++i++
127+
O08892|reviewed|5-hydroxytryptamine 66 NAFVIATVYRTRKLHTPANYLIASLAFTDLLVSILVMPISTMYTV-TGRWTLGQALCDFWLSSDITCCTASIMHLCVIAL 144
128+
9********************************************06*********************************
129+
130+
7tm_1 82 DRYlaIvkplkykrirtkrralvlilvvWvlalllslppllfsgtktesaekeetvClidfpeeestwevsytlllsvlg 161
131+
DRY+aI+ ++ y+++rt+rra+ +i++vWv+++++slpp+++++ k e +e+ Cl+++++ v yt++++ ++
132+
O08892|reviewed|5-hydroxytryptamine 145 DRYWAITDAVGYSAKRTPRRAAGMIALVWVFSICISLPPFFWRQAKAE---EEVLDCLVNTDH------VLYTVYSTGGA 215
133+
*****************************************777666500099******99990000009**********
134+
135+
7tm_1 162 fllpllvilvcyvrilrtlrksakkeks.................................................... 189
136+
f+lp+l+++ +y ri+ ++r++ k++
137+
O08892|reviewed|5-hydroxytryptamine 216 FYLPTLLLIALYGRIYVEARSRILKQTPNKTGKRLTRAQLITDSPGSTSSVTSINSRAPEVPCDSGSPVYVNQVKVRVSD 295
138+
***********************9999899999999999999999999********************************
139+
140+
7tm_1 190 ....rkkksarkerkalktllvvvvvfvlcwlPyfilllldsllkeceseklve.tallitlllayvnsclNPiiY 260
141+
+kk +a++erka+ktl+v++++f++cwlP+fi++l++ + c++ + + ++++++++l+y+ns++NPiiY
142+
O08892|reviewed|5-hydroxytryptamine 296 ALLEKKKLMAARERKATKTLGVILGAFIVCWLPFFIISLVMPI---CKDACWFHMAIFDFFTWLGYLNSLINPIIY 368
143+
***9999************************************000777666551666******************
144+
145+
//
146+
147+
query: 7tm_1
148+
target: O02666|reviewed|Alpha-1D
149+
query start: 1
150+
query end: 260
151+
target start: 118
152+
target end: 407
153+
score: 255.6
154+
comp bias: 5.5
155+
E-value: 2.8e-78
156+
cell frac: 0.061
157+
158+
==
159+
160+
7tm_1 1 gNllVilvilrnkklrtptnifllnLavaDllvlllvlpfslvyallegdwvfgevlCklvtaldvvnltasillltais 80
161+
gNllVil +++n++l+t+tn+f++nLavaDll++++vlpfs++ ++l g w fg+++C+++ a+dv+++tasil+l+ is
162+
O02666|reviewed|Alpha-1D 118 GNLLVILSVACNRHLQTVTNYFIVNLAVADLLLSATVLPFSATMEVL-GFWAFGRAFCDVWAAVDVLCCTASILSLCTIS 196
163+
8*********************************************70********************************
164+
165+
7tm_1 81 iDRYlaIvkplkykrirtkrralvlilvvWvlalllslppllfsgtktesaekeetvClidfpeeestwevsytlllsvl 160
166+
+DRY+ + + lky++i+t r+a++++++ W++al++s+ pll g+k+ + +e++C i+ + y++++s++
167+
O02666|reviewed|Alpha-1D 197 VDRYVGVRHSLKYPAIMTERKAAAILALLWAVALVVSMGPLL--GWKEPVP-PDERFCGITEEV-------GYAVFSSLC 266
168+
******************************************00677776609*******87650000000*********
169+
170+
7tm_1 161 gfllpllvilvcyvrilrtlrksakkeks............................................rkkksar 196
171+
+f+lp+ vi+v+y+r++ +r++ ++ + + +++
172+
O02666|reviewed|Alpha-1D 267 SFYLPMAVIVVMYCRVYVVARSTTRSLEAGVKRERGKASEVVLRIHCRGAASGADGAPGTRGAKGHTFRSSLSVRLLKFS 346
173+
***************************99999999999999999999999999999999999999999999986677778
174+
175+
7tm_1 197 kerkalktllvvvvvfvlcwlPyfilllldsllkeceseklvetallitlllayvnsclNPiiY 260
176+
+e+ka+ktl++vv+vfvlcw+P+f++l l sl ++ k +e +++++ +l+y+nsc+NP+iY
177+
O02666|reviewed|Alpha-1D 347 REKKAAKTLAIVVGVFVLCWFPFFFVLPLGSL---FPQLKPSEGVFKVIFWLGYFNSCVNPLIY 407
178+
899*****************************0009****************************
179+
180+
//
181+
182+
...
183+
...
184+
...
185+
186+
### nail seeds
187+
188+
If you run `nail search --only-seed` command, nail will run MMseqs2, produces `seeds.json` file, and terminate.
189+
This may be useful if you would like to experiment with different nail settings using the same seeds.
121190

122191
For example:
123192

124-
$ nail seed query.hmm target.fa
193+
$ nail search --only-seed query.hmm target.fa
194+
195+
You can also save the seeds from a full run of the `nail search` pipeline by supplying a `--seeds-out` argument:
196+
197+
$ nail search --seeds-out seeds.json query.hmm target.fa
125198

126199
Seeds can be provided to `nail search` using the `--seeds <seeds.json>` flag, which will skip the seed step in the search pipeline.
127200

@@ -133,12 +206,12 @@ In practice, these seeds may be produced from any source as long as they are for
133206
{
134207
"query1": {
135208
"target1": {
136-
"target_start": 48,
137-
"target_end": 287,
138-
"profile_start": 1,
139-
"profile_end": 259,
140-
"score": 168.0
141-
},
209+
"target_start": 48, // <- these are the positions from which
210+
"target_end": 287, // < nail will begin the cloud search
211+
"profile_start": 1, // <
212+
"profile_end": 259, // <
213+
"score": 168.0 // <--- the score field is used to pick between
214+
}, seeds that compete with each other
142215
"target2": {
143216
"target_start": 72,
144217
"target_end": 343,
@@ -159,6 +232,8 @@ In practice, these seeds may be produced from any source as long as they are for
159232
}
160233
```
161234

235+
We plan to make the use of custom seeds more robust in the future.
236+
162237
## License
163238

164239
nail is licensed under the BSD-3-Clause license.

libnail/CHANGELOG.md

Lines changed: 62 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

77
<!---
8+
## [Unreleased]
89
### Added
910
### Changed
1011
### Deprecated
@@ -14,68 +15,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1415
-->
1516

1617

17-
## [Unreleased]
18+
## [0.3.0] - 2024-12-23
1819

1920
### Added
21+
- added `min()` to `Score`, `Nats`, and `Bits`
22+
- added `Alignment::vert_string()`
23+
- added consts `Alignment::PROFILE_GAP_BYTE` and `Alignment::TARGET_GAP_BYTE`
24+
- added `TraceStep::is_core_state()`
2025

2126
### Changed
22-
23-
### Deprecated
24-
25-
### Removed
27+
- `Sequence` and `DpMatrixSparse` and now call `shrink_to_fit()` on internal data
28+
- `Profile::raise_relative_entropy()` is now `adjust_mean_relative_entropy()`
29+
- the mean relative entropy (MRE) can now be raised or lowered
30+
- the algorithm for raising (MRE) has been improved
31+
- `util::avg_relative_entropy()` is now `mean_relative_entropy()`
32+
- parse_hmms_from_p7hmm_file(path) is now Hmm::from_p7hmm(buf)
33+
- refactored Alignment struct
34+
- fields are now grouped into sub-structs
35+
- refactored AlignmentBuilder for changes
36+
- added impl for `AsRef\<Alignment\>`
37+
- `DpMatrixSparse` should now resize properly
38+
- `CloudSearchScores` renamed to `CloudSearchResults`, added `num_cells_computed` field
39+
- `TableFormat::update_widths()` now takes a slice of `AsRef\<Alignment\>` instead of `&\[Alignment\]`
40+
- changed the formatting of the output of `Alignment::ali_string()`
2641

2742
### Fixed
43+
- Fixed the score returned from `Forward()` so that it includes N/C state
44+
transitions from outside of the cloud
45+
- Fixed an alignment boundary computation bug
2846

2947

3048
## [0.2.0] - 2024-07-12
3149

3250
### Added
3351

34-
- added Nats and Bits structs
35-
- added AlignmentBuilder struct
36-
- added Profile::raise_relative_entropy()
37-
- added Profile::calibrate_tau()
38-
- added Hmm::from_blosum_62_and_sequence()
39-
- added Sequence::random_amino()
40-
- added several AntiDiagonal methods:
41-
- valid()
42-
- reset()
43-
- is_default()
44-
- is_single_cell()
45-
- intersects()
46-
- merge()
47-
- replace_with()
48-
- grow_up()
49-
- grow_down()
50-
- grow_left()
51-
- grow_right()
52-
- added several AntiDiagonalBounds methods:
53-
- square_corners()
54-
- advance_forward()
55-
- advance_reverse()
56-
- bounding_box()
57-
- left_offset_to()
58-
- right_offset_to()
59-
- cloud_relationship()
60-
- vec_image()
61-
- ascii()
62-
- added many unit tests for AntiDiagonal and AntiDiagonalBounds
63-
- added unit tests for DpMatrixFlat and DpMatrixSparse
52+
- added `Nats` and `Bits` structs
53+
- added `AlignmentBuilder` struct
54+
- added `Profile::raise_relative_entropy()`
55+
- added `Profile::calibrate_tau()`
56+
- added `Hmm::from_blosum_62_and_sequence()`
57+
- added `Sequence::random_amino()`
58+
- added several `AntiDiagonal` methods:
59+
- `valid()`
60+
- `reset()`
61+
- `is_default()`
62+
- `is_single_cell()`
63+
- `intersects()`
64+
- `merge() `
65+
- `replace_with()`
66+
- `grow_up()`
67+
- `grow_down()`
68+
- `grow_left()`
69+
- `grow_right()`
70+
- added several `AntiDiagonalBounds` methods:
71+
- `square_corners()`
72+
- `advance_forward()`
73+
- `advance_reverse()`
74+
- `bounding_box()`
75+
- `left_offset_to()`
76+
- `right_offset_to()`
77+
- `cloud_relationship()`
78+
- `vec_image()`
79+
- `ascii()`
80+
- added many unit tests for `AntiDiagonal` and `AntiDiagonalBounds`
81+
- added unit tests for `DpMatrixFlat` and `DpMatrixSparse`
6482
- added `debug` Cargo feature:
65-
- image crate dependency
66-
- AntiDiagonalBounds::image()
67-
- added VecUtils trait for some common numerical vector operations
83+
- `image` crate dependency
84+
- `AntiDiagonalBounds::image()`
85+
- added `VecUtils` trait for some common numerical vector operations
6886

6987
### Changed
7088

71-
- Nats and Bits structs are now used to represent alignment scores
72-
- most fields on the Alignment struct are now Option<T>
73-
- renamed CloudBound to AntiDiagonal
74-
- renamed AntiDiagonalBounds::join_merge() to merge() and improved merging logic to handle more edge cases
75-
- added score field to Seed struct
89+
- `Nats` and `Bits` structs are now used to represent alignment scores
90+
- most fields on the `Alignment` struct are now `Option<T>`
91+
- renamed `CloudBound` to `AntiDiagonal`
92+
- renamed `AntiDiagonalBounds::join_merge()` to `merge()` and improved merging logic to handle more edge cases
93+
- added `score` field to `Seed` struct
7694
- refactored and improved tabular output
7795

7896
### Removed
7997

80-
- removed DPMatrix3D struct
98+
- removed `DPMatrix3D` struct
8199

libnail/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "libnail"
3-
version = "0.2.0"
3+
version = "0.3.0"
44
authors = ["Jack Roddy <jack.w.roddy@gmail.com>"]
55
edition = "2021"
66
license = "BSD-3-Clause"

0 commit comments

Comments
 (0)