Skip to content

Instantly share code, notes, and snippets.

View collinarnett's full-sized avatar
🕷️

Collin Arnett collinarnett

🕷️
View GitHub Profile

Keybase proof

I hereby claim:

  • I am collinarnett on github.
  • I am collinarnett (https://keybase.io/collinarnett) on keybase.
  • I have a public key ASDpLh5BV42nb3PqkA5T4p2neVWsovqb3cmx9H_9OraQJQo

To claim this, I am signing this object:

@collinarnett
collinarnett / flake.nix
Created March 13, 2022 18:39
Developing with nix flakes and nickel
{
inputs = {
flake-utils.url = "github:numtide/flake-utils";
nickel.url = "github:tweag/nickel";
};
outputs = { self, nixpkgs, flake-utils, nickel }@inputs:
flake-utils.lib.eachDefaultSystem (system:
let pkgs = nixpkgs.legacyPackages.${system};
in rec {
devShell =
@collinarnett
collinarnett / pimp_my_zeus.md
Created November 3, 2021 18:47
Making Zeus more user friendly

Making Zeus more user friendly

Professors will often instruct students to use zeus without explain much. This is not unusual since their objective is not to teach you about the command line interface (CLI) but rather the content of the course. This guide is meant to simplify the process of using Zeus while also giving a brief glimse into the motivation behind using the CLI.

Logging In

Currently the process of logging into Zeus is as follows:

  1. Enter the ssh command
import io
import picamera
import logging
import socketserver
from threading import Condition
from http import server
PAGE="""\
<html>
<head>
@collinarnett
collinarnett / architectures.py
Created May 13, 2020 04:28
64x64 Architecture
# 64x64
class Generator64(nn.Module):
def __init__(self, ngpu):
super(Generator64, self).__init__()
self.ngpu = ngpu
self.main = nn.Sequential(
nn.ConvTranspose2d(100, 512, kernel_size=4, stride=1, padding=0),
nn.BatchNorm2d(512),
nn.LeakyReLU(0.2),
nn.ConvTranspose2d(512, 256, kernel_size=4, stride=2, padding=1),
@collinarnett
collinarnett / distance_maps.py
Created May 12, 2020 18:59
Create alpha-carbon distance maps
def calc_dist_matrix(residues):
"""Returns a matrix of distances between residues of the same chain."""
size = len(residues)
answer = np.zeros((size, size), np.float)
for row, residue_one in enumerate(residues):
for col, residue_two in enumerate(residues):
answer[row, col] = residue_one["CA"] - residue_two["CA"]
return answer
@collinarnett
collinarnett / download_data.py
Created May 12, 2020 18:16
Download Code for Protein GAN
from pathlib import Path
from urllib import request
from tqdm import tqdm
test_folder = Path("test")
train_folder = Path("train")
test_list = Path('test_ids.txt').read_text().splitlines()
train_list = Path('train_ids.txt').read_text().splitlines()
test_folder.mkdir(exist_ok=True)