Skip to content

Instantly share code, notes, and snippets.

View bede's full-sized avatar

Bede Constantinides bede

View GitHub Profile
@bede
bede / google-latest-jquery
Created December 18, 2011 14:49
Load newest JQuery 1.x library from Google's CDN
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js" type="text/javascript"></script>
@bede
bede / install-sci-py-osx
Last active December 25, 2015 02:48
Install scientific Python (inc. IPython) on virgin Mac OS X 10.8
## Prerequisites
# Latest Xcode
# Latest Apple command line utilities
# Homebrew (check 'brew doctor')
# 20+ minutes (new machine with SSD – hours on our lab's 2008 Mac Pro)
## Commands (instead install scipy superpack?)
brew install python # Symlinking may well be problematic – use 'brew link --overwrite python' if necessary)
pip install virtualenv
pip install virtualenvwrapper
@bede
bede / gist:77f37fed5857d852ac69
Last active January 21, 2019 15:03
Bioinformatics flavoured Mojave
# Resilio, Dropbox, JupyterLab, Firefox, Sublime, Atom, Zotero, VPNs,
# Slack, Bitwarden, Office, Sketch, Typora
# Brew, Miniconda, Jupyterlab, RStudio, Docker
# Install custom jupyterlab envs https://ipython.readthedocs.io/en/latest/install/kernel_install.html#kernels-for-different-environments
# Create /opt/ and /opt/bin, place nextflow inside latter.
# Put toggle-able symlinks to brewed GCC inside here, prepend to path in .bashrc (`gcc_links_on`, `gcc_links_off`)
# Nextflow
# .ssh
# Generate keys
# Create /opt and opt/bin, add to path
@bede
bede / gist:ce9b2992bfc1bcb763a0
Last active August 29, 2015 14:07
homebrew-science: AMOS install aborts due to 'unsatisfied' Perl dependency
bede-rmbp:~ bede$ brew update && brew upgrade && brew doctor
Already up-to-date.
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and what additional flags to use when
compiling and linking.
@bede
bede / gist:a2ddf3847561c2d4243c
Last active August 29, 2015 14:09
email_alert.php
<?php
// Send basic email alerts from cURL etc.
// Usage: curl domain.com/email_alert.php?script-ran-successfully
mail('mail@domain.com', 'Alert: ' . $_SERVER['QUERY_STRING'], 'Request origin: ' . $_SERVER['SERVER_ADDR']);
?>
@bede
bede / gist:fb19d960783aaa888d34
Created March 6, 2015 13:18
Zurb Foundation CLI: `new <project> --libsass` throws fatal error
bede-rmbp:www bede$ foundation new project --libsass
Creating ./project
create project
Cloning into 'project'...
remote: Counting objects: 173, done.
remote: Total 173 (delta 0), reused 0 (delta 0), pack-reused 173
Receiving objects: 100% (173/173), 235.17 KiB | 436.00 KiB/s, done.
Resolving deltas: 100% (63/63), done.
Checking connectivity... done.
Installing dependencies with bower...
@bede
bede / ebi_restful_blast
Last active September 8, 2016 10:13
Serial BLASTing of multifasta sequences using Python3 and EBI's REST API
#!/usr/bin/env python3
import io
import sys
import time
import datetime
import requests
from Bio import SeqIO
@bede
bede / sam_to_consensus_fa.sh
Last active July 17, 2017 17:15
Bioinformatics code golf: SAM to consensus FASTA
# SAM to consensus FASTA code golf, inspired by http://lab.loman.net/2015/07/28/calling-haploid-consensus-sequence/
# Starting with a SAM:
samtools view -bS seqs.sam | samtools sort - seqs # Generate and sort BAM
samtools index seqs.bam # Index BAM
# Starting with an indexed BAM:
samtools mpileup -ud 1000 -f seqs_ref.fasta seqs.bam | bcftools call -c | vcfutils.pl vcf2fq | seqtk seq -a - > seqs.consensus.fa # Generate pileup, call variants, convert to fq, convert to fa
# Who can do better? The bar is set low...
@bede
bede / gist:e12abda8064d64003639
Created October 7, 2015 11:02
SPAdes 3.6.1 Homebrew-science build error
Bede$ brew install spades
==> Installing spades from homebrew/homebrew-science
==> Downloading https://homebrew.bintray.com/bottles-science/spades-3.6.1.yosemite.bottle.tar.gz
curl: (22) The requested URL returned error: 404 Not Found
Error: Failed to download resource "spades"
Download failed: https://homebrew.bintray.com/bottles-science/spades-3.6.1.yosemite.bottle.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://spades.bioinf.spbau.ru/release3.6.0/SPAdes-3.6.1.tar.gz
Already downloaded: /Library/Caches/Homebrew/spades-3.6.1.tar.gz
@bede
bede / gist:888cb52404682a28adc2
Created October 7, 2015 11:03
SPAdes 3.6.1 proposed homebrew formula
class Spades < Formula
desc "SPAdes: de novo genome assembly"
homepage "http://bioinf.spbau.ru/spades/"
bottle do
cellar :any
sha256 "9d69a98a442701f818df56325beeb1ddc8457da5932da172706becf18f6d3fed" => :yosemite
sha256 "89ff010f4542bb2f63144c642a125fdedee8367a14410bfd3b30c6b27caeb1c9" => :mavericks
sha256 "834d20f5a8b812cdb8c1e2b9c36a8baf35b5f6e5d7f3af910350713a3357ae5e" => :mountain_lion
end