Skip to content

Instantly share code, notes, and snippets.

View clintval's full-sized avatar

Clint Valentine clintval

View GitHub Profile
@clintval
clintval / cosmic-all-muts.py
Last active March 7, 2018 23:18
Faux-object-oriented model for COSMIC used in DOI:10.1073/pnas.1700759114
import textwrap
from operator import itemgetter
from Bio.Seq import reverse_complement
from pyfaidx import Fasta, FetchError
from collections import Counter, defaultdict, OrderedDict
from pymutagenesis.seq import *
link = '<a target="_blank" href={}>{}</a>'
@clintval
clintval / aflatoxin-biomarker.pnas.1700759114.json
Created March 7, 2018 23:10
Data manifest from DOI:10.1073/pnas.1700759114
{
"A10": [
0.0034329041, 0.0137316166, 0.0344053282, 0.0188924926, 0.0240140593,
0.0212451426, 0.0821539635, 0.0064712216, 0.0620039955, 0.0524827040,
0.2530320358, 0.0485341620, 0.0114430138, 0.0159038497, 0.0332954789,
0.0099940168, 0.0068658083, 0.0000000000, 0.0062555142, 0.0113354956,
0.0026682288, 0.0070817142, 0.0072488791, 0.0161780540, 0.0074404795,
0.0071567324, 0.0295204042, 0.0000000000, 0.0022886028, 0.0000000000,
0.0030268617, 0.0099940168, 0.0000000000, 0.0000000000, 0.0218942998,
0.0000000000, 0.0000000000, 0.0035408571, 0.0144977583, 0.0032356108,
@clintval
clintval / dcs-pipeline-template.sh
Created March 7, 2018 23:10
Academic DCS pipeline v2.0 from DOI:10.1073/pnas.1700759114
#!/bin.sh
# request Bourne shell as shell for job
#$ -S /bin/sh
#$ -cwd
#$ -V
#$ -m e
#$ -pe whole_nodes 7
#$ -M valentine.clint@gmail.com
###############################
module add bwa/0.6.1
@clintval
clintval / IGV-static.py
Created March 7, 2018 23:07
Generate a static image of a Jupyter IGV canvas
class IgvCanvasToStatic(object):
def __init__(self):
self._javascript = """
// Converts canvas to an image
function convertCanvasToImage(canvas)
{
var image = canvas.toDataURL("image/png");
return '<img src="' + image + '"/>';
}
@clintval
clintval / pandas-comma-fmt.py
Created February 25, 2018 00:28
Format DataFrame's with better integer representation e.g. 1,000,00.00
import contextlib
import sys
import pandas as pd
try:
import pandas.io.formats.format as pf
except ImportError:
import pandas.formats.format as pf
except ImportError:
@clintval
clintval / mpl-animate.py
Created February 25, 2018 00:15
Matplotlib Animation in Notebook
import base64
import matplotlib.pyplot as plt
from matplotlib import animation
from tempfile import NamedTemporaryFile
__all__ = [
'Animation',
'animate_3d_scatter']
@clintval
clintval / demux-wrapper-example.Snakefile
Created January 10, 2018 19:21
Snakemake Picard IlluminaBaseCallsToSam Wrapper Example
rule illumina_basecalls_to_sam:
input:
basecalls_dir=basecalls_dir,
barcodes_dir=rules.extract_illumina_barcodes.output.barcodes_dir,
library_params=rules.create_basecalling_params.output.library_params
output: list_unmerged_sample_bam()
threads: max(1, int(threads / len(lanes)))
resources:
gc_time_limit=50,
gc_heap_free_limit=10,
@clintval
clintval / vep-PKGBUILD
Created January 6, 2018 16:41
Work in progress PKGBUILD for vep
# Maintainer: Clint Valentine <valentine.clint@gmail.com>
pkgname=vep
pkgver=90.10
pkgrel=1
pkgdesc="Determines the effect of variants on genes, transcripts, and protein sequences as well as regulatory regions"
arch=('x86_64')
url="https://useast.ensembl.org/info/docs/tools/vep/index.html"
license=('GPL3')
depends=('perl>=5' 'perl-module-build' 'bioperl-live-git')
@clintval
clintval / polyphen-PKGBUILD
Last active January 10, 2018 17:26
Work in progress PKGBUILD for polyphen
# Maintainer: Clint Valentine <valentine.clint@gmail.com>
pkgname=polyphen
pkgver=2.2.2r405c
pkgrel=1
dbver=2.2.2
blastver=2.7.1
pkgdesc="A tool to predict impact of amino acid substitutions on the structure and function of human proteins"
arch=('any')
url="http://genetics.bwh.harvard.edu/pph2/dokuwiki/downloads"
@clintval
clintval / js-rendered-html-scrape.ipynb
Last active November 18, 2017 06:43
A selenium web driver and a Python virtual display
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.