Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View adiamb's full-sized avatar
😇

Aditya Ambati adiamb

😇
View GitHub Profile
@adiamb
adiamb / elastic-net-regression-evaluation.R
Created October 19, 2016 17:42 — forked from tonyfischetti/elastic-net-regression-evaluation.R
Code for my blog post "Kickin' it with elastic net regression"
#!/usr/bin/Rscript --vanilla
###########################################################
## ##
## elastic.R ##
## ##
## Author: Tony Fischetti ##
## tony.fischetti@gmail.com ##
## ##
###########################################################
## ------------------------- ##
## An Example of ##
## Automating Plot Output ##
## ------------------------- ##
names = LETTERS[1:26] ## Gives a sequence of the letters of the alphabet
beta1 = rnorm(26, 5, 2) ## A vector of slopes (one for each letter)
beta0 = 10 ## A common intercept
@adiamb
adiamb / run_snptest.sh
Created February 8, 2017 00:51 — forked from explodecomputer/run_snptest.sh
SNPTEST GWAS script
#!/bin/bash
#PBS -N sleepgwas
#PBS -o sleepsnptest-output
#PBS -e sleepsnptest-error
#PBS -t 1-22
#PBS -l walltime=24:00:00
#PBS -l nodes=1:ppn=2
#PBS -S /bin/bash
###PYTHON#############
#Purpose : Replication of MS spectra analysis
#Author : Aditya Ambati
#date : May 14 2017
#update : version 1
#####import libraries
from itertools import chain
import pandas as pd
import glob
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
import re
def cleanimpute(x, y, z):
cleaned_info = x[(x['info'] >= 0.8) & (x['certainty'] >= 0.8)]#x[x['certainty'] >= 0.9]
cleaned_impute = y[y[1].isin(cleaned_info.rs_id)]
cleaned_impute.to_csv(z, index=False, header=None)
@adiamb
adiamb / LSTM_RNN_train_May4.py
Created May 18, 2017 01:55
Training a LSTM network
###PYTHON#############
#Purpose : to test Recurrent neural networks
#Author : Aditya Ambati
#date : May 3 2017
#update : version 1
#####import libraries
import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error
from math import sqrt
###PYTHON#############
#Purpose : Replication of MS spectra analysis
#Author : Aditya Ambati
#date : May 14 2017
#update : version 1
#####import libraries
from itertools import chain
import pandas as pd
@adiamb
adiamb / P86to87_GWASscript_April21.sh
Last active May 18, 2017 19:29
Plates86_87_GWAS_bash_April21
!/bin/sh
#
# set the name of the job
#$ -N hcrt_AA
#
# set the maximum memory usage (per slot)
#$ -l h_vmem=2G
#
# set the maximum run time
@adiamb
adiamb / CSF_QTLpipelin_SNPtest.sh
Created May 18, 2017 19:30
CSF_QTL_ANALYSIS_Pipeline_May18_2017
Wed 15 Feb 2017 04:06:05 PM PST
#!/bin/sh
for i in `seq 1 22`
do
command=`echo snptest -data /srv/gsfs0/projects/mignot/hcrtgwas/CHR"$i".Plate86to87.impute2 /srv/gsfs0/projects/mignot/hcrtgwas/CHR"$i".86to87.updated.sample -method score -cov_names C1 C2 C3 C4 C5 C6 C7 C8 C9 -frequentist 1 -pheno HCRT -o hcrt.plate86to87updated.CHR"$i" -exclude_samples /srv/gsfs0/projects/mignot/hcrtgwas/CHR"$i".86to87.exclusion.sample`
touch tmpchr SNPtest.$i.sh
chmod 755 SNPtest.$i.sh
echo \#\!/bin/bash >SNPtest.$i.sh
echo \#$ -N chr"$i"_SNPtest >>SNPtest.$i.sh
echo \#$ -l h_vmem=5G >>SNPtest.$i.sh
@adiamb
adiamb / matrixQTL_April26.R
Created May 18, 2017 19:36
MatrixQTL_implmentation_April26
require(data.table)
require(MatrixEQTL)
require(readr)
totalEM_DOS = as.matrix(totalEM_DOS[-c(1:3, 358)])
rownames(totalEM_DOS) = totalEM_DOS_SNP_POS$SNP
snps = SlicedData$new()
snps$CreateFromMatrix(totalEM_DOS)
maf.list = vector('list', length(snps))
for(sl in 1:length(snps)) {