Skip to content

Instantly share code, notes, and snippets.

Avatar
🏖️
Away on holiday

Phil Ewels ewels

🏖️
Away on holiday
View GitHub Profile
@ewels
ewels / trace2json.py
Created Sep 14, 2017
Convert Nextflow Trace text file to JSON format
View trace2json.py
#!/usr/bin/env python
# Convert Nextflow text file to JSON format
import json
headers = []
data = {'trace': []}
with open ('NGI-RNAseq_trace.txt') as fh:
for l in fh:
s = l.split("\t")
@ewels
ewels / NF_logo.png
Created Jun 14, 2017
NextFlow Multipart HTML Emails
View NF_logo.png
Save NextFlow logo as this file.
@ewels
ewels / bioconda_badges.html
Created Aug 24, 2016
Bioconda Poster Badges
View bioconda_badges.html
<!DOCTYPE html>
<html lang="en">
<head>
<!--
BIOCONDA POSTER BADGE GENERATOR
Author: Phil Ewels <phil.ewels@scilifelab.se> (@ewels)
Date: August 2016
To add more templates, create in Adobe Illustrator.
@ewels
ewels / check_bismark_analysis.sh
Last active Aug 18, 2016
Quick and dirty script to check for common warning signs in a Bismark BS-seq methylation analysis
View check_bismark_analysis.sh
#!/bin/bash
# Check bisulfite analysis results for any modes of failure that I can think of.
# Assumes data is processed by Cluster Flow / bismark and is in subdirectories.
# For a basic quick summary, just run:
# bash check_bismark_analysis.sh
# To filter which subdirectories are checked, pass a glob expression. For example:
# bash check_bismark_analysis.sh run2_*
View rcolorbrewer_example.html
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="pandoc" />
@ewels
ewels / sra_illumina_stats.r
Created Sep 18, 2014
SRA Sequencing Platform Statistics
View sra_illumina_stats.r
#' ---
#' title: "SRA Sequencing Platform Analysis"
#' author: "Phil Ewels"
#' date: September 2014
#' ---
#' The Sequence Read Archive [(SRA)](http://www.ncbi.nlm.nih.gov/sra)
#' contains the raw DNA-sequencing data for many published datasets.
#' We were interested in which sequencing platforms were prevalent,
#' or rather, how prevalent Illumina Sequencing is. We were specifically
@ewels
ewels / cytobands.pl
Created Sep 17, 2014
Cytoband Coordinate Converter
View cytobands.pl
#!/usr/bin/perl
use CGI::Carp qw(fatalsToBrowser); # pipe errors to the browser instead of the terminal for debugging
use warnings;
use strict;
use Data::Dumper;
#print Dumper(\%args);
print "Content-type: text/plain\n\n";
#############################################################
# Name: Cytobands - Coordinates: Online Version #
@ewels
ewels / front-page.php
Created Aug 27, 2014
Child front-page.php for a full width carousel using the Unite wordpress theme: https://github.com/puikinsh/Unite-Theme
View front-page.php
<?php
if ( get_option( 'show_on_front' ) == 'posts' ) {
get_template_part( 'index' );
} elseif ( 'page' == get_option( 'show_on_front' ) ) {
get_header();
while ( have_posts() ) : the_post();
@ewels
ewels / .bashrc
Created Aug 27, 2014
Bash function to extract any compressed file. Code snippet stolen from @robinandeer - https://github.com/robinandeer/dotfiles
View .bashrc
# One command to extract them all
extract () {
if [ $# -ne 1 ]
then
echo "Error: No file specified."
return 1
fi
if [ -f $1 ] ; then
case $1 in
*.tar.bz2) tar xvjf $1 ;;
@ewels
ewels / front-page.php
Created Mar 24, 2014
Example theme code for Bootstrap Feature Widgets plugin
View front-page.php
<?php
// Outputting the widget area on your homepage
// Accomodates one to four active widget areas, fits bootstrap columns accordingly
// front-page.php
$widget_count = 0;
for ($i = 1; $i <= 4; $i++){
if ( is_active_sidebar('homepage-widget-area-'.$i) ) $widget_count++;
}
if ( $widget_count > 0) {