This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Slice subregions out of a genbank between 2 genes. | |
# Usage: | |
# slice_genes.py infile.gbk gene1:gene2:strand | |
from Bio import SeqIO | |
import sys, argparse | |
def get_args(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Rscript | |
# Perform cell-wise averaging of matrices (ignoring headers and row names) | |
# Standard install if missing | |
list.of.packages <- c("argparse", "abind") | |
new.packages <- list.of.packages[!(list.of.packages %in% installed.packages()[,"Package"])] | |
if(length(new.packages)) install.packages(new.packages) | |
for(i in list.of.packages){suppressMessages(library(i, character.only = TRUE))} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
set -eo pipefail | |
# A small script to generate artemis comparison files (nucleic acid comparison) | |
# since all the webservers are apparently defunct! | |
# Script requires blastn (NOT LEGACY BLAST) and makeblastdb in path - check for existence: | |
command -v makeblastdb >/dev/null 2>&1 || { echo >&2 "makeblastdb doesn't appear to be installed. Aborting."; exit 1; } | |
command -v blastn >/dev/null 2>&1 || { echo >&2 "BLAST+ doesn't appear to be installed. Aborting."; exit 1; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
""" | |
Using products of primes to work out whether 2 strings are anagrams of one another. | |
Inspired by: https://twitter.com/fermatslibrary/status/958700402647674880 | |
Map each of the 26 english characters (A, B, C, ...) to a (unique) prime number. | |
Multiply the values mapped to each character together (A x B x C x ...). | |
Since every integer is a prime, or a unique product of primes, according to the | |
fundamental theorem of arithmetic), two words are anagrams of one another if their |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env Rscript | |
# Plotting surface plots via ggplot2/plotly | |
# Usage: | |
# $ Rscript CDmeltplot.R -i data.csv -o filename | |
############################################################ | |
# General purpose heatmap plotting script for consistency. # | |
# This script can be slow as it was designed to be pretty # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
This script pulls in homologs of proteins from PDB | |
as determined by HHSuite. It then employs pychimera and | |
UCSF Chimera to structurally match them and get an | |
indication of how well they score (RMSD) in order | |
to pick the best simulation. | |
""" | |
import os | |
import subprocess | |
import sys |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#### Print out all fastas ending in a certain string. #### | |
# Change *"$string" to *"$string"* to find containing, | |
# or "$string"* to find starts with. | |
file="$1" | |
string="$2" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Getting python logging info output in a colour coded and customised manner. | |
# Stolen from M. Galardini and https://stackoverflow.com/questions/384076/how-can-i-color-python-logging-output/2532931#2532931 | |
import logging | |
import sys | |
BLACK, RED, GREEN, YELLOW, BLUE, MAGENTA, CYAN, WHITE = range(8) | |
COLORS = { | |
'WARNING' : YELLOW, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script to retrieve PDBs via the command line from the PDB HTTP/FTP | |
# Capture inputs | |
usage() | |
{ | |
cat << EOF | |
usage: $0 options |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ethernet=$(ifconfig en0 | awk '/ether/{print $2}') | |
wifi=$(ifconfig en1 | awk '/ether/{print $2}') | |
echo "Ethernet MAC Address: $ethernet" | |
echo "Wifi MAC Address: $wifi" |