Skip to content

Instantly share code, notes, and snippets.

View USMortality's full-sized avatar

USMortality.com USMortality

View GitHub Profile
@USMortality
USMortality / Commands
Created December 21, 2024 18:33
Alignment of read 6bde649c-c7a2-4872-ab6f-147510942a0e and MN908947.3
# DL: https://osf.io/dfvbz
$ zstd -dc VeroInf24h.all.fastq.zst|seqkit seq --rna2dna>VeroInf24h.all.fastq
$ minimap2 -aY --sam-hit-only -t7 MN908947.3.fa VeroInf24h.all.fastq >temp.sam
[..]
$ seqkit grep -p "6bde649c-c7a2-4872-ab6f-147510942a0e" VeroInf24h.all.fastq > single_read.fastq
minimap2 -a MN908947.3.fa single_read.fastq | samtools sort -@ 7 - >temp_longest.bam
samtools index temp_longest.bam
samtools fasta temp_longest.bam > temp_longest.fa
cat MN908947.3.fa temp_longest.fa | mafft --globalpair --clustalout -
@USMortality
USMortality / germany_vae.r
Last active December 10, 2024 08:05
PEI Impfnebenwirkungen [Germany]
library(dplyr)
library(readxl)
url <- paste0(
"https://www.pei.de/SharedDocs/Downloads/DE/newsroom/dossiers/rohdaten-",
"sicherheitsberichte/download-xls-uaw-daten-2020-12-27-bis-2023-12-31",
".xlsx?__blob=publicationFile&v=5"
)
tempfile_path <- tempfile(fileext = ".xlsx")
download.file(url, tempfile_path, mode = "wb") # Use mode = "wb" for binary files
@USMortality
USMortality / compare_disaggreation.r
Last active December 6, 2024 10:08
Life Expectancy at Birth [USA, 2022]
library(tidyverse)
library(demography)
library(scales)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / data_usa_deaths_single_years.csv
Last active November 30, 2024 04:28
USA 2019 Deaths by single years
PopName Area Year YearReg YearInterval Sex Age AgeInterval Lexis RefCode Access Deaths NoteCode1 NoteCode2 NoteCode3 LDB
USA 01 2022 2022 1 f 0 1 RR 314 O 9182 . . . 1
USA 01 2022 2022 1 f 1 1 RR 314 O 705 . . . 1
USA 01 2022 2022 1 f 2 1 RR 314 O 442 . . . 1
USA 01 2022 2022 1 f 3 1 RR 314 O 380 . . . 1
USA 01 2022 2022 1 f 4 1 RR 314 O 276 . . . 1
USA 01 2022 2022 1 f 5 1 RR 314 O 267 . . . 1
USA 01 2022 2022 1 f 6 1 RR 314 O 231 . . . 1
USA 01 2022 2022 1 f 7 1 RR 314 O 217 . . . 1
USA 01 2022 2022 1 f 8 1 RR 314 O 215 . . . 1
@USMortality
USMortality / .chart_usa_sads.r
Created November 28, 2024 19:33
Sudden Adult Death Syndrome (SADS) Deaths by ICD-10 Code [USA]
library(tidyverse)
library(scales)
library(tsibble)
library(fable)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / data_usa_ucd_mcd_deaths_2017-2022.sh
Created November 28, 2024 19:33
USA UCD/MCD Deaths 2017-2022
#!/bin/sh
BASE_URL="https://ftp.cdc.gov/pub/Health_Statistics/NCHS/Datasets/DVS/mortality"
OUTPUT_DIR="mortality_data"
YEARS="2017 2018 2019 2020 2021 2022"
OUTPUT_CSV="mcd.csv"
mkdir -p "$OUTPUT_DIR"
echo "id,year,month,age,ucd,mcd" > "$OUTPUT_CSV"
for YEAR in $YEARS; do
YY="${YEAR: -2}" # Extract last two digits of the year
@USMortality
USMortality / .chart_bergamo_pull_forward2.r
Last active November 27, 2024 19:09
Pull Forward Effect in Large Mortality Event [Bergamo, Italy] n=10
library(tsibble)
library(fable)
library(ggplot2)
library(tidyverse)
library(data.table)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / chart_bergamo_pull_forward.r
Last active November 26, 2024 17:35
Pull Forward Effect in Large Mortality Event [Bergamo, Italy]
library(tsibble)
library(fable)
library(ggplot2)
library(tidyverse)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / pull_forward_sim.r
Created November 24, 2024 01:55
Pull Forward Effect Simulation
# Load necessary libraries
library(dplyr)
library(ggplot2)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))
@USMortality
USMortality / .chart_usa_presidential_elections_swing_states.r
Last active January 13, 2025 00:17
Presidential Elections Popular Vote Swing States [USA]
library(readr)
library(dplyr)
library(tidyr)
library(ggplot2)
library(scales)
sf <- 2
width <- 600 * sf
height <- 335 * sf
options(vsc.dev.args = list(width = width, height = height, res = 72 * sf))