diff --git a/.zenodo.json b/.zenodo.json index cade750..45c6f9a 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -2,7 +2,7 @@ "description": "

The pipeline

\n\n

bacannot, is a customisable, easy to use, pipeline that uses state-of-the-art software for comprehensively annotating prokaryotic genomes having only Docker and Nextflow as dependencies. It is able to annotate and detect virulence and resistance genes, plasmids, secondary metabolites, genomic islands, prophages, ICEs, KO, and more, while providing nice an beautiful interactive documents for results exploration.

", "license": "other-open", "title": "fmalmeida/bacannot: A generic but comprehensive bacterial annotation pipeline", - "version": "v3.3.3", + "version": "v3.4.0", "upload_type": "software", "creators": [ { diff --git a/README.md b/README.md index 86868a3..3360952 100644 --- a/README.md +++ b/README.md @@ -37,7 +37,7 @@ Its main steps are: | Analysis steps | Used software or databases | | :------------- | :------------------------- | | Genome assembly (if raw reads are given) | [Flye](https://github.com/fenderglass/Flye) and [Unicycler](https://github.com/rrwick/Unicycler) | -| Identification of closest 10 NCBI Refseq genomes | [RefSeq Masher](https://github.com/phac-nml/refseq_masher) | +| Identification of closest 10 NCBI Refseq genomes and comparison of genomes | [RefSeq Masher](https://github.com/phac-nml/refseq_masher) and [Sourmash](https://sourmash.readthedocs.io/en/latest/) | | Generic annotation and gene prediction | [Prokka](https://github.com/tseemann/prokka) or [Bakta](https://github.com/oschwengers/bakta) | | rRNA prediction | [barrnap](https://github.com/tseemann/barrnap) | | Classification within multi-locus sequence types (STs) | [mlst](https://github.com/tseemann/mlst) | diff --git a/conf/defaults.config b/conf/defaults.config index 4bce1ca..e8c5f69 100644 --- a/conf/defaults.config +++ b/conf/defaults.config @@ -122,6 +122,9 @@ params { // (NOT RUN?) antiSMASH (secondary metabolite) annotation skip_antismash = false +// (NOT RUN?) sourmash + skip_sourmash = false + // (NOT RUN?) integron finder tool skip_integron_finder = false @@ -178,6 +181,17 @@ params { // User's custom database coverage threshold blast_custom_mincov = 65 + /* + * Sourmash configuration + */ +// kmer size (21, 31 or 51) + sourmash_kmer = 31 + +// scale, e.g. a scale 1000 on a 5Mb genome will generate 5000 hashes +// 1000 is generally recommended by the tool's developers + sourmash_scale = 1000 + + /* * Resources allocation configuration * Defaults only, expecting to be overwritten diff --git a/conf/docker.config b/conf/docker.config index fe8600f..7de1e86 100644 --- a/conf/docker.config +++ b/conf/docker.config @@ -19,12 +19,12 @@ process { // Custom pipeline's containers with various tools for general purposes // withLabel: 'db_download|db_tools|misc' { - container = 'fmalmeida/bacannot@sha256:bdb31637cacf99736656ab3b69f1f01ba1b5eb026771d5c266b4c84e96153057' + container = 'fmalmeida/bacannot@sha256:5c6f105157d30fe9a6ca1ad41fe884e75a29e6bd23ddb2e4fc06dd3d05854cd2' } // container for R tools withLabel: 'renv' { - container = 'fmalmeida/bacannot@sha256:952f58a2c03e50f8a376073346fb1ccda28d6249e3fdfea07a3286a6ff1adf0c' + container = 'fmalmeida/bacannot@sha256:23a0713d3694a10ee4c570a4e65a471045781a73711495aa08ae7d40f9b65097' } // container for bacannot server @@ -113,5 +113,9 @@ process { container = "quay.io/biocontainers/rgi:5.2.1--pyhdfd78af_1" } + withName: 'SOURMASH_LCA|SOURMASH_ALL' { + container = "quay.io/biocontainers/sourmash:4.8.2--hdfd78af_0" + } + } diff --git a/conf/singularity.config b/conf/singularity.config index e57ebea..f05eb5d 100644 --- a/conf/singularity.config +++ b/conf/singularity.config @@ -22,12 +22,12 @@ process { // Custom pipeline's containers with various tools for general purposes // withLabel: 'db_download|db_tools|misc' { - container = 'docker://fmalmeida/bacannot@sha256:bdb31637cacf99736656ab3b69f1f01ba1b5eb026771d5c266b4c84e96153057' + container = 'docker://fmalmeida/bacannot@sha256:5c6f105157d30fe9a6ca1ad41fe884e75a29e6bd23ddb2e4fc06dd3d05854cd2' } // container for R tools withLabel: 'renv' { - container = 'docker://fmalmeida/bacannot@sha256:952f58a2c03e50f8a376073346fb1ccda28d6249e3fdfea07a3286a6ff1adf0c' + container = 'docker://fmalmeida/bacannot@sha256:23a0713d3694a10ee4c570a4e65a471045781a73711495aa08ae7d40f9b65097' } // container for bacannot server @@ -117,5 +117,9 @@ process { container = "https://depot.galaxyproject.org/singularity/rgi:5.2.1--pyhdfd78af_1" } + withName: 'SOURMASH_LCA|SOURMASH_ALL' { + container = "https://depot.galaxyproject.org/singularity/sourmash:4.8.2--hdfd78af_0" + } + } diff --git a/docker/misc/Dockerfile b/docker/misc/Dockerfile index 2d6f10f..35e1a97 100644 --- a/docker/misc/Dockerfile +++ b/docker/misc/Dockerfile @@ -93,5 +93,8 @@ RUN python3 -m pip install cryptography==38.0.4 'biopython==1.83' 'matplotlib==3 # install get zenodo RUN pip3 install zenodo_get +# install unzip +RUN apt-get install -y unzip + # fix permissions RUN chmod 777 -R /work diff --git a/docker/renv/build.sh b/docker/renv/build.sh index a7bc212..51153a5 100644 --- a/docker/renv/build.sh +++ b/docker/renv/build.sh @@ -1,2 +1 @@ -source ../set_version.sh -../../bin/build_image.sh $NEW_VERSION +../../bin/build_image.sh $1 diff --git a/docker/renv/reports/report_general.Rmd b/docker/renv/reports/report_general.Rmd index 0651624..54222a7 100644 --- a/docker/renv/reports/report_general.Rmd +++ b/docker/renv/reports/report_general.Rmd @@ -9,6 +9,7 @@ params: barrnap: mlst: refseq_masher: + sourmash_png: query: output: bookdown::html_document2: @@ -58,6 +59,13 @@ if (file.exists(params$kegg)) { kegg_not_null <- FALSE } +if (file.exists(params$sourmash_png)) { + sourmash_not_null <- TRUE + sourmash_png <- params$sourmash_png +} else { + sourmash_not_null <- FALSE +} + if (params$generic_annotator == "prokka") { annotator_url <- "https://github.com/tseemann/prokka" prokka_not_null <- TRUE @@ -166,3 +174,6 @@ datatable(barrnap_gff, ```{r kegg_svg, echo=FALSE, results='asis', eval=kegg_not_null, child='yes_kegg.Rmd'} ``` + +```{r sourmash_svg, echo=FALSE, results='asis', eval=sourmash_not_null, child='yes_sourmash.Rmd'} +``` diff --git a/docker/renv/reports/yes_sourmash.Rmd b/docker/renv/reports/yes_sourmash.Rmd new file mode 100644 index 0000000..d75e11a --- /dev/null +++ b/docker/renv/reports/yes_sourmash.Rmd @@ -0,0 +1,13 @@ +## Sourmash + +[Sourmash](https://sourmash.readthedocs.io/en/latest/) is a command-line tool and Python/Rust library for metagenome analysis and genome comparison using k-mers. It supports the compositional analysis of metagenomes, rapid search of large sequence databases, and flexible taxonomic profiling with both NCBI and GTDB taxonomies. Sourmash works well with sequences 30kb or larger, including bacterial and viral genomes. + +In Bacannot, the sourmash tool was used for performing genome comparison and dendogram plot with all the genomes given as input, plus, all the 10 first genomes identified as closest to each genome based on refseq_masher results. + +> Duplicate genomes were removed (same genome is closest to multiple inputs). +> +> The sourmash genome comparison results, and the compositional data of each sample is given as output, so that users can further utilize them to make customised sourmash plots as described in their documentation. + +```{r, out.width='100%', fig.cap='Sourmash genome comparison', fig.align='center'} +include_graphics(params$sourmash_png) +``` \ No newline at end of file diff --git a/docs/defaults.config b/docs/defaults.config index 0d43fe4..e8c5f69 100644 --- a/docs/defaults.config +++ b/docs/defaults.config @@ -122,6 +122,15 @@ params { // (NOT RUN?) antiSMASH (secondary metabolite) annotation skip_antismash = false +// (NOT RUN?) sourmash + skip_sourmash = false + +// (NOT RUN?) integron finder tool + skip_integron_finder = false + +// (NOT RUN?) CIRCOS tool + skip_circos = false + /* * Custom databases can be used to annotate additional genes in the genome. * It runs a BLAST alignment against the genome, therefore, the custom database @@ -172,6 +181,17 @@ params { // User's custom database coverage threshold blast_custom_mincov = 65 + /* + * Sourmash configuration + */ +// kmer size (21, 31 or 51) + sourmash_kmer = 31 + +// scale, e.g. a scale 1000 on a 5Mb genome will generate 5000 hashes +// 1000 is generally recommended by the tool's developers + sourmash_scale = 1000 + + /* * Resources allocation configuration * Defaults only, expecting to be overwritten diff --git a/docs/index.md b/docs/index.md index 4cb28ba..3d1b969 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,7 +23,7 @@ The pipeline's main steps are: | Analysis steps | Used software or databases | | :------------- | :------------------------- | | Genome assembly (if raw reads are given) | [Flye](https://github.com/fenderglass/Flye) and [Unicycler](https://github.com/rrwick/Unicycler) | -| Identification of closest 10 NCBI Refseq genomes | [RefSeq Masher](https://github.com/phac-nml/refseq_masher) | +| Identification of closest 10 NCBI Refseq genomes and comparison of genomes | [RefSeq Masher](https://github.com/phac-nml/refseq_masher) and [Sourmash](https://sourmash.readthedocs.io/en/latest/) | | Generic annotation and gene prediction | [Prokka](https://github.com/tseemann/prokka) or [Bakta](https://github.com/oschwengers/bakta) | | rRNA prediction | [barrnap](https://github.com/tseemann/barrnap) | | Classification within multi-locus sequence types (STs) | [mlst](https://github.com/tseemann/mlst) | diff --git a/docs/manual.md b/docs/manual.md index 1a2b1df..fdc8095 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -85,6 +85,15 @@ The use of this parameter sets a default value for input samples. If a sample ha | :--------------------------------------- | :------- | :------ | :---------- | | `--resfinder_species` | :material-close: | NA | Resfinder species panel. It activates the resfinder annotation process using the given species panel. Check the available species at [their main page](https://cge.cbs.dtu.dk/services/ResFinder/) and in [their repository page](https://bitbucket.org/genomicepidemiology/resfinder/src/master/#usage). If your species is not available in Resfinder panels, you may use it with the "Other" panel (`--resfinder_species "Other"`). | +## Sourmash comparison + +The parameteers below, configure how [sourmash](https://sourmash.readthedocs.io/en/latest/) is executed in the pipeline. They are relatively simple, and have sensible defaults. + +|
Parameter
| Required | Default | Description | +| :--------------------------------------- | :------- | :------ | :---------- | +| `--sourmash_kmer` | :material-close: | 31 | Kmer size for sourmash genome comparison | +| `--sourmash_scale` | :material-close: | 1000 | Scale for for sourmash genome comparison. A scale 1000 on a 5Mb genome will generate 5000 hashes. 1000 is generally recommended by the tool's developers | + ## On/Off processes |
Parameter
| Required | Default | Description | @@ -96,6 +105,7 @@ The use of this parameter sets a default value for input samples. If a sample ha | `--skip_prophage_search` | :material-close: | false | Tells whether not to run prophage annotation modules | | `--skip_kofamscan` | :material-close: | false | Tells whether not to run KEGG orthology (KO) annotation with KofamScan | | `--skip_antismash` | :material-close: | false | Tells whether or not to run antiSMASH (secondary metabolite) annotation. AntiSMASH is executed using only its core annotation modules in order to keep it fast. | +| `--skip_sourmash` | :material-close: | false | Tells whether or not to run sourmash to compare input genomes and closest reference genomes | | `--skip_circos` | :material-close: | false | Tells whether or not to run the final `CIRCOS` module. When the input genome has many contigs, its results are not meaningful. | | `--skip_integron_finder` | :material-close: | false | Tells whether or not to run the integron finder tool. | diff --git a/docs/outputs.md b/docs/outputs.md index ba35080..0903774 100644 --- a/docs/outputs.md +++ b/docs/outputs.md @@ -15,6 +15,7 @@ After a successful execution, you will have something like this: # Directory tree from the running dir . ├── _ANNOTATION +│   └── sourmash_all # Sourmash results of genome comparison of all input genomes and all identified references | └── ecoli_ref.fna │   └── ecoli │   ├── assembly # Assembly files (when raw reads are given) @@ -38,6 +39,7 @@ After a successful execution, you will have something like this: |   ├── resistance # AMR annotation results from ARGminer, AMRFinderPlus, RGI and Resfinder |   ├── rRNA # barrnap annotation results |   ├── SequenceServerDBs # SequenceServer pre-formatted databases to be used with SequenceServer blast application +|   ├── sourmash # Sourmash summary and signature file for the specific sample |   ├── SQLdb # The SQLdb of the annotation used by the shiny server for rapid parsing |   ├── tools_versioning # Versions of tools and databases used (whenever available) |   ├── virulence # Virulence genes annotation results from Victors and VFDB databases diff --git a/docs/quickstart.md b/docs/quickstart.md index 42b5ee8..b3f1f61 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -37,7 +37,7 @@ Bacannot databases are not inside the docker images anymore to avoid huge images #### Pre-formatted -Users can directly download pre-formatted databases from Zenodo: https://doi.org/10.5281/zenodo.7615811 +Users can directly download pre-formatted databases from Zenodo: Useful for standardization and also overcoming known issues that may arise when formatting databases with `singularity` profile. diff --git a/docs/reports/report_MGEs.html b/docs/reports/report_MGEs.html index 9f6e4ed..cec170b 100644 --- a/docs/reports/report_MGEs.html +++ b/docs/reports/report_MGEs.html @@ -11,7 +11,7 @@ - + Annotation of mobile genetic elements @@ -241,7 +241,7 @@ $(this).detach().appendTo(div); // add a show code button right above - var showCodeText = $('' + (showThis ? 'Hide' : 'Code') + ''); + var showCodeText = $('' + (showThis ? 'Hide' : 'Show') + ''); var showCodeButton = $(''); showCodeButton.append(showCodeText); showCodeButton @@ -267,7 +267,7 @@ // * Change text // * add a class for intermediate states styling div.on('hide.bs.collapse', function () { - showCodeText.text('Code'); + showCodeText.text('Show'); showCodeButton.addClass('btn-collapsing'); }); div.on('hidden.bs.collapse', function () { @@ -1575,6 +1575,26 @@ PagedTableDoc.initAll(); }; + - - + - + - + * HTML5 export buttons for Buttons and DataTables. + * © SpryMedia Ltd - datatables.net/license + * + * FileSaver.js (1.3.3) - MIT license + * Copyright © 2016 Eli Grey - http://eligrey.com + */ +!function(n){var r,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net")(t,e),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e)},"undefined"==typeof window?module.exports=function(t,e,o,l){return t=t||window,e=e||r(t),a(t,e),n(e,t,t.document)}:(a(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)}(function(C,T,y,t,e,k){"use strict";var o,l,n=C.fn.dataTable;function S(){return o||T.JSZip}function s(){return l||T.pdfMake}n.Buttons.pdfMake=function(t){if(!t)return s();l=t},n.Buttons.jszip=function(t){if(!t)return S();o=t};function N(t){var e="Sheet1";return e=t.sheetName?t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,""):e}function u(t,e){for(var o=c(e),l=t.buttons.exportData(e.exportOptions),n=e.fieldBoundary,r=e.fieldSeparator,a=new RegExp(n,"g"),d=e.escapeChar!==k?e.escapeChar:"\\",p=function(t){for(var e="",o=0,l=t.length;o',"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'',"xl/workbook.xml":'',"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''},R=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},{match:/^\-?[\d,]+\.\d{2}$/,style:64},{match:/^[\d]{4}\-[01][\d]\-[0123][\d]$/,style:67,fmt:function(t){return Math.round(25569+Date.parse(t)/864e5)}}];return n.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,o,l){this.processing(!0);var n=this,r=u(e,l),a=e.buttons.exportInfo(l),d=c(l),p=r.str,i=C("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0}),d=(a.title&&(p=a.title+d+d+p),a.messageTop&&(p=a.messageTop+d+d+p),a.messageBottom&&(p=p+d+d+a.messageBottom),l.customize&&(p=l.customize(p,l,e)),C("'); + } else if (inArray(index, dateCols)) { + $input = $(''); } else { $input = $(''); } @@ -3343,7 +3386,7 @@ if (immediate) $input.on('blur', function(e) { var valueNew = $input.val(); - if (valueNew != value) { + if (valueNew !== value) { _cell.data(valueNew); if (HTMLWidgets.shinyMode) { changeInput('cell_edit', [cellInfo(cell)], 'DT.cellInfo', null, {priority: 'event'}); @@ -3503,6 +3546,9 @@ updateColsSelected(); updateCellsSelected(); }) + updateRowsSelected(); + updateColsSelected(); + updateCellsSelected(); } var selMode = data.selection.mode, selTarget = data.selection.target; @@ -3861,7 +3907,7 @@ changeInput('cell_clicked', {}); // do not trigger table selection when clicking on links unless they have classes - table.on('click.dt', 'tbody td a', function(e) { + table.on('mousedown.dt', 'tbody td a', function(e) { if (this.className === '') e.stopPropagation(); }); @@ -3889,8 +3935,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -4005,7 +4052,7 @@ })(); - - + - + - + * HTML5 export buttons for Buttons and DataTables. + * © SpryMedia Ltd - datatables.net/license + * + * FileSaver.js (1.3.3) - MIT license + * Copyright © 2016 Eli Grey - http://eligrey.com + */ +!function(n){var r,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net")(t,e),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e)},"undefined"==typeof window?module.exports=function(t,e,o,l){return t=t||window,e=e||r(t),a(t,e),n(e,t,t.document)}:(a(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)}(function(C,T,y,t,e,k){"use strict";var o,l,n=C.fn.dataTable;function S(){return o||T.JSZip}function s(){return l||T.pdfMake}n.Buttons.pdfMake=function(t){if(!t)return s();l=t},n.Buttons.jszip=function(t){if(!t)return S();o=t};function N(t){var e="Sheet1";return e=t.sheetName?t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,""):e}function u(t,e){for(var o=c(e),l=t.buttons.exportData(e.exportOptions),n=e.fieldBoundary,r=e.fieldSeparator,a=new RegExp(n,"g"),d=e.escapeChar!==k?e.escapeChar:"\\",p=function(t){for(var e="",o=0,l=t.length;o',"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'',"xl/workbook.xml":'',"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''},R=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},{match:/^\-?[\d,]+\.\d{2}$/,style:64},{match:/^[\d]{4}\-[01][\d]\-[0123][\d]$/,style:67,fmt:function(t){return Math.round(25569+Date.parse(t)/864e5)}}];return n.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,o,l){this.processing(!0);var n=this,r=u(e,l),a=e.buttons.exportInfo(l),d=c(l),p=r.str,i=C("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0}),d=(a.title&&(p=a.title+d+d+p),a.messageTop&&(p=a.messageTop+d+d+p),a.messageBottom&&(p=p+d+d+a.messageBottom),l.customize&&(p=l.customize(p,l,e)),C("'); + } else if (inArray(index, dateCols)) { + $input = $(''); } else { $input = $(''); } @@ -3343,7 +3386,7 @@ if (immediate) $input.on('blur', function(e) { var valueNew = $input.val(); - if (valueNew != value) { + if (valueNew !== value) { _cell.data(valueNew); if (HTMLWidgets.shinyMode) { changeInput('cell_edit', [cellInfo(cell)], 'DT.cellInfo', null, {priority: 'event'}); @@ -3503,6 +3546,9 @@ updateColsSelected(); updateCellsSelected(); }) + updateRowsSelected(); + updateColsSelected(); + updateCellsSelected(); } var selMode = data.selection.mode, selTarget = data.selection.target; @@ -3861,7 +3907,7 @@ changeInput('cell_clicked', {}); // do not trigger table selection when clicking on links unless they have classes - table.on('click.dt', 'tbody td a', function(e) { + table.on('mousedown.dt', 'tbody td a', function(e) { if (this.className === '') e.stopPropagation(); }); @@ -3889,8 +3935,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -4005,7 +4052,7 @@ })(); - - + - + - + * HTML5 export buttons for Buttons and DataTables. + * © SpryMedia Ltd - datatables.net/license + * + * FileSaver.js (1.3.3) - MIT license + * Copyright © 2016 Eli Grey - http://eligrey.com + */ +!function(n){var r,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net")(t,e),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e)},"undefined"==typeof window?module.exports=function(t,e,o,l){return t=t||window,e=e||r(t),a(t,e),n(e,t,t.document)}:(a(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)}(function(C,T,y,t,e,k){"use strict";var o,l,n=C.fn.dataTable;function S(){return o||T.JSZip}function s(){return l||T.pdfMake}n.Buttons.pdfMake=function(t){if(!t)return s();l=t},n.Buttons.jszip=function(t){if(!t)return S();o=t};function N(t){var e="Sheet1";return e=t.sheetName?t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,""):e}function u(t,e){for(var o=c(e),l=t.buttons.exportData(e.exportOptions),n=e.fieldBoundary,r=e.fieldSeparator,a=new RegExp(n,"g"),d=e.escapeChar!==k?e.escapeChar:"\\",p=function(t){for(var e="",o=0,l=t.length;o',"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'',"xl/workbook.xml":'',"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''},R=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},{match:/^\-?[\d,]+\.\d{2}$/,style:64},{match:/^[\d]{4}\-[01][\d]\-[0123][\d]$/,style:67,fmt:function(t){return Math.round(25569+Date.parse(t)/864e5)}}];return n.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,o,l){this.processing(!0);var n=this,r=u(e,l),a=e.buttons.exportInfo(l),d=c(l),p=r.str,i=C("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0}),d=(a.title&&(p=a.title+d+d+p),a.messageTop&&(p=a.messageTop+d+d+p),a.messageBottom&&(p=p+d+d+a.messageBottom),l.customize&&(p=l.customize(p,l,e)),C("'); + } else if (inArray(index, dateCols)) { + $input = $(''); } else { $input = $(''); } @@ -3343,7 +3386,7 @@ if (immediate) $input.on('blur', function(e) { var valueNew = $input.val(); - if (valueNew != value) { + if (valueNew !== value) { _cell.data(valueNew); if (HTMLWidgets.shinyMode) { changeInput('cell_edit', [cellInfo(cell)], 'DT.cellInfo', null, {priority: 'event'}); @@ -3503,6 +3546,9 @@ updateColsSelected(); updateCellsSelected(); }) + updateRowsSelected(); + updateColsSelected(); + updateCellsSelected(); } var selMode = data.selection.mode, selTarget = data.selection.target; @@ -3861,7 +3907,7 @@ changeInput('cell_clicked', {}); // do not trigger table selection when clicking on links unless they have classes - table.on('click.dt', 'tbody td a', function(e) { + table.on('mousedown.dt', 'tbody td a', function(e) { if (this.className === '') e.stopPropagation(); }); @@ -3889,8 +3935,9 @@ console.log('The search keyword for column ' + i + ' is undefined') return; } - $(td).find('input').first().val(v); - searchColumn(i, v); + // Update column search string and values on linked filter widgets. + // 'input' for factor and char filters, 'change' for numeric filters. + $(td).find('input').first().val(v).trigger('input', [true]).trigger('change'); }); table.draw(); } @@ -4005,7 +4052,7 @@ })(); - - + - + - + * HTML5 export buttons for Buttons and DataTables. + * © SpryMedia Ltd - datatables.net/license + * + * FileSaver.js (1.3.3) - MIT license + * Copyright © 2016 Eli Grey - http://eligrey.com + */ +!function(n){var r,a;"function"==typeof define&&define.amd?define(["jquery","datatables.net","datatables.net-buttons"],function(t){return n(t,window,document)}):"object"==typeof exports?(r=require("jquery"),a=function(t,e){e.fn.dataTable||require("datatables.net")(t,e),e.fn.dataTable.Buttons||require("datatables.net-buttons")(t,e)},"undefined"==typeof window?module.exports=function(t,e,o,l){return t=t||window,e=e||r(t),a(t,e),n(e,t,t.document)}:(a(window,r),module.exports=n(r,window,window.document))):n(jQuery,window,document)}(function(C,T,y,t,e,k){"use strict";var o,l,n=C.fn.dataTable;function S(){return o||T.JSZip}function s(){return l||T.pdfMake}n.Buttons.pdfMake=function(t){if(!t)return s();l=t},n.Buttons.jszip=function(t){if(!t)return S();o=t};function N(t){var e="Sheet1";return e=t.sheetName?t.sheetName.replace(/[\[\]\*\/\\\?\:]/g,""):e}function u(t,e){for(var o=c(e),l=t.buttons.exportData(e.exportOptions),n=e.fieldBoundary,r=e.fieldSeparator,a=new RegExp(n,"g"),d=e.escapeChar!==k?e.escapeChar:"\\",p=function(t){for(var e="",o=0,l=t.length;o',"xl/_rels/workbook.xml.rels":'',"[Content_Types].xml":'',"xl/workbook.xml":'',"xl/worksheets/sheet1.xml":'',"xl/styles.xml":''},R=[{match:/^\-?\d+\.\d%$/,style:60,fmt:function(t){return t/100}},{match:/^\-?\d+\.?\d*%$/,style:56,fmt:function(t){return t/100}},{match:/^\-?\$[\d,]+.?\d*$/,style:57},{match:/^\-?£[\d,]+.?\d*$/,style:58},{match:/^\-?€[\d,]+.?\d*$/,style:59},{match:/^\-?\d+$/,style:65},{match:/^\-?\d+\.\d{2}$/,style:66},{match:/^\([\d,]+\)$/,style:61,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\([\d,]+\.\d{2}\)$/,style:62,fmt:function(t){return-1*t.replace(/[\(\)]/g,"")}},{match:/^\-?[\d,]+$/,style:63},{match:/^\-?[\d,]+\.\d{2}$/,style:64},{match:/^[\d]{4}\-[01][\d]\-[0123][\d]$/,style:67,fmt:function(t){return Math.round(25569+Date.parse(t)/864e5)}}];return n.ext.buttons.copyHtml5={className:"buttons-copy buttons-html5",text:function(t){return t.i18n("buttons.copy","Copy")},action:function(t,e,o,l){this.processing(!0);var n=this,r=u(e,l),a=e.buttons.exportInfo(l),d=c(l),p=r.str,i=C("
").css({height:1,width:1,overflow:"hidden",position:"fixed",top:0,left:0}),d=(a.title&&(p=a.title+d+d+p),a.messageTop&&(p=a.messageTop+d+d+p),a.messageBottom&&(p=p+d+d+a.messageBottom),l.customize&&(p=l.customize(p,l,e)),C("