Skip to content

Instantly share code, notes, and snippets.

@sacundim
sacundim / .dockerignore
Created August 20, 2023 19:13
Generic DBT project Dockerfile
dbt_packages/
logs/
target/
.user.yml
@sacundim
sacundim / expanding_pango_aliases_with_duckdb.sql
Last active August 7, 2023 21:18
Expanding PANGO lineage aliases with DuckDB
WITH alias_key AS (
UNPIVOT (
SELECT COLUMNS('^(A.+|B.+|[C-WY-Z].*)')
FROM 'https://raw.githubusercontent.com/cov-lineages/pango-designation/master/pango_designation/alias_key.json'
)
ON COLUMNS (*)
INTO NAME prefix VALUE expansion
), lineage_notes AS (
SELECT
regexp_matches(line, '^\*') AS withdrawn,
@sacundim
sacundim / titanic_casualties.csv
Last active June 22, 2023 06:04
Titanic casualties
Passengers Category Number onboard Number saved Number lost
Children First Class 6 5 1
Children Second Class 24 24 0
Children Third Class 79 27 52
Women First Class 144 140 4
Women Second Class 93 80 13
Women Third Class 165 76 89
Women Crew 23 20 3
Men First Class 175 57 118
Men Second Class 168 14 154
@sacundim
sacundim / secuencias_covid-19_PR_2022-10-26.fasta
Created October 27, 2022 06:43
Secuencias de SARS-CoV-2 de Puerto Rico depositadas a GenBank el 2022-10-26. Incluye dos BQ.1*.
>2022-09-22 |PR-CDC-2-6543467
ATAACTAATTACTGTCGTTGACAGGACACGAGTAACTCGTCTATCTTCTGCAGGCTGCTT
ACGGTTTCGTCCGTGTTGCAGCCGATCATCAGCACATCTAGGTTTTGTCCGGGTGTGACC
GAAAGGTAAGATGGAGAGCCTTGTCCCTGGTTTCAACGAGAAAACACACGTCCAACTCAG
TTTGCCTGTTTTACAGGTTCGCGACGTGCTCGTACGTGGCTTTGGAGACTCCGTGGAGGA
GGTCTTATCAGAGGCACGTCAACATCTTAAAGATGGCACTTGTGGCTTAGTAGAAGTTGA
AAAAGGCGTTTTGCCTCAACTTGAACAGCCCTATGTGTTCATCAAACGTTCGGATGCTCG
AACTGCACCTCATGGTCATGTTATGGTTGAGCTGGTAGCAGAACTCGAAGGCATTCAGTA
CGGTCGTAGTGGTGAGACACTTGGTGTCCTTGTCCCTCATGTGGGCGAAATACCAGTGGC
TTACCGCAAGGTTCTTCTTCGTAAGAACGGTAATAAAGGAGCTGGTGGCCATAGGTACGG
@sacundim
sacundim / covariants-count.sh
Created December 9, 2021 04:32
jq-based script to count sequences in Covariants.org
#!/usr/bin/env bash
#
# Fetch data from Covariants.org and count how many sequences
URL='https://raw.githubusercontent.com/hodcroftlab/covariants/master/web/data/perCountryData.json'
COUNTRY="${1?"No country given"}"
curl --compressed "${URL}" | jq "[
.regions
| .[]
@sacundim
sacundim / prestamos_ppp_condonados.csv
Created October 25, 2021 16:51
Condonación de préstamos del Small Business Administration Paycheck Protection Program en Puerto Rico. Préstamos de $150k o más condonados hasta el 30 de junio del 2021.
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 12 columns, instead of 6. in line 6.
"Préstamo #","Recipiente","Franquicia","Empleos reportados","Fecha préstamo","Principal","Fecha condonación","Cantidad condonada","Dirección","Ciudad","Estado","Código postal"
7953047007,CARIBBEAN RESTAURANTS LLC,Burger King,500,2020-04-08,10000000,2021-06-11,10118888.89,"5 Carr Km 6 Hm 2 Barrio Amelia",GUAYNABO,PR,"00968"
3828657103,SOUTH AMERICAN RESTAURANTS CORP.,Church's Chicken,500,2020-04-12,10000000,2021-06-11,10117500,"35 Diana St, Amelia Industrial Park",GUAYNABO,PR,"00969"
5502967210,CENTRO MEDICO DEL TURABO INC.,,500,2020-04-27,10000000,2021-06-11,10112222.22,"100 AVE. LUIS MUNOZ MARIN",CAGUAS,PR,"00725"
4150097210,"GENESIS SECURITY SERVICES, INC.",,500,2020-04-27,10000000,2021-04-26,10098333.33,"5900 AVE. ISLA VERDE L2 PMB",CAROLINA,PR,"00979"
8283167002,ENCANTO RESTAURANTS INC,Pizza Hut,500,2020-04-08,9727100,2021-06-11,9841123.23,"9615 AVE LOS ROMEROS 200 Montehiedra Office Centre",SAN JUAN,PR,"00926-7037"
9187527106,"INTERNATIONAL RESTAURANT SERVICES, INC.",Chili's Grill & Bar,500,2020-04-15,89
@sacundim
sacundim / puerto_rico_vaccinations_prdoh_by_dose_date.csv
Created October 16, 2021 01:16
Daily summary of Puerto Rico Department of Health vaccination figures. These are by dose administered date. Recent dates may be incomplete
data_date dose_date doses cumulative_doses initial_doses partial_vaxxed final_doses fully_vaxxed
2021-10-14 2020-12-03 2 2 2 2 0 0
2021-10-14 2020-12-04 1 3 1 3 0 0
2021-10-14 2020-12-05 1 4 1 4 0 0
2021-10-14 2020-12-06 1 5 1 5 0 0
2021-10-14 2020-12-07 1 6 1 6 0 0
2021-10-14 2020-12-08 7 13 7 13 0 0
2021-10-14 2020-12-09 1 14 1 14 0 0
2021-10-14 2020-12-10 3 17 3 17 0 0
2021-10-14 2020-12-11 1 18 1 18 0 0
@sacundim
sacundim / extracción.sh
Created August 12, 2021 19:06
Población municipal de Puerto Rico según Censo 2020, en formato sencillo
#!/usr/bin/env bash
#
# Datos de aquí:
#
# * https://www.census.gov/programs-surveys/decennial-census/about/rdo/summary-files.html
#
# Usa la herramienta `xsv` para procesar el archivo:
#
# * https://github.com/BurntSushi/xsv
#
@sacundim
sacundim / transmisión_comunitaria.csv
Created August 1, 2021 23:12
Datos de mi reproducción (modificada) del análisis del informe de transmisión comunitaria en Puerto Rico
Datos hasta Muestras desde Muestras hasta Municipio Población (2019) Color Casos Tasa de casos (ITC1) Positividad (ITC2)
2021-07-31 2021-07-18 2021-07-24 Aguada 36694 Rojo 115 313.40273614214857 18.181818181818183
2021-07-31 2021-07-18 2021-07-24 Isabela 40423 Rojo 95 235.01471934294833 16.08832807570978
2021-07-31 2021-07-18 2021-07-24 Mayagüez 71530 Rojo 163 227.8764154900042 13.503184713375797
2021-07-31 2021-07-18 2021-07-24 Cabo Rojo 47515 Rojo 108 227.29664316531623 20.307692307692307
2021-07-31 2021-07-18 2021-07-24 Aguadilla 50265 Rojo 114 226.79797075499852 22.916666666666668
2021-07-31 2021-07-18 2021-07-24 Añasco 26161 Rojo 48 183.4792248002752 15.873015873015873
2021-07-31 2021-07-18 2021-07-24 Moca 34891 Rojo 56 160.49984236622626 10.545454545454545
2021-07-31 2021-07-18 2021-07-24 Hormigueros 15518 Rojo 22 141.77084675860291 7.6923076923076925
2021-07-31 2021-07-18 2021-07-24 San Germán 30227 Rojo 42 138.9486220928309 11.515151515151516
@sacundim
sacundim / spec.json
Last active July 22, 2021 00:42
Visualización Vega-Lite de CoVariants.org para Puerto Rico
{
"config": {
"axis": {"labelFontSize": 14, "titleFontSize": 14},
"header": {"labelFontSize": 14, "titleFontSize": 14},
"legend": {"labelFontSize": 14, "titleFontSize": 14},
"title": {"align": "center", "fontSize": 20, "offset": 15}
},
"data": {
"url": "https://raw.githubusercontent.com/hodcroftlab/covariants/master/cluster_tables/USAClusters_data.json",
"format": {