Skip to content

Instantly share code, notes, and snippets.

View david-a-parry's full-sized avatar

David A. Parry david-a-parry

View GitHub Profile
@david-a-parry
david-a-parry / manhattan_plot.py
Last active May 9, 2022 16:07
Example python code for creating a Manhattan plot using pandas and seaborn
#!/usr/bin/env python3
from collections import OrderedDict
import os
import requests
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
URL = 'https://portals.broadinstitute.org/collaboration/giant/images/8/80/Height_AA_add_SV.txt.gz'
@david-a-parry
david-a-parry / date2gene.py
Last active August 14, 2021 04:33
Example to convert excel corrupted human gene names back from dates to gene symbols
#!/usr/bin/env python3
import os
import warnings
import re
import pandas as pd
date_re = re.compile(r'\d{4}-\d{2}-\d{2}')
mnth2str = {3: 'MARCH', 9: 'SEPT', 10: 'OCT', 12: 'DEC'}
import seaborn as sns
from pandas.api.types import is_float_dtype, is_integer_dtype
import matplotlib.pyplot as plt
%matplotlib inline
def add_quantile_lines(df, ax, x, y, median_width=0.4, quantile_width=0.25,
mean_and_sd=False, mean_and_sem=False, color='k',
line_width=3, alpha=0.8, zorder=9):
if mean_and_sd and mean_and_sem:
@david-a-parry
david-a-parry / analysis.sh
Last active June 19, 2018 12:51
suggested edits
#!/bin/sh
#software
VCFHACKS=~/bin/vcfhacks/
# EXPRESSION=~/projects/bridge_study/vcfs/work/expression.py
CSQ_QUERY=~/projects/bridge_study/vcfs/work/csq_query.py
# dirs
WORK=~/projects/bridge_study/vcfs/work/
AITMAN=${WORK}/aitman/