Skip to content

Instantly share code, notes, and snippets.

View flashton2003's full-sized avatar

flashton2003

View GitHub Profile
from argparse import ArgumentParser
from Bio import SeqIO
import gzip
from dateutil.parser import parse as dparse
def main():
args = get_args()
time_from = dparse(args.time_from)
time_to = dparse(args.time_to)
@andersgs
andersgs / interative_tree.R
Created February 20, 2018 03:54
Quick interactive phylogenetic tree in R
# LOAD LIBS ---------------------------------------------------------------
library(ape)
library(ggtree)
library(plotly)
# CREATE A TREE -------------------------------------------------------------
n_samples <- 20
n_grp <- 4
tree <- ape::rtree(n = n_samples)
@alexjironkin
alexjironkin / gist:4ed43412878723491240814a0d5a6ed6
Last active January 28, 2023 05:15
min_abundance_finder.py
'''
:Date: 26 Jul 2016
:Author: Public Health England
'''
"""Detect peaks in data based on their amplitude and other features."""
import argparse
from khmer import khmer_args
import khmer
@dasdachs
dasdachs / csv_to_flask.py
Created July 24, 2016 13:14
Upload, read and save the content of a csv file to your model
#!/usr/bin/env python
from io import TextIOWrapper
import csv
from flask import Flask, request, redirect, url_for
from flask_sqlalchemy import SQLAlchemy
# Create Flaskk app, config the db and load the db object
# http://flask-sqlalchemy.pocoo.org/2.1/quickstart/#a-minimal-application
@ryanlayer
ryanlayer / lumpy_cnvnator.sh
Last active December 18, 2020 16:05
LUMPY and CNVnator
WIN=100
SAMPLE="NA12878"
SAMPLE_BAM="NA12878_S1.bam"
cnvnator -root $SAMPLE.$WIN.root -genome GRCh37 -tree $SAMPLE_BAM
cnvnator -genome GRCh37 -root $SAMPLE.$WIN.root -his $WIN -d /shared/genomes/b37/full/chroms
cnvnator -root $SAMPLE.$WIN.root -stat $WIN
cnvnator -root $SAMPLE.$WIN.root -partition $WIN
cnvnator -root $SAMPLE.$WIN.root -call $WIN > $SAMPLE.$WIN.cnvcalls.txt
@stephenturner
stephenturner / deseq2-analysis-template.R
Created July 30, 2014 12:20
Template for analysis with DESeq2
## RNA-seq analysis with DESeq2
## Stephen Turner, @genetics_blog
# RNA-seq data from GSE52202
# http://www.ncbi.nlm.nih.gov/geo/query/acc.cgi?acc=gse52202. All patients with
# ALS, 4 with C9 expansion ("exp"), 4 controls without expansion ("ctl")
# Import & pre-process ----------------------------------------------------
# Import data from featureCounts
cat hg18.fa | awk '{
if (substr($0, 1, 1)==">") {filename=(substr($0,2) ".fa")}
print $0 > filename
}'