Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MRG] add sourmash sig grep #1864

Merged
merged 30 commits into from
Mar 7, 2022
Merged
Changes from 1 commit
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
30bf6b9
upgrade 'manifest' documentation, cli help
ctb Mar 5, 2022
f891e11
alias fileinfo to summarize
ctb Mar 5, 2022
4fb5f99
flakes cleanup
ctb Mar 5, 2022
7eab2f6
rescue shadowed tests
ctb Mar 5, 2022
7feaad7
rescue shadowed tests
ctb Mar 5, 2022
31d5586
rescue shadowed tests
ctb Mar 5, 2022
c7b63eb
add 'sig grep' command
ctb Mar 5, 2022
44979e5
add some basic tests
ctb Mar 5, 2022
ebe2334
fix get manifest stuff
ctb Mar 5, 2022
5a311c1
fail on no manifest
ctb Mar 5, 2022
9bbc3f6
check manifest req't
ctb Mar 5, 2022
591c352
Merge branch 'latest' of https://github.com/sourmash-bio/sourmash int…
ctb Mar 5, 2022
5f6ad7f
test various combinations of zip, -v, -i
ctb Mar 5, 2022
5a2cce5
Merge branch 'latest' of https://github.com/sourmash-bio/sourmash int…
ctb Mar 5, 2022
c19f31e
update with CSV output/manifest
ctb Mar 5, 2022
4ff79cf
added -c/--count
ctb Mar 6, 2022
3baa0e2
adjust output
ctb Mar 6, 2022
d2d600e
test fail extract
ctb Mar 6, 2022
8b0a815
comment tests better
ctb Mar 7, 2022
66232fc
add test for count
ctb Mar 7, 2022
0f248e5
update docs
ctb Mar 7, 2022
9a00d53
remove warnings
ctb Mar 7, 2022
00c3afb
cleanup; create CollectionManifest.filter_rows
ctb Mar 7, 2022
1072608
create CollectionManifest.filter_on_columns
ctb Mar 7, 2022
56a8992
minor cleanup
ctb Mar 7, 2022
4d460c1
Merge branch 'latest' into add/sig_grep
ctb Mar 7, 2022
ef4f33f
Merge branch 'latest' into add/sig_grep
ctb Mar 7, 2022
351c65e
Merge branch 'latest' into add/sig_grep
ctb Mar 7, 2022
13fcfbd
Update src/sourmash/cli/sig/grep.py
ctb Mar 7, 2022
76b2b02
Add a straight up picklist test
ctb Mar 7, 2022
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
Prev Previous commit
Next Next commit
add test for count
  • Loading branch information
ctb committed Mar 7, 2022
commit 66232fce22b5a178d8555f2b7a5f5af12daafbbd
37 changes: 37 additions & 0 deletions tests/test_cmd_signature_grep.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,3 +286,40 @@ def test_sig_grep_7_picklist_md5_lca_fail(runtmp):
# LCA databases don't support multiple picklists.
print(runtmp.last_result.err)
assert "This input collection doesn't support 'grep' with picklists." in runtmp.last_result.err


def test_sig_grep_8_count(runtmp):
zips = ['prot/all.zip',
'prot/dayhoff.sbt.zip',
'prot/dayhoff.zip',
'prot/hp.sbt.zip',
'prot/hp.zip',
'prot/protein.sbt.zip',
'prot/protein.zip']

zip_src = [ utils.get_test_data(x) for x in zips ]

os.mkdir(runtmp.output('prot'))
for src, dest in zip(zip_src, zips):
shutil.copyfile(src, runtmp.output(dest))

runtmp.sourmash('sig', 'grep', '-c', '0015939', *zips)

out = runtmp.last_result.out
err = runtmp.last_result.err

print(out)
print(err)

assert "(no signatures will be saved because of --silent/--count)." in err

for line in """\
6 matches: prot/all.zip
2 matches: prot/dayhoff.sbt.zip
2 matches: prot/dayhoff.zip
2 matches: prot/hp.sbt.zip
2 matches: prot/hp.zip
2 matches: prot/protein.sbt.zip
2 matches: prot/protein.zip
""".splitlines():
assert line.strip() in out