Skip to content

Instantly share code, notes, and snippets.

View cplaisier's full-sized avatar

Christopher L Plaisier, PhD cplaisier

View GitHub Profile
##########################################################
## OncoMerge: oncoMerge.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ \ \_____\ ##
## \/_/\/_/ \/_____/ \/_____/ ##
## @Developed by: Plaisier Lab ##
## (https://plaisierlab.engineering.asu.edu/) ##
## Arizona State University ##
import pandas as pd # May not need this or may have already done this but so you know where pd comes from
#### Two possible solutions
##############################################################################
### 1. Calculate all possible values which is what you are doing currently ###
##############################################################################
corrDF_R = pd.DataFrame(index=df.index, columns=df.index)
corrDF_p = pd.DataFrame(index=df.index, columns=df.index)
for i in corrDF_p.index:
# Import libraries up front
import json
# From Table S13 in Plaisier et al., Cell Systems 2016
# These are Entrez IDs (https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3013746/)
input = ['430', '1052', '1053', '1385', '84699', '9586', '1871', '1874', '144455', '79733', '1960', '1997', '2002', '2004', '80712', '2114', '2115', '2120', '51513', '2551', '2623', '2624', '2625', '9421', '3232', '10320', '3659', '3662', '3670', '91464', '3726', '10661', '11278', '128209', '10365', '9314', '1316', '51176', '9935', '23269', '4602', '4774', '4790', '7025', '9480', '5468', '5914', '5916', '3516', '5971', '864', '6257', '4093', '6659', '6660', '6662', '25803', '347853', '30009', '9496', '6929', '6925', '8463', '7022', '29842', '10155', '6935', '132625', '23051', '85416', '7707', '7764', '23528', '201516']
# Loading JSON file
# https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch06s02.html
# Example:
@cplaisier
cplaisier / task 1 part 2.ipynb
Last active July 25, 2018 15:48 — forked from Dbyrum/task1part2.ipynb
adding a new file to the task in order to pull new information and create another network
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cplaisier
cplaisier / const.py
Last active June 26, 2018 18:04 — forked from ssstrike/NetworkMotifAttributes.py
Updated version.
# -*- coding: utf-8 -*-
"""
Created on Mon Jun 18 21:14:50 2018
@author: Fuzzy
"""
import numpy as np
import pandas as pd
import networkx as nx
@cplaisier
cplaisier / task1.ipynb
Created June 11, 2018 20:07 — forked from Dbyrum/task1.ipynb
first task
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cplaisier
cplaisier / pearsonrGeneExpression.py
Created May 3, 2018 18:13 — forked from ssstrike/pearsonrGeneExpression.py
input csv of gene expression, creates histogram for p and r values.
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 07 21:10:33 2018
@author: Fuzzy
"""
import math
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
@cplaisier
cplaisier / tf_SubNetworkFunction.py
Last active April 10, 2018 17:37 — forked from ssstrike/tf_SubNetworkFunction.py
input start gene and hops, output subnetwork.sif
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 24 12:19:38 2018
@author: Fuzzy
"""
import json
with open('tfbsDb_plus_and_minus_5000_entrez.json', 'r') as f:
data = json.load(f)
@cplaisier
cplaisier / entrezIDRedundancyRemoval.R
Last active March 29, 2018 16:02 — forked from oeltoham/Entrez Gene ID Mapping
Script to load up expression data and write out Entrez IDs
# Load libraries
library(GEOquery)
library(genefilter)
# Set working directory
setwd('C:/Users/cplaisie/Dropbox (ASU)/ASU/Students/Omar')
# Load up data
gset <- getGEO(filename="data/GSE26253_series_matrix.txt.gz", GSEMatrix=TRUE, AnnotGPL=T)
pData(gset)
@cplaisier
cplaisier / TF_TestNetworkFam_3_27_2018.py
Last active March 27, 2018 17:56 — forked from ssstrike/TF_TestNetwork.py
input network list, dictionary, hops and output full .sif and sub .sif
# -*- coding: utf-8 -*-
"""
Created on Sat Mar 24 12:19:38 2018
@author: Fuzzy
"""
import json
with open('tfbsDb_plus_and_minus_5000_entrez.json', 'r') as f:
data = json.load(f)