Skip to content

Instantly share code, notes, and snippets.

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@pvanheus
pvanheus / blastplus_array.sh
Created August 25, 2015 13:43
Run BLAST as an array job using SGE (on SANBI cluster)
#!/bin/sh
# requirement:
# working directory with:
# in/ - files named .fasta that are query sequences
# out/ - empty directory to put outputs in
# logs/ - empty directory to put logs in
#
# qsub with:
# qsub -t 1-2 -wd ./my-work-dir blastplus_array.sh
@pvanheus
pvanheus / split_fasta.py
Created August 25, 2015 13:48
Script to split a FASTA file into a number of parts
#!/usr/bin/python
from Bio import SeqIO
import argparse
import sys
parser = argparse.ArgumentParser(description='Split a FASTA file into a number of chunks')
parser.add_argument('input_file', type=file, help='Input FASTA file')
parser.add_argument('output_prefix', help='Prefix of output files')
parser.add_argument('num_chunks', type=int, help='Number of chunks to split into')
FROM ubuntu:latest
MAINTAINER Peter van Heusden <pvh@sanbi.ac.za> version: 0.1
RUN apt-get update && apt-get install -y libmysqlclient-dev libmemcache-dev zlib1g-dev libssl-dev python-dev libxml2-dev libxslt1-dev build-essential git python-virtualenv && apt-get clean && rm -rf /var/lib/apt/lists/*
ENV JMS_USER jms
ENV JMS_USER_HOME /home/jms
ENV JMS_ROOT ${JMS_USER_HOME}/JMS
ENV JMS_SRC ${JMS_ROOT}/src
class pendingObject(object):
def __init__(self, obj, contentID, type):
self.obj = obj
self.contentID = contentID
self.type = type
class pendingObjectContainer(object):
def __init__(self):
self.data = dict()
#!/bin/bash
if [ $# -ge 1 ] ; then
STEP=$#
else
STEP=1
fi
if [ $# -ge 2 ] ; then
MODE=$2
#! /bin/sh
### BEGIN INIT INFO
# Provides: supervisord
# Required-Start: $local_fs $remote_fs $networking
# Required-Stop: $local_fs $remote_fs $networking
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Starts supervisord - see http://supervisord.org
# Description: Starts and stops supervisord as needed - see http://supervisord.org
### END INIT INFO
#!/bin/bash
### BEGIN INIT INFO
# Provides: galaxy
# Required-Start: $network $local_fs $mysql $supervisord
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Galaxy
### END INIT INFO
#!/bin/bash
# default headphone volume (40000 is 40%)
DEFAULT_HEADPHONE_VOLUME=${DEFAULT_HEADPHONE_VOLUME-40000}
# default microphone volume (80000 is 80%)
DEFAULT_MICROPHONE_VOLUME=${DEFAULT_MICROPHONE_VOLUME-80000}
# enable headphone
ENABLE_USB_HEADPHONE=${ENABLE_USB_HEADPHONE-1}
# enable microphone
ENABLE_USB_MICROPHONE=${ENABLE_USB_MICROPHONE-0}
@pvanheus
pvanheus / gist:659bf6cb14b074e518e298e11cdac194
Created May 22, 2016 19:26
find all genes in interval (cypher)
MATCH (s:Strand {forward: True}) -[:CONTAINS]->(l1:Location)
WHERE l1.end >= 1000
WITH l1
ORDER BY l1.end ASC LIMIT 1
MATCH (l1)-[:NEXT*]->(l2)
WHERE l2.start <= 7000
WITH l1,l2
ORDER BY l2.end DESC LIMIT 1
MATCH p=(l1)-[:NEXT*]->(l2)
UNWIND nodes(p) as x