This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# previous versions allowed to generate directly from BAM, but there seemed to have been some troubles | |
# between versions of XAM, so this version is working so far for its intended purpose on https://github.com/brendanofallon/jovian | |
# also, this version is rather fast | |
# | |
# | |
# note: ignores quality scores at the moment - fixed in revision#4 | |
# note2: outputs to STDOUT a SAM file without a header | |
# tested with julialang v1.10.2 and XAM v0.4.0 | |
# $ julia shredBAM.jl input.bam 300 > test.sam.noheader | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example code for simulation recovery of infection dynamics from deaths for COVID ----------------------------------------- | |
# Load libraries: | |
# install.packages("EpiNow2", repos = "https://epiforecasts.r-universe.dev") | |
library(EpiNow2) | |
# Simulate data and delays ----------------------------------------- | |
# Simulate infections with a sharp drop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# - - - - - - - - - - - - - - - - - - - - - - - | |
# Code by Adam Kucharski to accompany post 'Counting current COVID infections' (2nd Jan 2024) | |
# Post is available at: https://kucharski.substack.com | |
# Code in this file is shared under an MIT license (https://opensource.org/license/mit/) | |
# - - - - - - - - - - - - - - - - - - - - - - - | |
# Load libraries | |
library(dplyr) | |
library(readr) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(rextendr) | |
rust_function(" | |
fn rowmin(m: RMatrix::<i32>) -> Vec<i32> { | |
// convert to an ndarray | |
let matrix = <ArrayView2<i32>>::from_robj(&m).unwrap(); | |
// store results | |
let mut min_values = Vec::with_capacity(matrix.len()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#let segments = ( | |
(nomenclature: "4", title: "Refrigerant Type", description: [4 = R-410A \ 2 = R22], separator: ""), | |
(nomenclature: "TE", title: "Application", description: [TE = Fully Convertible \ TG = Semi Convertible], separator: "-"), | |
(nomenclature: "E", title: "Product Family", description: [E = Leadership -- Variable Speed \ P = Leadership], separator: "-"), | |
) | |
#let nomenclature( | |
segments: ((nomenclature: "A", title: "Foo", description: [Bar], separator: "-")) | |
) = { | |
place(top + left, [#box()#label("margins")]) // get top + left margins dynamically |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// todo: key this by the provided label or just use dependency injection | |
#let this-counter = counter("info-box") | |
#let info-box( | |
title: none, | |
sections: none, | |
label: none, | |
caption: none, | |
radius: 3pt, | |
inset: 16pt, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Glossary code by Hugo Cartigny (BlueskyFR) 🍉 | |
#let glossary(indent-defs: false, doc) = { | |
// ✨ The glossary displays its items using level 99 headings | |
let glossary = state("wow", (:)) | |
// Hide the numbering for level 99 titles | |
show heading.where(level: 99): it => text(weight: "regular", it.body) | |
let page-refs-color = rgb("#7630EA") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Pkg | |
Pkg.activate(".") | |
Pkg.add(["Turing","Distributions","ApproxFun","QuadGK","StatsPlots","LinearAlgebra","DataFrames"]) | |
using Turing, Distributions, ApproxFun, QuadGK, StatsPlots, LinearAlgebra, DataFrames | |
# a prior over functions that go up then come down... First let's see how ApproxFun works | |
Random.set_global_seed!(123456) | |
f = Fun(Chebyshev(Interval(0..100)),randn(12)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// save to windows-user directory | |
linters: with_defaults(object_name_linter = NULL, | |
object_length_linter(50), | |
commented_code_linter = NULL, | |
object_usage_linter = NULL, | |
line_length_linter(120), | |
cyclocomp_linter = cyclocomp_linter(50)) |
NewerOlder