Skip to content

Instantly share code, notes, and snippets.

View pditommaso's full-sized avatar
💭
Vita brevis, ars longa

Paolo Di Tommaso pditommaso

💭
Vita brevis, ars longa
View GitHub Profile
@pditommaso
pditommaso / Git notes
Last active February 14, 2017 17:52 — forked from richardcornish/git.md
Start
=====
1. Install Git
http://git-scm.com/download/mac
(But consider using Homebrew)
2. Make a GitHub account
https://github.com/
3. Open Terminal
#!/bin/bash
# bash generate random alphanumeric string
#
dd bs=18 count=1 if=/dev/urandom 2>/dev/null | base64 | tr +/ 0A
import luigi
from luigis_monkey_wrench import *
REF='human_17_v37.fasta'
INDIVIDUALS=['NA06984','NA07000']
SAMPLES=['1','2']
BASENAME='.ILLUMINA.low_coverage.17q_'
PICARDDIR='/sw/apps/bioinfo/picard/1.69/kalkyl/'
KNOWNSITES='/proj/g2014207/labs/gatk/ALL.chr17.phase1_integrated_calls.20101123.snps_indels_svs.genotypes.vcf'
@pditommaso
pditommaso / diff2html.sh
Created September 23, 2016 09:49 — forked from stopyoukid/diff2html.sh
Script that takes a git diff and outputs an html file in GitHub style
#!/bin/bash
#
# Convert diff output to colorized HTML.
# (C) Mitch Frazier, 2008-08-27
# http://www.linuxjournal.com/content/convert-diff-output-colorized-html
# Modified by stopyoukid
#
html="<html><head><meta charset=\"utf-8\"><title>Pretty Diff</title><style>body {text-align: center;}#wrapper {display: inline-block;margin-top: 1em;min-width: 800px;text-align: left;}h2 {background: #fafafa;background: -moz-linear-gradient(#fafafa, #eaeaea);background: -webkit-linear-gradient(#fafafa, #eaeaea);-ms-filter: \"progid:DXImageTransform.Microsoft.gradient(startColorstr='#fafafa',endColorstr='#eaeaea')\";border: 1px solid #d8d8d8;border-bottom: 0;color: #555;font: 14px sans-serif;overflow: hidden;padding: 10px 6px;text-shadow: 0 1px 0 white;margin: 0;}.file-diff {border: 1px solid #d8d8d8;margin-bottom: 1em;overflow: auto;padding: 0.5em 0;}.file-diff > div {width: 100%:}pre {margin: 0;font-family: \"Bitstream Vera Sans Mono\", Courier, monospace;font-size: 12px;line-height: 1.4em;text-indent: 0.5em;}.file {color:
@pditommaso
pditommaso / Hello.g4
Created March 26, 2017 13:55 — forked from mattmcd/Hello.g4
Simple ANTLR4 grammar example
// define a grammar called Hello
grammar Hello;
r : 'hello' ID;
ID : [a-z]+ ;
WS : [ \t\r\n]+ -> skip ;
@pditommaso
pditommaso / NF_logo.png
Created June 14, 2017 15:53 — forked from ewels/NF_logo.png
NextFlow Multipart HTML Emails
Save NextFlow logo as this file.
@pditommaso
pditommaso / raid_ephemeral.sh
Last active December 23, 2017 23:14 — forked from joemiller/raid_ephemeral.sh
detect all ephemeral disks on EC2 then stripe together in a raid-0 vol mounted at /mnt
#!/bin/bash
#
# this script will attempt to detect any ephemeral drives on an EC2 node and create a RAID-0 stripe
# mounted at /mnt. It should be run early on the first boot of the system.
#
# Beware, This script is NOT fully idempotent.
#
METADATA_URL_BASE="http://169.254.169.254/2012-01-12"
yum -y -d0 install mdadm curl
@pditommaso
pditommaso / 00_cmd.sh
Created January 24, 2018 23:14 — forked from lh3/00_cmd.sh
Scripts and command lines to create universal mask for hs37d5
#
# generate 01compositional.bed.gz
#
# low-complexity by mDUST
mdust hs37d5.fa -c -w7 -v28 \
| hs37d5.mdust-w7-v28.txt \
| cut -f1,3,4 \
| gawk -vOFS="\t" '{--$2;print}' \
| bgzip > 01compositional/hs37d5.mdust-w7-v28.bed.gz
@Grab(group = "org.reflections", module = "reflections", version = "0.9.11")
import groovy.json.JsonOutput
import org.codehaus.groovy.reflection.GeneratedMetaMethod
import org.reflections.Reflections
import org.reflections.util.ConfigurationBuilder
def reflections = new Reflections(new ConfigurationBuilder().build())
def json = reflections.getSubTypesOf(GeneratedMetaMethod).collect {
@pditommaso
pditommaso / dgm.json
Created January 16, 2019 20:58 — forked from wololock/dgm.json
[
{
"name": "org.codehaus.groovy.runtime.dgm$0",
"allDeclaredConstructors": true,
"allPublicConstructors": true,
"allDeclaredMethods": true,
"allPublicMethods": true
},
{
"name": "org.codehaus.groovy.runtime.dgm$1",