diff --git a/NEWS.md b/NEWS.md index 5adf5f3..98a6c28 100644 --- a/NEWS.md +++ b/NEWS.md @@ -12,6 +12,10 @@ * new command `bowtie2` +* new command `bwa` + +* new command `bedtools` + # blit 0.2.0 ## New features diff --git a/_pkgdown.yml b/_pkgdown.yml index 2a55a25..39afd0d 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -2,3 +2,81 @@ url: https://wanglabcsu.github.io/blit/ template: bootstrap: 5 +reference: + - title: "R6 class" + desc: "Core R6 class for encapsulating command parameters and building command objects." + contents: + - Command + + - title: "Execute command" + desc: "Functions for executing commands, including foreground, background, and parallel execution." + contents: + - exec + - cmd_run + - cmd_help + - cmd_background + - cmd_parallel + + - title: "Environment context" + desc: "Set up the execution context, such as working directory, environment variables, and dependency management." + contents: + - cmd_wd + - cmd_envvar + - cmd_envpath + - cmd_condaenv + - conda + - appmamba + - install_appmamba + - uninstall_appmamba + - appmamba_rc + - cmd_conda + + - title: "Schedule expressions" + desc: "Define hooks to run before, after, or on success/failure of a command." + contents: + - cmd_on_start + - cmd_on_exit + - cmd_on_succeed + - cmd_on_fail + + - title: "Genomic tools" + desc: "Wrappers for common genomic data processing and analysis tools." + contents: + - allele_counter + - bcftools + - bedtools + - bowtie2 + - bwa + - samtools + - seqkit + - varscan + - snpEff + - gistic2 + + - title: "Transcriptomic tools" + desc: "Wrappers for transcriptome sequencing data processing and analysis tools." + contents: + - cellranger + - fastp + - fastq_pair + - fastq_read_pair + - kraken2 + - kraken_tools + - trust4 + - trust4_imgt_annot + - trust4_gene_names + - pyscenic + + - title: "Development" + desc: "Developer utilities for extending functionality and creating new command interfaces." + contents: + - make_command + - arg + - arg0 + + - title: "Scripting interfaces" + desc: "Interfaces to external scripting languages for seamless integration with existing scripts." + contents: + - python + - perl + diff --git a/docs/pkgdown.js b/docs/pkgdown.js index 6f0eee4..1a99c65 100644 --- a/docs/pkgdown.js +++ b/docs/pkgdown.js @@ -2,83 +2,43 @@ (function($) { $(function() { - $('.navbar-fixed-top').headroom(); + $('nav.navbar').headroom(); - $('body').css('padding-top', $('.navbar').height() + 10); - $(window).resize(function(){ - $('body').css('padding-top', $('.navbar').height() + 10); + Toc.init({ + $nav: $("#toc"), + $scope: $("main h2, main h3, main h4, main h5, main h6") }); - $('[data-toggle="tooltip"]').tooltip(); - - var cur_path = paths(location.pathname); - var links = $("#navbar ul li a"); - var max_length = -1; - var pos = -1; - for (var i = 0; i < links.length; i++) { - if (links[i].getAttribute("href") === "#") - continue; - // Ignore external links - if (links[i].host !== location.host) - continue; - - var nav_path = paths(links[i].pathname); - - var length = prefix_length(nav_path, cur_path); - if (length > max_length) { - max_length = length; - pos = i; - } - } - - // Add class to parent
  • , and enclosing
  • if in dropdown - if (pos >= 0) { - var menu_anchor = $(links[pos]); - menu_anchor.parent().addClass("active"); - menu_anchor.closest("li.dropdown").addClass("active"); - } - }); - - function paths(pathname) { - var pieces = pathname.split("/"); - pieces.shift(); // always starts with / - - var end = pieces[pieces.length - 1]; - if (end === "index.html" || end === "") - pieces.pop(); - return(pieces); - } - - // Returns -1 if not found - function prefix_length(needle, haystack) { - if (needle.length > haystack.length) - return(-1); - - // Special case for length-0 haystack, since for loop won't run - if (haystack.length === 0) { - return(needle.length === 0 ? 0 : -1); + if ($('#toc').length) { + $('body').scrollspy({ + target: '#toc', + offset: $("nav.navbar").outerHeight() + 1 + }); } - for (var i = 0; i < haystack.length; i++) { - if (needle[i] != haystack[i]) - return(i); - } + // Activate popovers + $('[data-bs-toggle="popover"]').popover({ + container: 'body', + html: true, + trigger: 'focus', + placement: "top", + sanitize: false, + }); - return(haystack.length); - } + $('[data-bs-toggle="tooltip"]').tooltip(); /* Clipboard --------------------------*/ function changeTooltipMessage(element, msg) { - var tooltipOriginalTitle=element.getAttribute('data-original-title'); - element.setAttribute('data-original-title', msg); + var tooltipOriginalTitle=element.getAttribute('data-bs-original-title'); + element.setAttribute('data-bs-original-title', msg); $(element).tooltip('show'); - element.setAttribute('data-original-title', tooltipOriginalTitle); + element.setAttribute('data-bs-original-title', tooltipOriginalTitle); } if(ClipboardJS.isSupported()) { $(document).ready(function() { - var copyButton = ""; + var copyButton = ""; $("div.sourceCode").addClass("hasCopyButton"); @@ -89,20 +49,114 @@ $('.btn-copy-ex').tooltip({container: 'body'}); // Initialize clipboard: - var clipboardBtnCopies = new ClipboardJS('[data-clipboard-copy]', { + var clipboard = new ClipboardJS('[data-clipboard-copy]', { text: function(trigger) { return trigger.parentNode.textContent.replace(/\n#>[^\n]*/g, ""); } }); - clipboardBtnCopies.on('success', function(e) { + clipboard.on('success', function(e) { changeTooltipMessage(e.trigger, 'Copied!'); e.clearSelection(); }); - clipboardBtnCopies.on('error', function() { + clipboard.on('error', function(e) { changeTooltipMessage(e.trigger,'Press Ctrl+C or Command+C to copy'); }); + }); } + + /* Search marking --------------------------*/ + var url = new URL(window.location.href); + var toMark = url.searchParams.get("q"); + var mark = new Mark("main#main"); + if (toMark) { + mark.mark(toMark, { + accuracy: { + value: "complementary", + limiters: [",", ".", ":", "/"], + } + }); + } + + /* Search --------------------------*/ + /* Adapted from https://github.com/rstudio/bookdown/blob/2d692ba4b61f1e466c92e78fd712b0ab08c11d31/inst/resources/bs4_book/bs4_book.js#L25 */ + // Initialise search index on focus + var fuse; + $("#search-input").focus(async function(e) { + if (fuse) { + return; + } + + $(e.target).addClass("loading"); + var response = await fetch($("#search-input").data("search-index")); + var data = await response.json(); + + var options = { + keys: ["what", "text", "code"], + ignoreLocation: true, + threshold: 0.1, + includeMatches: true, + includeScore: true, + }; + fuse = new Fuse(data, options); + + $(e.target).removeClass("loading"); + }); + + // Use algolia autocomplete + var options = { + autoselect: true, + debug: true, + hint: false, + minLength: 2, + }; + var q; +async function searchFuse(query, callback) { + await fuse; + + var items; + if (!fuse) { + items = []; + } else { + q = query; + var results = fuse.search(query, { limit: 20 }); + items = results + .filter((x) => x.score <= 0.75) + .map((x) => x.item); + if (items.length === 0) { + items = [{dir:"Sorry 😿",previous_headings:"",title:"No results found.",what:"No results found.",path:window.location.href}]; + } + } + callback(items); +} + $("#search-input").autocomplete(options, [ + { + name: "content", + source: searchFuse, + templates: { + suggestion: (s) => { + if (s.title == s.what) { + return `${s.dir} >
    ${s.title}
    `; + } else if (s.previous_headings == "") { + return `${s.dir} >
    ${s.title}
    > ${s.what}`; + } else { + return `${s.dir} >
    ${s.title}
    > ${s.previous_headings} > ${s.what}`; + } + }, + }, + }, + ]).on('autocomplete:selected', function(event, s) { + window.location.href = s.path + "?q=" + q + "#" + s.id; + }); + }); })(window.jQuery || window.$) + +document.addEventListener('keydown', function(event) { + // Check if the pressed key is '/' + if (event.key === '/') { + event.preventDefault(); // Prevent any default action associated with the '/' key + document.getElementById('search-input').focus(); // Set focus to the search input + } +}); diff --git a/docs/pkgdown.yml b/docs/pkgdown.yml index 92bbe6e..b39f07c 100644 --- a/docs/pkgdown.yml +++ b/docs/pkgdown.yml @@ -1,5 +1,8 @@ -pandoc: 3.1.3 -pkgdown: 2.1.1.9000 -pkgdown_sha: 739380ac569123aa88cbeab64ba4f42105f88c00 +pandoc: '3.2' +pkgdown: 2.1.1 +pkgdown_sha: ~ articles: {} -last_built: 2025-09-19T12:00Z +last_built: 2025-09-27T12:50Z +urls: + reference: https://wanglabcsu.github.io/blit/reference + article: https://wanglabcsu.github.io/blit/articles