Skip to content

Instantly share code, notes, and snippets.

View brevans's full-sized avatar

Ben Evans brevans

View GitHub Profile
@brevans
brevans / setup_funannotate
Last active November 4, 2019 15:39
trying to get funannotate to work
# trying to follow the sparse/incomplete instructions here:
# https://funannotate.readthedocs.io/en/latest/conda.html#conda
# also guided by running funannotate check --show-versions
# should look like https://funannotate.readthedocs.io/en/latest/dependencies.html
module load miniconda
conda create -yn funannotate -c bioconda -c conda-forge biopython \
matplotlib \
natsort \
@brevans
brevans / install_cryosparc2.sh
Last active October 19, 2018 19:22
installing cryoSPARC2 on Farnam
#!/bin/bash
## cryosparc install
# where to install cryosparc2 and its sample database
install_path=$HOME/project/software/cryosparc2
# the license ID you got from Structura
license_id=
# your email
my_email=$(cat ~/.forward)
# partition to submit your cryosparc jobs to
# not sure you can change at runtime
@brevans
brevans / submit_cryoSPARC.sh
Last active July 10, 2018 18:35
slurm submit script for running cryoSPARC on Yale HPC
#!/bin/bash
### Edit these to your needs
ONHOLD=00:15 # Time to wait for cryoSPARC jobs to start (format HH:MM)
EMAIL=your.name@yale.edu # Send notification email when node is ready
SLURM_PARTITION=gpu # Which SLURM partition to use
NUM_GPUS=4 # How many GPUs
JOB_MEM=121G # How much memory for the job?
WALLTIME=1-00:00:00 # Walltime request
#### Don't edit below here. Unless you know what you are doing
# clone repo I want subtree from
git clone git@bitbucket.org:caseywdunn/agalma.git
cd agalma
# be paranoid and remove origin so I don't push back to origin
git remote rm origin
# filter subtree I want
git filter-branch --prune-empty --subdirectory-filter dev/conda master
# move subtree to match destination directory structure, maintaining history
git filter-branch -f --index-filter 'git ls-files -s | sed "s-\t\"*-&recipes/-" | GIT_INDEX_FILE=$GIT_INDEX_FILE.new git update-index --index-info && mv "$GIT_INDEX_FILE.new" "$GIT_INDEX_FILE"' HEAD
# clean up
@brevans
brevans / reset_levels.bat
Created September 16, 2017 22:35
Reset Volume mixer settings in windows
@ECHO OFF
ECHO Reset Volume Mixer Settings...
NET STOP Audiosrv
NET STOP AudioEndpointBuilder
REG DELETE "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore" /F
REG ADD "HKCU\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore"
@brevans
brevans / Bosque_summarize.py
Created August 31, 2017 22:09
saving some time summarizing individual excel files
#!/usr/bin/env python
from glob import glob
import pandas as pd
import re
#keep a running list of results
results_list = []
#for each excel file, which we will call xlsx
for xlsx in glob("*.xlsx"):
#!/bin/bash
#SBATCH --job-name=XXXnameXXX
#SBATCH -NXXXextra1XXX
#SBATCH --ntasks-per-node=XXXmpinodesXXX
#SBATCH --cpus-per-task=XXXthreadsXXX
#SBATCH -p XXXqueueXXX
#SBATCH --gres=gpu:XXXextra2XXX
#SBATCH --output=XXXnameXXXslurm-%j.out
srun --mpi=pmi2 XXXcommandXXX
@brevans
brevans / add_controlmaster.sh
Created February 17, 2017 18:30
openssh config to allow sharing of multiple sessions over a single network connection
#!/bin/bash
if [ ! -f ~/.ssh/config ]; then
touch ~/.ssh/config
chmod 644 ~/.ssh/config
fi
mkdir -p ~/.ssh/tmp
if grep -iq 'ControlMaster' ~/.ssh/config; then
echo "ControlMaster options already set, please check ~/.ssh/config"
### Simulations of DAPC analysis to determine probability of seeing random loading values as high as real ones.
setwd("/home/be59/working/jacobina_adegenet")
library('adegenet')
x.pairs.gl = read.PLINK("sources_only.raw", map.file="4ade.map")
dapc.gen1 = dapc(x.pairs.gl,x.pairs.gl$pop,n.pca=7,n.da=1)
sim.list = list()
for (i in 1:100) ## 100 simulations
{
#!/usr/bin/env python
from datetime import datetime
import os
from glob import glob
#set up columns
interaction_columns = ['Time_of_Day', 'Time_Stamp', 'Initiator_ID',
'Interaction_Number', 'Data_Type', 'Partner_ID',
'Initiator_Stake', 'Initiator_X', 'Initiator_Y',
'Partner_Stake', 'Partner_X', 'Partner_Y', 'Females_Present',