Skip to content

Instantly share code, notes, and snippets.

View USMortality's full-sized avatar

USMortality.com USMortality

View GitHub Profile
@Explosion-Scratch
Explosion-Scratch / Compress string.js
Created November 1, 2021 18:51
Compress string using gzip and native browser APIs
function compress(string, encoding) {
const byteArray = new TextEncoder().encode(string);
const cs = new CompressionStream(encoding);
const writer = cs.writable.getWriter();
writer.write(byteArray);
writer.close();
return new Response(cs.readable).arrayBuffer();
}
function decompress(byteArray, encoding) {
@pcantalupo
pcantalupo / install_viralrefseq.sh
Created November 5, 2014 18:55
Get NCBI Viral RefSeq and make BLAST databases
#!/bin/bash
# get annotations
wget ftp://ftp.ncbi.nlm.nih.gov/refseq/release/viral/viral.1.genomic.gbff.gz
gunzip viral.1.genomic.gbff.gz
wget ftp://ftp.ncbi.nlm.nih.gov/refseq/release/viral/viral.1.protein.gpff.gz
gunzip viral.1.protein.gpff.gz
# download and create BLAST databases for viral refseq genomic
wget ftp://ftp.ncbi.nlm.nih.gov/refseq/release/viral/viral.1.1.genomic.fna.gz