-
Notifications
You must be signed in to change notification settings - Fork 55
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
Use --noextend
in NUCmer as a rule
#342
Comments
Thoughts on implementation:
a mutually-exclusive argument group seems like the best way to do this. |
See first attempt on branch I've not yet updated any tests, but I have run this locally, and the CLI is working as I would expect; i.e., the default behaviour is |
This is going to require some more serious work on the tests (which I will do at more respectable hours): ! pytest -v
=============================================================== test session starts ================================================================
platform darwin -- Python 3.8.3, pytest-5.3.5, py-1.10.0, pluggy-0.13.1 -- /Users/baileythegreen/Software/miniconda3/bin/python
cachedir: .pytest_cache
rootdir: /Users/baileythegreen/Software/pyani, inifile: pytest.ini
plugins: dash-1.14.0, cov-2.11.1, ordering-0.6
collected 100 items
tests/test_anib.py::test_get_version_no_exe PASSED [ 1%]
tests/test_anib.py::test_get_version_exe_not_executable PASSED [ 2%]
tests/test_anib.py::test_get_version_exe_no_version PASSED [ 3%]
tests/test_anib.py::test_blastall_dbjobdict PASSED [ 4%]
tests/test_anib.py::test_blastall_graph PASSED [ 5%]
tests/test_anib.py::test_blastall_multiple PASSED [ 6%]
tests/test_anib.py::test_blastall_single PASSED [ 7%]
tests/test_anib.py::test_blastn_dbjobdict PASSED [ 8%]
tests/test_anib.py::test_blastn_graph PASSED [ 9%]
tests/test_anib.py::test_blastn_multiple PASSED [ 10%]
tests/test_anib.py::test_blastn_single PASSED [ 11%]
tests/test_anib.py::test_formatdb_multiple PASSED [ 12%]
tests/test_anib.py::test_formatdb_single PASSED [ 13%]
tests/test_anib.py::test_fragment_files PASSED [ 14%]
tests/test_anib.py::test_makeblastdb_multiple PASSED [ 15%]
tests/test_anib.py::test_makeblastdb_single PASSED [ 16%]
tests/test_anib.py::test_parse_legacy_blastdir PASSED [ 17%]
tests/test_anib.py::test_parse_blastdir PASSED [ 18%]
tests/test_anib.py::test_parse_blasttab PASSED [ 19%]
tests/test_anib.py::test_parse_legacy_blasttab PASSED [ 20%]
tests/test_aniblastall.py::test_get_version_missing_exe PASSED [ 21%]
tests/test_aniblastall.py::test_get_version_not_executable PASSED [ 22%]
tests/test_aniblastall.py::test_get_version_no_version PASSED [ 23%]
tests/test_aniblastall.py::test_get_version_os_incompatible PASSED [ 24%]
tests/test_anim.py::test_get_version_no_exe PASSED [ 25%]
tests/test_anim.py::test_get_version_exe_not_executable PASSED [ 26%]
tests/test_anim.py::test_get_version_exe_no_version PASSED [ 27%]
tests/test_anim.py::test_deltadir_parsing PASSED [ 28%]
tests/test_anim.py::test_deltafile_parsing PASSED [ 29%]
tests/test_anim.py::test_maxmatch_single FAILED [ 30%]
tests/test_anim.py::test_mummer_multiple FAILED [ 31%]
tests/test_anim.py::test_mummer_single FAILED [ 32%]
tests/test_anim.py::test_mummer_job_generation PASSED [ 33%]
tests/test_cli_parsing.py::test_createdb PASSED [ 34%]
tests/test_cli_parsing.py::test_download_single_genome PASSED [ 35%]
tests/test_concordance.py::test_anim_concordance FAILED [ 36%]
tests/test_concordance.py::test_anib_concordance PASSED [ 37%]
tests/test_concordance.py::test_aniblastall_concordance PASSED [ 38%]
tests/test_concordance.py::test_tetra_concordance PASSED [ 39%]
tests/test_dependencies.py::test_import_biopython PASSED [ 40%]
tests/test_dependencies.py::test_import_matplotlib PASSED [ 41%]
tests/test_dependencies.py::test_import_numpy PASSED [ 42%]
tests/test_dependencies.py::test_import_pandas PASSED [ 43%]
tests/test_dependencies.py::test_import_scipy PASSED [ 44%]
tests/test_dependencies.py::test_blastn_available PASSED [ 45%]
tests/test_dependencies.py::test_run_blastall XPASS [ 46%]
tests/test_dependencies.py::test_run_nucmer PASSED [ 47%]
tests/test_graphics.py::test_png_mpl PASSED [ 48%]
tests/test_graphics.py::test_svg_mpl PASSED [ 49%]
tests/test_graphics.py::test_pdf_mpl PASSED [ 50%]
tests/test_graphics.py::test_png_seaborn PASSED [ 51%]
tests/test_graphics.py::test_svg_seaborn PASSED [ 52%]
tests/test_graphics.py::test_pdf_seaborn PASSED [ 53%]
tests/test_jobs.py::test_create_job PASSED [ 54%]
tests/test_jobs.py::test_create_job_with_command PASSED [ 55%]
tests/test_jobs.py::test_add_dependency PASSED [ 56%]
tests/test_jobs.py::test_remove_dependency PASSED [ 57%]
tests/test_jobs.py::test_create_jobgroup PASSED [ 58%]
tests/test_jobs.py::test_1d_jobgroup PASSED [ 59%]
tests/test_jobs.py::test_2d_jobgroup PASSED [ 60%]
tests/test_jobs.py::test_add_group_dependency PASSED [ 61%]
tests/test_jobs.py::test_remove_group_dependency PASSED [ 62%]
tests/test_legacy_scripts.py::test_legacy_anim_sns PASSED [ 63%]
tests/test_legacy_scripts.py::test_legacy_anim_mpl PASSED [ 64%]
tests/test_legacy_scripts.py::test_legacy_anib_sns PASSED [ 65%]
tests/test_legacy_scripts.py::test_legacy_anib_mpl PASSED [ 66%]
tests/test_legacy_scripts.py::test_legacy_tetra_sns PASSED [ 67%]
tests/test_legacy_scripts.py::test_legacy_tetra_mpl PASSED [ 68%]
tests/test_legacy_scripts.py::test_legacy_genome_downloads PASSED [ 69%]
tests/test_multiprocessing.py::test_multiprocessing_run PASSED [ 70%]
tests/test_multiprocessing.py::test_cmdsets PASSED [ 71%]
tests/test_multiprocessing.py::test_dependency_graph_run PASSED [ 72%]
tests/test_parsing.py::test_anim_delta PASSED [ 73%]
tests/test_subcmd_01_download.py::test_download_dry_run PASSED [ 74%]
tests/test_subcmd_01_download.py::test_download_c_blochmannia PASSED [ 75%]
tests/test_subcmd_01_download.py::test_download_kraken PASSED [ 76%]
tests/test_subcmd_02_index.py::TestIndexSubcommand::test_index PASSED [ 77%]
tests/test_subcmd_02_index.py::TestIndexSubcommand::test_missing_index PASSED [ 78%]
tests/test_subcmd_03_createdb.py::TestCreatedbSubcommand::test_createdb PASSED [ 79%]
tests/test_subcmd_04_anim.py::TestANImSubcommand::test_anim FAILED [ 80%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_genomes PASSED [ 81%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_genomes_runs PASSED [ 82%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_matrices FAILED [ 83%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_results PASSED [ 84%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_runs PASSED [ 85%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_runs_genomes PASSED [ 86%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_jpg FAILED [ 87%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_pdf FAILED [ 88%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_png FAILED [ 89%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_svg FAILED [ 90%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_jpg FAILED [ 91%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_pdf FAILED [ 92%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_png FAILED [ 93%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_svg FAILED [ 94%]
tests/test_subcmd_07_classify.py::TestClassifySubcommand::test_classify_defaults FAILED [ 95%]
tests/test_subcmd_07_classify.py::TestClassifySubcommand::test_classify_no_thresh FAILED [ 96%]
tests/test_subcmd_08_anib.py::TestANIbsubcommand::test_anib XFAIL [ 97%]
tests/test_tetra.py::test_tetraclean PASSED [ 98%]
tests/test_tetra.py::test_zscore PASSED [ 99%]
tests/test_tetra.py::test_correlations PASSED [100%] |
I'm not sure about this. Where there's a two-state choice like "extend" or "noextend" where one choice is a default, I wouldn't expect the reselection of the default to be accommodated at all. Here, for instance:
and this avoids the problem of the mutually exclusive specification of both options. I think that's neater, and more closely matches my expectation as a user. |
This is going to require a bit of investigation and thought. There's a tension between:
Here's my initial idea:
3a. Change the top subcommand priority from 3b. Implement the 3c. Evaluate
What are your thoughts?
I'd definitely support that change! |
I was writing this before you sent the long message, explaining why I implemented both flags:
This is all a very front-end debate, so whether we allow both flags really only affects the parser. The rest of the changes are already made. (Though, your long message portends more extensive modifications.) |
I'm not convinced of that. I see it more as a
One of the major user-level differences between legacy BLAST and BLAST+ was the change in default BLASTN algorithm, which really does modify the output you get significantly in many cases. You can still select the original algorithm choice as an option. Sometimes it's OK just to make things "better" - I think what's important is that what is done is clear, and an option to revert is there for the user, if they want it. I don't think that having a different default in I don't think many users are strongly aware of the precise options we have for MUMmer and, in any case, if
I see that, but I think we're in a better position here than, for instance, tools with both a
It's the curse of thinking about things… |
When I saw how many tests it broke, I figured you'd be concerned about backwards compatibility. I think prioritising As for the balance between that and a more reliable approach: I don't think there's much virtue in maintaining backwards-compatibility of something that is unreliable. Now, calling
This is easily done; it's just a matter of changing the default value assigned in the parser.
This sounds like it might be useful, but I think it's probably a future debate, for now. At least, once I've been able to look more into it/what it would require. |
But in this case, MUMmer actually does have the equivalent of Idk. When I was adding it last night, just adding |
Some of my overthinking of this may also be complicated by the fact I chose to name the internal variable for this |
I agree. I think that the idea I'm trying to get across is this, for moving to Pros:
Cons:
The pros are good pros. We can investigate and evaluate the cons, and we absolutely need to before pushing out the change.
My motivation for proceeding step-wise and retaining backwards compatibility is to ensure that we don't have accidental code regressions as we implement the new option. Even if we implement MUMmer's
I think there's a possible outcome where |
Language constrains thought… as I think we've discussed offline ;) |
Yes. I think that's not the best design choice in MUMmer. |
Calling it anything else is just going to introduce more arbitrary language into the equation…. That doesn't seem helpful. |
Looking at our ANIm parser, we also have this: parser.add_argument(
"--nofilter",
dest="nofilter",
action="store_true",
default=False,
help="do not use delta-filter for 1:1 NUCmer matches",
) which I now Have Thoughts About. |
I don't have the same sense about it, I think. Where we want to force Where we want to force As well as the |
That may become redundant, depending on the way the |
It's the double negatives. I think they impede clarity of thought in things like this. That's why I don't like them in binary variable names. |
I see. I take your point. tl;drI'd like to retain I'm happy for you to swap the internal representation of the choice from why I think thatI think the way I've learned to accommodate this kind of thing is to consider who/what is "understanding" the code, and at what level. There are tradeoffs. For a command-line option, I think it's clearest to the user if the option describes what the option does intuitively. For instance, I guess I made the decision early, perhaps without thinking too much about it, that I preferred the single-option approach for toggles, which led towards the first set of options. I think it's concise, and easier to parse (practically - we don't need to check argument validity, for example). Having made that decision, the readability burden is then on the coder. Both options: parser.add_argument(
"--nofilter",
dest="nofilter",
action="store_true",
help="do not use delta-filter for 1:1 NUCmer matches",
) leading to a variable named parser.add_argument(
"--nofilter",
dest="filter",
action="store_false",
help="do not use delta-filter for 1:1 NUCmer matches",
) leading to a variable named
Both are valid and correct (as far as the computer cares…), but being the sole developer so long meant I didn't have to think about both perspectives. My code reading tends to see variable names as labels, and I think you're picking up on the syntax to a greater extent. |
Following discussion in Issue #342.
Looking at the details of the failed tests right now, and it may be that many of the failures are down to the change in the submitted NUCmer commands. I'm going to create a second branch locally, so I can test both default behaviours—fixing the tests so they pass, unless it's due to actual differences in results—and then we can decide what to do with that. |
Good news! On my local This may still mean there is a lot to think about, but using that option doesn't inherently break a bunch of other things. ! pytest -v
=============================================================== test session starts ================================================================
platform darwin -- Python 3.8.3, pytest-5.3.5, py-1.10.0, pluggy-0.13.1 -- /Users/baileythegreen/Software/miniconda3/bin/python
cachedir: .pytest_cache
rootdir: /Users/baileythegreen/Software/pyani, inifile: pytest.ini
plugins: dash-1.14.0, cov-2.11.1, ordering-0.6
collected 100 items
tests/test_anib.py::test_get_version_no_exe PASSED [ 1%]
tests/test_anib.py::test_get_version_exe_not_executable PASSED [ 2%]
tests/test_anib.py::test_get_version_exe_no_version PASSED [ 3%]
tests/test_anib.py::test_blastall_dbjobdict PASSED [ 4%]
tests/test_anib.py::test_blastall_graph PASSED [ 5%]
tests/test_anib.py::test_blastall_multiple PASSED [ 6%]
tests/test_anib.py::test_blastall_single PASSED [ 7%]
tests/test_anib.py::test_blastn_dbjobdict PASSED [ 8%]
tests/test_anib.py::test_blastn_graph PASSED [ 9%]
tests/test_anib.py::test_blastn_multiple PASSED [ 10%]
tests/test_anib.py::test_blastn_single PASSED [ 11%]
tests/test_anib.py::test_formatdb_multiple PASSED [ 12%]
tests/test_anib.py::test_formatdb_single PASSED [ 13%]
tests/test_anib.py::test_fragment_files PASSED [ 14%]
tests/test_anib.py::test_makeblastdb_multiple PASSED [ 15%]
tests/test_anib.py::test_makeblastdb_single PASSED [ 16%]
tests/test_anib.py::test_parse_legacy_blastdir PASSED [ 17%]
tests/test_anib.py::test_parse_blastdir PASSED [ 18%]
tests/test_anib.py::test_parse_blasttab PASSED [ 19%]
tests/test_anib.py::test_parse_legacy_blasttab PASSED [ 20%]
tests/test_aniblastall.py::test_get_version_missing_exe PASSED [ 21%]
tests/test_aniblastall.py::test_get_version_not_executable PASSED [ 22%]
tests/test_aniblastall.py::test_get_version_no_version PASSED [ 23%]
tests/test_aniblastall.py::test_get_version_os_incompatible PASSED [ 24%]
tests/test_anim.py::test_get_version_no_exe PASSED [ 25%]
tests/test_anim.py::test_get_version_exe_not_executable PASSED [ 26%]
tests/test_anim.py::test_get_version_exe_no_version PASSED [ 27%]
tests/test_anim.py::test_deltadir_parsing PASSED [ 28%]
tests/test_anim.py::test_deltafile_parsing PASSED [ 29%]
tests/test_anim.py::test_maxmatch_single PASSED [ 30%]
tests/test_anim.py::test_mummer_multiple PASSED [ 31%]
tests/test_anim.py::test_mummer_single PASSED [ 32%]
tests/test_anim.py::test_mummer_job_generation PASSED [ 33%]
tests/test_cli_parsing.py::test_createdb PASSED [ 34%]
tests/test_cli_parsing.py::test_download_single_genome PASSED [ 35%]
tests/test_concordance.py::test_anim_concordance FAILED [ 36%]
tests/test_concordance.py::test_anib_concordance PASSED [ 37%]
tests/test_concordance.py::test_aniblastall_concordance PASSED [ 38%]
tests/test_concordance.py::test_tetra_concordance PASSED [ 39%]
tests/test_dependencies.py::test_import_biopython PASSED [ 40%]
tests/test_dependencies.py::test_import_matplotlib PASSED [ 41%]
tests/test_dependencies.py::test_import_numpy PASSED [ 42%]
tests/test_dependencies.py::test_import_pandas PASSED [ 43%]
tests/test_dependencies.py::test_import_scipy PASSED [ 44%]
tests/test_dependencies.py::test_blastn_available PASSED [ 45%]
tests/test_dependencies.py::test_run_blastall XPASS [ 46%]
tests/test_dependencies.py::test_run_nucmer PASSED [ 47%]
tests/test_graphics.py::test_png_mpl PASSED [ 48%]
tests/test_graphics.py::test_svg_mpl PASSED [ 49%]
tests/test_graphics.py::test_pdf_mpl PASSED [ 50%]
tests/test_graphics.py::test_png_seaborn PASSED [ 51%]
tests/test_graphics.py::test_svg_seaborn PASSED [ 52%]
tests/test_graphics.py::test_pdf_seaborn PASSED [ 53%]
tests/test_jobs.py::test_create_job PASSED [ 54%]
tests/test_jobs.py::test_create_job_with_command PASSED [ 55%]
tests/test_jobs.py::test_add_dependency PASSED [ 56%]
tests/test_jobs.py::test_remove_dependency PASSED [ 57%]
tests/test_jobs.py::test_create_jobgroup PASSED [ 58%]
tests/test_jobs.py::test_1d_jobgroup PASSED [ 59%]
tests/test_jobs.py::test_2d_jobgroup PASSED [ 60%]
tests/test_jobs.py::test_add_group_dependency PASSED [ 61%]
tests/test_jobs.py::test_remove_group_dependency PASSED [ 62%]
tests/test_legacy_scripts.py::test_legacy_anim_sns PASSED [ 63%]
tests/test_legacy_scripts.py::test_legacy_anim_mpl PASSED [ 64%]
tests/test_legacy_scripts.py::test_legacy_anib_sns PASSED [ 65%]
tests/test_legacy_scripts.py::test_legacy_anib_mpl PASSED [ 66%]
tests/test_legacy_scripts.py::test_legacy_tetra_sns PASSED [ 67%]
tests/test_legacy_scripts.py::test_legacy_tetra_mpl PASSED [ 68%]
tests/test_legacy_scripts.py::test_legacy_genome_downloads PASSED [ 69%]
tests/test_multiprocessing.py::test_multiprocessing_run PASSED [ 70%]
tests/test_multiprocessing.py::test_cmdsets PASSED [ 71%]
tests/test_multiprocessing.py::test_dependency_graph_run PASSED [ 72%]
tests/test_parsing.py::test_anim_delta PASSED [ 73%]
tests/test_subcmd_01_download.py::test_download_dry_run PASSED [ 74%]
tests/test_subcmd_01_download.py::test_download_c_blochmannia PASSED [ 75%]
tests/test_subcmd_01_download.py::test_download_kraken PASSED [ 76%]
tests/test_subcmd_02_index.py::TestIndexSubcommand::test_index PASSED [ 77%]
tests/test_subcmd_02_index.py::TestIndexSubcommand::test_missing_index PASSED [ 78%]
tests/test_subcmd_03_createdb.py::TestCreatedbSubcommand::test_createdb PASSED [ 79%]
tests/test_subcmd_04_anim.py::TestANImSubcommand::test_anim PASSED [ 80%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_genomes PASSED [ 81%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_genomes_runs PASSED [ 82%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_matrices PASSED [ 83%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_results PASSED [ 84%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_runs PASSED [ 85%]
tests/test_subcmd_05_report.py::TestReportSubcommand::test_runs_genomes PASSED [ 86%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_jpg PASSED [ 87%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_pdf PASSED [ 88%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_png PASSED [ 89%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_mpl_svg PASSED [ 90%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_jpg PASSED [ 91%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_pdf PASSED [ 92%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_png PASSED [ 93%]
tests/test_subcmd_06_plot.py::TestPlotSubcommand::test_plot_seaborn_svg PASSED [ 94%]
tests/test_subcmd_07_classify.py::TestClassifySubcommand::test_classify_defaults PASSED [ 95%]
tests/test_subcmd_07_classify.py::TestClassifySubcommand::test_classify_no_thresh PASSED [ 96%]
tests/test_subcmd_08_anib.py::TestANIbsubcommand::test_anib XFAIL [ 97%]
tests/test_tetra.py::test_tetraclean PASSED [ 98%]
tests/test_tetra.py::test_zscore PASSED [ 99%]
tests/test_tetra.py::test_correlations PASSED [100%]
===================================================================== FAILURES =====================================================================
______________________________________________________________ test_anim_concordance _______________________________________________________________
paths_concordance_fna = [PosixPath('/Users/baileythegreen/Software/pyani/tests/fixtures/concordance/GCF_002243555.1_ASM224355v1_genomic.fna'),...'), PosixPath('/Users/baileythegreen/Software/pyani/tests/fixtures/concordance/GCF_000011325.1_ASM1132v1_genomic.fna')]
path_concordance_jspecies = PosixPath('/Users/baileythegreen/Software/pyani/tests/fixtures/concordance/jspecies_output.tab'), tolerance_anim = 0.1
tmp_path = PosixPath('/private/var/folders/hg/wysfx1957s59pq2fbyss21lm0000gn/T/pytest-of-baileythegreen/pytest-86/test_anim_concordance0')
@pytest.mark.skip_if_exe_missing("nucmer")
def test_anim_concordance(
paths_concordance_fna, path_concordance_jspecies, tolerance_anim, tmp_path
):
"""Check ANIm results are concordant with JSpecies."""
# Perform ANIm on the input directory contents
# We have to separate nucmer/delta-filter command generation
# because Travis-CI doesn't play nicely with changes we made
# for local SGE/OGE integration.
# This might be avoidable with a scheduler flag passed to
# jobgroup generation in the anim.py module. That's a TODO.
ncmds, fcmds = anim.generate_nucmer_commands(paths_concordance_fna, tmp_path)
(tmp_path / "nucmer_output").mkdir(exist_ok=True, parents=True)
run_mp.multiprocessing_run(ncmds)
# delta-filter commands need to be treated with care for
# Travis-CI. Our cluster won't take redirection or semicolon
# separation in individual commands, but the wrapper we wrote
# for this (delta_filter_wrapper.py) can't be called under
# Travis-CI. So we must deconstruct the commands below
dfcmds = [
" > ".join([" ".join(fcmd.split()[1:-1]), fcmd.split()[-1]]) for fcmd in fcmds
]
run_mp.multiprocessing_run(dfcmds)
orglengths = pyani_files.get_sequence_lengths(paths_concordance_fna)
results = anim.process_deltadir(tmp_path / "nucmer_output", orglengths)
result_pid = results.percentage_identity
result_pid.to_csv(tmp_path / "pyani_anim.tab", sep="\t")
# Compare JSpecies output to results
result_pid = (result_pid.sort_index(axis=0).sort_index(axis=1) * 100.0).values
tgt_pid = parse_jspecies(path_concordance_jspecies)["ANIm"].values
> assert result_pid - tgt_pid == pytest.approx(0, abs=tolerance_anim)
E assert array([[0.0, ... dtype=object) == 0 ± 1.0e-01
E -array([[0.0, 5.585841092489133, 0.4892132128268969],\n
E - [5.605841092489129, 0.0, 5.644002047082907],\n
E - [0.4892132128268969, 5.624002047082911, 0.0]], dtype=object)
E +0 ± 1.0e-01
tests/test_concordance.py:203: AssertionError
---------------------------------------------------------------- Captured log call -----------------------------------------------------------------
DEBUG pyani.anim:anim.py:249 GCF_000011325.1_ASM1132v1_genomic_vs_GCF_000227605.2_ASM22760v2_genomic
DEBUG pyani.anim:anim.py:249 GCF_000011325.1_ASM1132v1_genomic_vs_GCF_002243555.1_ASM224355v1_genomic
DEBUG pyani.anim:anim.py:249 GCF_000227605.2_ASM22760v2_genomic_vs_GCF_002243555.1_ASM224355v1_genomic
INFO pyani.anim:anim.py:368 /private/var/folders/hg/wysfx1957s59pq2fbyss21lm0000gn/T/pytest-of-baileythegreen/pytest-86/test_anim_concordance0/nucmer_output has 3 files to load
================================================================= warnings summary =================================================================
tests/test_anib.py:54
/Users/baileythegreen/Software/pyani/tests/test_anib.py:54: FutureWarning: pandas.util.testing is deprecated. Use the functions in the public API at pandas.testing instead.
from pandas.util.testing import assert_frame_equal
tests/test_legacy_scripts.py::test_legacy_anim_sns
tests/test_legacy_scripts.py::test_legacy_anim_sns
/Users/baileythegreen/Software/miniconda3/lib/python3.8/site-packages/seaborn/matrix.py:619: ClusterWarning: scipy.cluster: The symmetric non-negative hollow observation matrix looks suspiciously like an uncondensed distance matrix
linkage = hierarchy.linkage(self.array, method=self.method,
-- Docs: https://docs.pytest.org/en/latest/warnings.html
==================================== 1 failed, 97 passed, 1 xfailed, 1 xpassed, 3 warnings in 518.67s (0:08:38) ==================================== |
🎉🎉🎉🎉🎉🎉🎉🎉 That looks like (mostly) good news! |
Yeah, the concordance test is the only one we'll have to worry about. Outputs of the concordance test assert result_pid - tgt_pid == pytest.approx(0, abs=tolerance_anim) on my two branches: # noextend_342, using `--noextend`
# this fails
Result {result_pid - tgt_pid}:
[[0.0 5.585841092489133 0.4892132128268969]
[5.605841092489129 0.0 5.644002047082907]
[0.4892132128268969 5.624002047082911 0.0]]
Expected {pytest.approx(0, abs=tolerance_anim)}:
0 ± 1.0e-01
# issue_342, using `--extend`
# this passes
Result {result_pid - tgt_pid}:
[[ 0.0 0.07518815694456293 0.06984331581938363]
[0.09518815694455895 0.0 0.08911322006224509]
[0.06984331581938363 0.06911322006224907 0.0]]
Expected {pytest.approx(0, abs=tolerance_anim)}:
0 ± 1.0e-01 |
I am currently annoyed that I had to actually break the (working) test in order to get |
I've pushed both branches, so you can look at them. They follow different philosophies on CLI and negative variable naming, but you shouldn't need to know about any of that to look at the concordance. |
@widdowquinn, I wonder if you ever had a chance to look over these two branches or decide what we want to do here? I don't know if subsequent findings related to Issue #340 changed our mind on anything here. I had forgotten about the mention of |
I have been trying to rebase the two branches relevant to this issue— I am having trouble with the rebasing part. In addition to the tests/test_legacy_scripts.py::test_legacy_anim_sns FAILED
tests/test_legacy_scripts.py::test_legacy_anim_mpl FAILED and I am having trouble figuring out why. It looks like no files exist in the I may not be able to finish this before I go on holiday, but I will dig a bit more today. |
Both The last significant bit of this discussion can be found in these two comments: The question has also been raised as to whether this issue (and these branches) are relevant anymore, given discussion in #340, and the extent of the issues with current calculation of ANI and coverage from mummer results. |
Summary:
Make
--noextend
the default NUCmer behaviour for v0.3, and implement an--extend
option forpyani anim
that allows us to usepyani
compare to see what the damage is likely to have been under the assumption above.Description:
Issue #340 pointed out that there can be overlapping alignments under the current NUCmer job submission, which is not ideal.
The text was updated successfully, but these errors were encountered: