Skip to content

Instantly share code, notes, and snippets.

@rob-p
rob-p / convert_to_pdfa.sh
Created July 29, 2020 16:53
Convert a PDF to PDF/A
#!/usr/bin/env bash
pn=$1
convert $1 $1.ps
gs -dPDFA -dBATCH -dNOPAUSE -dNOOUTERSAVE -dUseCIEColor -sProcessColorModel=DeviceCMYK -sDEVICE=pdfwrite -sPDFACompatibilityPolicy=1 -sOutputFile=$1.a.pdf $1.ps
@evd0kim
evd0kim / log_handler_slack.py
Created April 9, 2020 15:29 — forked from GuillaumeDerval/log_handler_slack.py
A --log-handler-script log script for snakemake that pushes the status to Slack
# License: MIT
import socket
from slacker import Slacker
import datetime
import time
import threading
SLACK_TOKEN = 'xoxb-00000000000-000000000000-000000000000000000000000'
CHANNEL_NAME = "your-channel-on-slack"
@ilevantis
ilevantis / bedtools_cheatsheet.md
Last active April 10, 2024 19:12
Bedtools cheatsheet

Bedtools Cheatsheet

General:

Tools Description
flank Create new intervals from the flanks of existing intervals.
slop Adjust the size of intervals.
shift Adjust the position of intervals.
subtract Remove intervals based on overlaps b/w two files.
@schochastics
schochastics / umap.R
Last active October 10, 2018 19:24
Quick and dirty way of using UMAP in R using rPyhton
#install UMAP from https://github.com/lmcinnes/umap
#install.packages("rPython")
umap <- function(x,n_neighbors=10,n_components=2,min_dist=0.1,metric="euclidean"){
x <- as.matrix(x)
colnames(x) <- NULL
rPython::python.exec( c( "def umap(data,n,d,mdist,metric):",
"\timport umap" ,
"\timport numpy",
"\tembedding = umap.UMAP(n_neighbors=n,n_components=d,min_dist=mdist,metric=metric).fit_transform(data)",
@sbamin
sbamin / r_packages_verhaakenv.tsv
Last active June 18, 2019 01:25
List of R packages under default VerhaakEnv, using R 3.3: Updates, if any are pushed daily; For R 3.4, view https://gist.github.com/sbamin/34c60e74a3d9c20a63016a570d00b81d
Package Version LibPath Built
abind 1.4-5 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
ABSOLUTE 1.2.1 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
acepack 1.4.1 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
ade4 1.7-8 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
afex 0.20-2 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
affy 1.52.0 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
affyio 1.44.0 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
animation 2.5 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
annotate 1.52.1 /projects/verhaak-lab/verhaak_env/verhaak_libs/R/3.3.2 3.3.2
@pierrejoubert73
pierrejoubert73 / markdown-details-collapsible.md
Last active May 8, 2024 10:42
How to add a collapsible section in markdown.

How to add a collapsible section in markdown

1. Example

Click me

Heading

  1. Foo
  2. Bar
    • Baz
  • Qux
@PoisonAlien
PoisonAlien / oncotate.r
Last active February 18, 2019 16:13
Takes variants as input and annotates them using borads oncotator api (http://www.broadinstitute.org/oncotator/). Output is a dataframe of annotated variants in maf format.
# Usage
#
# oncotate(maflite, header = FALSE, basename = NULL)
# Arguments
#
# maflite
# input tsv file with chr, start, end, ref_allele, alt_allele columns. (rest of the columns, if present will be attached to the output maf)
#
# header
# logical. Whether input has a header line. Default is FALSE.
@PoisonAlien
PoisonAlien / VarScan2_format_converter.py
Last active May 3, 2021 12:26
Takes output file generated by VarScan2 somatic programme and converts the formats. See here for updated versions https://github.com/PoisonAlien/varscan_accessories
__author__ = "Anand M"
'''
Takes output file generated by VarScan2 somatic programme and converts the formats.
'''
import argparse, math, re
parser = argparse.ArgumentParser(
description="Converts VarScan2 somatic vcf to native format and vice-versa.\nInput is automatically detected")
@mariozig
mariozig / migrate_repo.sh
Last active December 22, 2022 08:32
Migrate repo from GitLab to GitHub Full blog post @ http://ruby.zigzo.com/2015/03/23/moving-from-gitlab-to-github/
# Assume we are in your home directory
cd ~/
# Clone the repo from GitLab using the `--mirror` option
$ git clone --mirror git@your-gitlab-site.com:mario/my-repo.git
# Change into newly created repo directory
$ cd ~/my-repo.git
# Push to GitHub using the `--mirror` option. The `--no-verify` option skips any hooks.
@davfre
davfre / bamfilter_oneliners.md
Last active February 24, 2024 01:23
SAM and BAM filtering oneliners