diff --git a/.gitignore b/.gitignore index 6aff3029..135314d9 100644 --- a/.gitignore +++ b/.gitignore @@ -25,7 +25,6 @@ share/python-wheels/ *.egg-info/ .installed.cfg *.egg -MANIFEST # PyInstaller # Usually these files are written by a python script from a template @@ -133,3 +132,9 @@ dmypy.json # Mac OS .DS_Store + +# VS code settings +.vscode + +# Ignore notebooks +**/*.ipynb \ No newline at end of file diff --git a/ci/recipe/meta.yaml b/ci/recipe/meta.yaml index 50cc2936..0b6e2ec3 100644 --- a/ci/recipe/meta.yaml +++ b/ci/recipe/meta.yaml @@ -23,10 +23,13 @@ requirements: - samtools - qiime2 {{ qiime2_epoch }}.* - q2-types-genomics {{ qiime2_epoch }}.* + - q2templates {{ qiime2_epoch }}.* - eggnog-mapper >=2.1.10 - diamond - tqdm - xmltodict + - altair + - busco >=5.0.0 test: requires: diff --git a/q2_moshpit/__init__.py b/q2_moshpit/__init__.py index f2ba2c56..ee9d3e0d 100644 --- a/q2_moshpit/__init__.py +++ b/q2_moshpit/__init__.py @@ -10,6 +10,7 @@ from .kraken2 import bracken, classification, database from .metabat2 import metabat2 from . import eggnog +from . import busco from ._version import get_versions @@ -18,5 +19,5 @@ __all__ = [ 'metabat2', 'bracken', 'classification', 'database', - 'dereplicate_mags', 'eggnog' + 'dereplicate_mags', 'eggnog', 'busco', ] diff --git a/q2_moshpit/_utils.py b/q2_moshpit/_utils.py index 17ad646e..b927cff0 100644 --- a/q2_moshpit/_utils.py +++ b/q2_moshpit/_utils.py @@ -52,9 +52,15 @@ def _process_common_input_params(processing_func, params: dict) -> List[str]: """ processed_args = [] for arg_key, arg_val in params.items(): - # bool is a subclass of int so to only reject ints we need to do: - if type(arg_val) != int and not arg_val: # noqa: E721 - continue - else: + # This if condition excludes arguments which are falsy + # (False, None, "", []), except for integers and floats. + if ( # noqa: E721 + type(arg_val) == int or + type(arg_val) == float or + arg_val + ): processed_args.extend(processing_func(arg_key, arg_val)) + else: + continue + return processed_args diff --git a/q2_moshpit/assets/busco/css/styles.css b/q2_moshpit/assets/busco/css/styles.css new file mode 100644 index 00000000..433d6f7d --- /dev/null +++ b/q2_moshpit/assets/busco/css/styles.css @@ -0,0 +1,20 @@ +#plot { + margin-top: 50px; +} + +.vega-bind { + margin-bottom: 15px; +} + +.vega-bind-name { + margin-right: 10px; + white-space: nowrap +} + +.header-inline { + display: inline-block; + float: left; + margin-right: 10px; + margin-top: 8px; + margin-bottom: 8px; +} diff --git a/q2_moshpit/assets/busco/index.html b/q2_moshpit/assets/busco/index.html new file mode 100644 index 00000000..be2d478d --- /dev/null +++ b/q2_moshpit/assets/busco/index.html @@ -0,0 +1,138 @@ +{% extends "base.html" %} {% block head %} +
+ The left plot shows the results generated by BUSCO for all bins and + samples. "BUSCO attempts to provide a quantitative assessment + of the completeness in terms of the expected gene content of a genome + assembly, transcriptome, or annotated gene set. The results are + simplified into categories of Complete and single-copy, Complete and + duplicated, Fragmented, or Missing BUSCOs. BUSCO completeness results + make sense only in the context of the biology of your organism". Visit the + + BUSCO User Guide + for more information. +
++ Hoover over the graph to obtain information about the lineage dataset + used for each bin, and the number of genes in each BUSCO category. +
++ The right barplot shows assembly statistics calculated for each bin using BBTools. + Specifically, it displays the statistics computed by the stats.sh procedure from BBMap. + View the + + source code and documentation + + of stats.sh for more information. +
++ Choose the assembly statistic that you wish to display from the drop-down manu below the graphs. + Hoover over the graph to show the numerical values that each bar represents. +
+ +Unable to generate the completeness plot
+ {% endif %} +