Skip to content

Commit

Permalink
upd
Browse files Browse the repository at this point in the history
  • Loading branch information
bluegenes committed Dec 13, 2024
1 parent dece8f8 commit b28a1c7
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 71 deletions.
49 changes: 24 additions & 25 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

26 changes: 13 additions & 13 deletions src/python/sourmash_plugin_branchwater/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -180,8 +180,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -257,8 +257,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -341,8 +341,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -443,8 +443,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -530,8 +530,8 @@ def __init__(self, p):
"-m",
"--moltype",
default="DNA",
choices=["DNA", "protein", "dayhoff", "hp", "skipmer"],
help="molecule type (DNA, protein, dayhoff, hp, or skipmer; default DNA)",
choices=["DNA", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"],
help="molecule type: DNA, protein, dayhoff, hp, or skipmer (skipm1n3 or skipm2n3); default DNA",
)
p.add_argument(
"-c",
Expand Down Expand Up @@ -618,7 +618,7 @@ def main(self, args):
args.param_string = ["k=31,scaled=1000,dna"]

# Check and append 'dna' if no moltype is found in a param string
moltypes = ["dna", "protein", "dayhoff", "hp", "skipmer"]
moltypes = ["dna", "protein", "dayhoff", "hp", "skipm1n3", "skipm2n3"]
updated_param_strings = []

for param in args.param_string:
Expand Down
Binary file modified src/python/tests/test-data/SRR606249.skipmer.zip
Binary file not shown.
Binary file modified src/python/tests/test-data/skipmer.zip
Binary file not shown.
12 changes: 6 additions & 6 deletions src/python/tests/test_fastgather.py
Original file line number Diff line number Diff line change
Expand Up @@ -1364,24 +1364,24 @@ def test_equal_matches(runtmp):
assert set(df["intersect_bp"]) == {1000}


def test_simple_skipmer(
def test_simple_skipm2n3(
runtmp, capfd, indexed_query, indexed_against, toggle_internal_storage
):
# test basic execution!
query = get_test_data("SRR606249.skipmer.zip")
against = get_test_data("skipmer.zip") # contains 2,47,63
query = get_test_data("SRR606249.skipm2n3.zip")
against = get_test_data("skipm2n3.zip") # contains 2,47,63

if indexed_query:
query = index_siglist(
runtmp, query, runtmp.output("query"), scaled=100000, moltype="skipmer"
runtmp, query, runtmp.output("query"), scaled=100000, moltype="skipm2n3"
)

if indexed_against:
against = index_siglist(
runtmp,
against,
runtmp.output("db"),
moltype="skipmer",
moltype="skipm2n3",
toggle_internal_storage=toggle_internal_storage,
)

Expand All @@ -1392,7 +1392,7 @@ def test_simple_skipmer(
"scripts",
"fastgather",
"--moltype",
"skipmer",
"skipm2n3",
query,
against,
"-o",
Expand Down
28 changes: 14 additions & 14 deletions src/python/tests/test_sketch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,7 +1438,7 @@ def test_singlesketch_zip_output(runtmp):
assert sig.minhash.hashes == sig2.minhash.hashes


def test_manysketch_skipmer(runtmp, capfd):
def test_manysketch_skipm2n3(runtmp, capfd):
fa_csv = runtmp.output("db-fa.csv")

fa1 = get_test_data("short.fa")
Expand All @@ -1459,7 +1459,7 @@ def test_manysketch_skipmer(runtmp, capfd):
"--param-str",
"dna,k=21,scaled=1",
"--param-str",
"skipmer,k=31,scaled=30",
"skipm2n3,k=31,scaled=30",
)

assert os.path.exists(output)
Expand Down Expand Up @@ -1497,22 +1497,22 @@ def test_manysketch_skipmer(runtmp, capfd):
"name": "short",
"ksize": 31,
"scaled": 30,
"moltype": "skipmer",
"md5sum": "c7b5b8d98c6fde00e2a25769d5eb470a",
"moltype": "skipm2n3",
"md5sum": "0486fcae73545363da9cd5bfcf18d322",
},
{
"name": "short3",
"ksize": 31,
"scaled": 30,
"moltype": "skipmer",
"md5sum": "ed5bbe1b2a9a5cd83a6c8583e8122518",
"moltype": "skipm2n3",
"md5sum": "890557b39ae66d3177035296818de7c6",
},
{
"name": "short2",
"ksize": 31,
"scaled": 30,
"moltype": "skipmer",
"md5sum": "13c456b9a346284d0acdf49b3e529da6",
"moltype": "skipm2n3",
"md5sum": "ec6305f5d82e51659f3914d47fcc32ee",
},
]
expected_signatures_dict = {exp["md5sum"]: exp for exp in expected_signatures}
Expand All @@ -1524,7 +1524,7 @@ def test_manysketch_skipmer(runtmp, capfd):
manifest_reader = csv.DictReader(manifest_data)

for row in manifest_reader:
if row["moltype"] == "skipmer":
if row["moltype"] == "skipm2n3":
print("Manifest Row:", row)

# Validate row fields
Expand Down Expand Up @@ -1567,14 +1567,14 @@ def test_manysketch_skipmer(runtmp, capfd):
), f"Moltype mismatch: {siginfo['molecule']}"


def test_singlesketch_skipmer(runtmp):
"""Test singlesketch with skipmers."""
def test_singlesketch_skipm2n3(runtmp):
"""Test singlesketch with skipm2n3."""
fa1 = get_test_data("short.fa")
output = runtmp.output("short.sig")

# Run the singlesketch command
runtmp.sourmash(
"scripts", "singlesketch", fa1, "-p", "skipmer,k=31,scaled=100", "-o", output
"scripts", "singlesketch", fa1, "-p", "skipm2n3,k=31,scaled=100", "-o", output
)

# Check if the output exists and contains the expected data
Expand All @@ -1593,8 +1593,8 @@ def test_singlesketch_skipmer(runtmp):
{
"name": "short.fa",
"ksize": 31,
"moltype": "skipmer",
"md5sum": "33025b8f1859b7836b99347c217b9dc4",
"moltype": "skipm2n3",
"md5sum": "387d25c8e4b4878c78872efd13621491",
}
]

Expand Down
Loading

0 comments on commit b28a1c7

Please sign in to comment.