Skip to content

Instantly share code, notes, and snippets.

View audy's full-sized avatar

Austin Richardson audy

View GitHub Profile
@audy
audy / download-genbank.sh
Created July 11, 2018 22:23
quick way to get all the fasta files for all bacterial genomes
#!/bin/bash
set -euo pipefail
rm -rf genbank/
rsync \
--archive \
--progress \
--recursive \
@audy
audy / scrape-greengenes.sh
Created March 23, 2018 19:08
Download all of GreenGenes database from SecondGenome
#!/bin/bash
set -euo pipefail
function get_source() {
curl --silent "http://greengenes.secondgenome.com/downloads/database/13_5"
}
function get_urls() {
get_source | grep 'https:' | grep s3 | cut -d '"' -f 2
@audy
audy / rargparse.R
Created February 8, 2018 02:56
Attempting to write an argparse clone in pure R (using R6 classes tho)
#!/usr/bin/env Rscript
library(R6)
library(testthat)
Argument <- R6Class('Argument',
public = list(
flag = NA,
help = NA,
package main
import (
"os"
"fmt"
"bufio"
)
func main() {
@audy
audy / pcr.py
Created January 24, 2018 07:59
class DNA:
def __init__(self, sequence: str) -> None:
self.sequence = str(sequence).lower()
@property
def reverse(self) -> 'DNA':
return DNA(self.sequence[::-1])
@property
#!/usr/bin/env python3
import requests
from bs4 import BeautifulSoup
url = 'http://www.berkeleybowl.com/daily-hot-soup'
res = requests.get(url)
soup = BeautifulSoup(res.content, 'html5lib')
class Render
def self.[](engine:)
p engine
end
end
Render[engine: 'doot']
@audy
audy / boat.rb
Last active October 6, 2017 22:42
class Boat
class << self
def <=> boat
boat
end
def [] boat
boat
end
@audy
audy / ncbi-fetch.rb
Created October 5, 2017 22:03
fetch genomes from NCBI in parallel
#!/usr/bin/env ruby
# download all genomes from ncbi using 8 processes
# ./ncbi-fetch.rb | xargs -I {} -n1 -p 8 wget {}
File.open('assembly_summary.txt').each do |line|
row = line.strip.split("\t")
base_url = row[19]
next if base_url.nil?
dir = base_url.split('/').last
@audy
audy / nose.Makefile
Last active September 27, 2017 04:01
test: .PHONY
@python -m 'nose' --nocapture
ftest: .PHONY
@python -m 'nose' --with-focus --nocapture
clean:
@git clean -f
.PHONY: