Skip to content

Instantly share code, notes, and snippets.

@pjbriggs
pjbriggs / Galactic-Engineer-nginx-conf-fragment-for-reports
Created June 2, 2015 13:54
Fragment of nginx conf file for exposing Galaxy report tool
http {
    ...
    upstream reports {
        server localhost:9001;
    }
    ...
    server {
       ...
        location ^~ /reports/ {
            proxy_pass  http://reports;
@pjbriggs
pjbriggs / galaxy_boolean_test_issue2.sh
Last active August 29, 2015 14:21
Dummy Galaxy tool demonstrating problem with setting value of boolean parameter used as "control" variable in a conditional tag within tool tests
#!/bin/sh
echo Values are ${@:2} > $1
@pjbriggs
pjbriggs / boolean_test_issue.sh
Created May 8, 2015 13:38
Demonstrate issue with "boolean" parameter type behaving differently in tests compared with interactive usage.
#!/bin/sh
echo Values are $1 $2 > $3
@pjbriggs
pjbriggs / Galactic-Engineer-GALAXY_SLOTS-trimmomatic-fragment.xml
Created April 22, 2015 12:01
Galactic Engineer/GALAXY_SLOTS: trimmomatic.xml fragment
...
<command interpreter="bash">trimmomatic.sh
-mx8G
-jar \$TRIMMOMATIC_DIR/trimmomatic-0.32.jar
#if $paired_end.is_paired_end
PE -threads \${GALAXY_SLOTS:-6} -phred33 $fastq_r1_in $paired_end.fastq_r2_in $fastq_out_r1_paired $fastq_out_r1_unpaired $fastq_out_r2_paired $fastq_out_r2_unpaired
#else
SE -threads \${GALAXY_SLOTS:-6} -phred33 $fastq_in $fastq_out
#end if
...
@pjbriggs
pjbriggs / Galactic-Engineer-GALAXY_SLOTS-job_conf-fragment.xml
Last active August 29, 2015 14:19
Galactic Engineer/GALAXY_SLOTS: job_conf.xml fragment
<destinations default="dynamic">
...
<!-- DRMAA runner for job using 4 cores -->
<destination id="sge_smp_4" runner="drmaa">
<param id="nativeSpecification">-R y -V -j n -pe smp.pe 4</param>
</destination>
...
@pjbriggs
pjbriggs / check_gtf_exon_coverage.py
Created April 1, 2015 10:06
Given a GTF file, check that for each exon entry the associated features 'CDS', 'stop_codon' and 'start_codon' are consistent and specify the same range of bases as # their "parent" exon
#!/bin/env python
#
# Check exon coverage in a GTF file
# Peter Briggs UoM, March 2015
#
# Purpose
# -------
# Given a GTF file, check that for each exon entry the
# associated features 'CDS', 'stop_codon' and 'start_codon'
# are consistent and specify the same range of bases as
@pjbriggs
pjbriggs / proftpd.conf-extract
Last active January 19, 2016 05:23
Extract from proftpd.conf for handling SHA1 and PBKDF2 encryption
ServerName "Galaxy FTP File Upload"
ServerType standalone
DefaultServer on
PidFile /var/run/proftpd/proftpd-galaxy.pid
# Port 21 is the standard FTP port.
Port 21
# Don't use IPv6 support by default.
UseIPv6 off
@pjbriggs
pjbriggs / load_urls.py
Created July 2, 2014 13:26
Open multiple arbitrary URLs automatically in a webbrowser
#!/bin/env python
#
# Open multiple arbitrary URLs in a webbrowser
import optparse
import webbrowser
import time
import sys
if __name__ == '__main__':
p = optparse.OptionParser(usage="%prog [-f FILE] [-b BROWSER] [-p INTERVAL] "
"[URL [URL,...]]",
@pjbriggs
pjbriggs / sorting.py
Created July 22, 2013 12:29
Script to explore the use of different types of sort keys, including "natural sort order"
# Compare effects of using different sort keys
import os
import locale
import re
class SortKeys:
natural_sort_digits = re.compile(r'(\d+)')
@classmethod
def default(self,filename):
@pjbriggs
pjbriggs / clean_rtf_to_fasta.sh
Created May 22, 2013 11:15
Hacky script for converting fasta files munged by some other program into RTF files back to fasta format (used for frog data). Probably output file will need some additional corrections by hand.
#!/bin/sh
#
if [ -z "$1" ] || [ -z "$2" ] ; then
echo "Usage: $0 IN.rtf OUT.fasta"
exit 1
fi
if [ ! -e "$1" ] ; then
echo "Input file $1 not found"
exit 1
fi