Skip to content

Instantly share code, notes, and snippets.

View dakl's full-sized avatar
💌
ML Engineer @ Epidemic Sound

Daniel Klevebring dakl

💌
ML Engineer @ Epidemic Sound
  • Epidemic Sound
  • Stockholm
  • 05:37 (UTC +02:00)
View GitHub Profile
pip install git+https://github.com/QuirkyCort/pgzhelper.git
@dakl
dakl / tensorboard_logging.py
Created December 20, 2017 14:16 — forked from gyglim/tensorboard_logging.py
Logging to tensorboard with manually generated summaries (not relying on summary ops)
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: Copyleft
"""
__author__ = "Michael Gygli"
import tensorflow as tf
from StringIO import StringIO
import matplotlib.pyplot as plt
import numpy as np
Sample HS_LIBRARY_SIZE HS_PENALTY_50X PCT_TARGET_BASES_10X OFF_BAIT_BASES ON_BAIT_BASES PCT_OFF_BAIT ON_BAIT_VS_SELECTED HS_PENALTY_30X PCT_TARGET_BASES_30X READ_GROUP
HS_PENALTY_40X TOTAL_READS ON_TARGET_BASES MEAN_TARGET_COVERAGE ZERO_CVG_TARGETS_PCT PCT_PF_UQ_READS BAIT_TERRITORY PCT_USABLE_BASES_ON_TARGET PCT_PF_READS LIBRARY PF_READS PCT_TARGET_BASES_2X GC_DROPOUT AT_DROPOUT PCT_TARGET_BASES_50X GENOME_SIZE PCT_PF_UQ_READS_ALIGNED FOLD_80_BASE_PENALTY HS_PENALTY_10X PCT_USABLE_BASES_ON_BAIT HS_PENALTY_20X PF_UNIQUE_READS PCT_TARGET_BASES_20X SAMPLE NEAR_BAIT_BASES TARGET_TERRITORY FOLD_ENRICHMENT PCT_TARGET_BASES_40X PCT_TARGET_BASES_100X BAIT_DESIGN_EFFICIENCY BAIT_SET HS_PENALTY_100X PCT_SELECTED_BASES MEAN_BAIT_COVERAGE PF_UQ_BASES_ALIGNED PF_UQ_READS_ALIGNED
P-00017852-N-03021179-TD2-CB1 0.0 0.0 899777371.0 524812.0 0.997626 0.245107 0.0 0.0
0.0 9609180.0 524812.0 0.899072 0.836774 1.0 1689097.0 0.000543 1.0 9609180.0 0.045124 2.779323 2.431879 0.0 3137454505.0 0.938492 ? 0.0 0.000543 0.0 960918
#Define the list of machines
machines = {
:reportcreatormahcine => {
:hostname => "reportcreatormahcine",
:ipaddress => "10.10.10.99" #gretzky
},
}
#--------------------------------------
# General provisioning inline script
@dakl
dakl / tcga-vcfs-to-pancan19.sh
Last active November 23, 2015 14:30
Merge VCFs from 19 TCGA projects to a pancan19 VCF
#!/bin/bash
REF=/proj/b2010040/private/nobackup/autoseqer-genome/genome/human_g1k_v37_decoy.fasta
DICT=/proj/b2010040/private/nobackup/autoseqer-genome/genome/human_g1k_v37_decoy.dict
GATKJAR=/home/daniel.klevebring/projects/tcga-maf-to-vcf/GenomeAnalysisTK.jar
WORKDIR=$HOME/Crisp/dakl/tcga-maf-to-vcf
mkdir -p $WORKDIR
cd $WORKDIR
@dakl
dakl / tcga-maf-to-vcf.sh
Last active February 12, 2021 14:06
Convert TCGA MAFs to VCFs to use to annotate other VCF files with variant frequency in the various TCGA projects (including pancan12).
REF=/proj/b2010040/private/nobackup/autoseqer-genome/genome/human_g1k_v37_decoy.fasta
DICT=/proj/b2010040/private/nobackup/autoseqer-genome/genome/human_g1k_v37_decoy.dict
GATKJAR=/home/daniel.klevebring/projects/tcga-maf-to-vcf/GenomeAnalysisTK.jar
WORKDIR=$HOME/Crisp/dakl/tcga-maf-to-vcf
mkdir -p $WORKDIR
cd $WORKDIR
#unpack maf to workdir
tar xvfz ~/projects/tcga-maf-to-vcf/pancan_cleaned_mafs.tar.gz
#!/usr/bin/perl
use strict;
######################################################
# vcfsorter.pl
#
# Copyright (C) 2011 German Gaston Leparc
#
# sorts VCF by reference genome
#
@HD VN:1.4 SO:coordinate
@SQ SN:chrM LN:16571
@SQ SN:chr1 LN:249250621
@SQ SN:chr2 LN:243199373
@SQ SN:chr3 LN:198022430
@SQ SN:chr4 LN:191154276
@SQ SN:chr5 LN:180915260
@SQ SN:chr6 LN:171115067
@SQ SN:chr7 LN:159138663
@SQ SN:chr8 LN:146364022
# This function sorts the matrix for better visualization of mutual exclusivity across genes
memoSort <- function(M) {
geneOrder <- sort(rowSums(M), decreasing=TRUE, index.return=TRUE)$ix;
scoreCol <- function(x) {
score <- 0;
for(i in 1:length(x)) {
if(x[i]) {
score <- score + 2^(length(x)-i);
}
}