This file contains 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 bash | |
##### | |
# Set default command line options | |
##### | |
USERNAME_PREFIX=user | |
USERNAME_SUFFIX_START=1 | |
USERNAME_SUFFIX_END=100 | |
USERNAME_SUFFIX_ZERO_PADDING_LENGTH=4 |
This file contains 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
"fmtDetailValue_Dbxref" : "function(dbxref){if(typeof dbxref!='string'){return dbxref}var dbid=dbxref.split(':');var prefix='';switch(dbid[0].toLowerCase()){case 'interpro':prefix='http://www.ebi.ac.uk/interpro/entry/';break;case 'pfam':prefix='http://pfam.sanger.ac.uk/family/';break;case 'reactome':prefix='http://www.reactome.org/content/detail/';break;case 'unipathway':prefix='http://www.grenoble.prabi.fr/obiwarehouse/unipathway/upa?upid=';break;case 'kegg':prefix='http://www.genome.jp/kegg-bin/show_pathway?ec';break;case 'prositepatterns':prefix='http://prosite.expasy.org/';break;case 'prositeprofiles':prefix='http://prosite.expasy.org/cgi-bin/prosite/PSView.cgi?ac=';break;case 'smart':prefix='http://smart.embl-heidelberg.de/smart/do_annotation.pl?BLAST=DUMMY&DOMAIN=';break;case 'superfamily':prefix='http://supfam.org/SUPERFAMILY/cgi-bin/scop.cgi?sunid=';dbid[1]=dbid[1].replace('SSF','');break;case 'gene3d':prefix='http://www.cathdb.info/version/latest/superfamily/';dbid[1]=dbid[2];break;case 'pirsf':prefi |
This file contains 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 perl | |
use strict; | |
use warnings; | |
my $bed_file = shift @ARGV; | |
my $suffix_fmt = '_part%01d'; | |
open(my $bed_fh, '<', $bed_file) || die "Couldn't open BED file: $!\n"; | |
my %cut_positions; |
This file contains 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/awk | |
# Takes output of "samtools depth" and reformats into grouped bedgraph format: | |
# samtools depth -r ${loc} -Q 1 --reference $fasta $bam | mawk -f scripts/depth2bedgraph.awk > /tmp/my.bedgraph | |
# Example input: | |
#chr1 26 2 | |
#chr1 27 2 | |
#chr1 28 2 | |
#chr1 29 5 | |
#chr1 30 5 | |
#chr1 31 5 |
This file contains 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 | |
# Convert a multi-line FASTA file into a single line FASTA file | |
# These are easier/faster to process using native UNIX tools like paste - - < in.fasta | |
dos2unix | awk 'BEGIN { RS = "\n>"; FS = "\n"; OFS = "" }; | |
{ | |
if (NR == 1) { | |
print $1 | |
} else | |
if (NR > 1) { | |
print ">"$1 |
This file contains 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 | |
sudo apt-get update && sudo apt-get -y dist-upgrade | |
urls=( | |
'https://github.com/pypa/pip.git' | |
'git://github.com/openstack-dev/pbr.git' | |
'git://github.com/iguananaut/d2to1.git' | |
'https://github.com/kelp404/six.git' | |
'https://github.com/openstack/python-glanceclient.git' | |
'https://github.com/openstack/python-keystoneclient.git' |
This file contains 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 | |
# Bash script to download a bunch of *.sra files from the NCBI SRA, using | |
# the aspera client, and extract FASTQ data using the SRA Toolkit. | |
max_bandwidth_mbps=50 | |
# These SRA files are for the durum genome | |
files=( | |
'SRR567512.sra' | |
'SRR567559.sra' |
This file contains 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 | |
# You should clone this gist to obtain the installation and patch file | |
# and then run it locally, after changing the below settings to something | |
# suitable for your system. Something like this: | |
# sudo apt-get install -y ssh | |
# cd | |
# scp -r nhaigh@bioserver:git/sysadmin/generic/gitorious_install ./ | |
# Edit the settings below, then run the following as root: | |
# cd gitorious_install && sh ./install.sh | |
# |
This file contains 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 | |
# First setup everything needed for connecting to it via an NX connection | |
wget https://gist.github.com/nathanhaigh/4007406/raw/40717e3031bec9efccc3dfcc38c3a50c222d29d9/NXServer.sh | |
chmod +x NXServer.sh | |
./NXServer.sh | |
apt-get -y install libreoffice-java-common htop sysstat git xclip dos2unix | |
wget http://mirror.ctan.org/systems/texlive/tlnet/install-tl-unx.tar.gz | |
tar xzf install-tl-unx.tar.gz && rm install-tl-unx.tar.gz |
This file contains 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
# Get/install this screenrc file using something like this (the URL is specific to a particular revision, update as needed): | |
# wget https://gist.github.com/nathanhaigh/5200267/raw/17c8e4a95df8540dfb5a8374c8f78c1f2568e43f/screenrc -O ~/.screenrc | |
startup_message off | |
caption string "%?%F%{= Bk}%? %C%A %D %d-%m-%Y %{= kB} %t%= %?%F%{= Bk}%:%{= wk}%? %n " | |
hardstatus alwayslastline | |
hardstatus string '%{= kG}[ %{G}%H %{g}][%= %{= kw}%?%-Lw%?%{r}(%{W}%n*%f%t%?(%u)%?%{r})%{w}%?%+Lw%?%?%= %{g}][%{R} %d/%m %{W}%c %{g}]' | |
altscreen on |
NewerOlder