Skip to content

Instantly share code, notes, and snippets.

View cplaisier's full-sized avatar

Christopher L Plaisier, PhD cplaisier

View GitHub Profile
@cplaisier
cplaisier / ConvertGS2Entrez_postProc.py
Created September 18, 2018 05:03
Coverts postProcessed files to have entrez IDs.
import csv
import pandas as pd
gene2entrez = []
with open('gene2entrez.csv', mode='r') as infile:
reader1 = csv.reader(infile)
gene2entrez = {row1[0]:row1[1] for row1 in reader1}
for post in ['pita','targetscan','tfbs_db']:
# read in the gene symbol map and the post proc
@cplaisier
cplaisier / plotNetworkMotifs_V2heatmap_byGrade.py
Created August 13, 2018 21:16
Look at lines 29, 30, 263-280, 342-353, 371-382
##########################################################
## Consistilator: plotNetworkMotifs.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ \ \_____\ ##
## \/_/\/_/ \/_____/ \/_____/ ##
## @Developed by: Plaisier Lab ##
## (https://plaisierlab.engineering.asu.edu/) ##
## Arizona State University ##
@cplaisier
cplaisier / replicationDatasetPermutation.R
Created August 1, 2018 15:17
Newer version of replication.
#!/usr/bin/env Rscript
suppressMessages(library(WGCNA))
suppressMessages(library(multicore))
suppressMessages(library(getopt))
suppressMessages(library(parallel))
suppressMessages(library(impute))
suppressMessages(library(survival))
# read command line arguments
@cplaisier
cplaisier / 5.16.18.Final.py
Created July 25, 2018 17:56
Ethan's Code
# Loading JSON file
# https://www.safaribooksonline.com/library/view/python-cookbook-3rd/9781449357337/ch06s02.html
# Example:
# import json
#
# # Reading data back
# with open('data.json', 'r') as f:
# data = json.load(f)
import json
@cplaisier
cplaisier / network.py
Created July 10, 2018 19:24
Had to modify the 'network.py' file from the BooleanNet python package to get this to work. Needed to be modified to allow components to be imported instead of component. And also to get all strongly connected components produces a generator, which needed to be turned into a list.
import util
import random
from itertools import count
try:
import networkx
from networkx import components
except ImportError:
util.error( "networkx is missing, install it from https://networkx.lanl.gov/")
@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 / plotNetworkMotifs.py
Created July 2, 2018 19:28
With survival analysis and network states.
##########################################################
## Consistilator: plotNetworkMotifs.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ \ \_____\ ##
## \/_/\/_/ \/_____/ \/_____/ ##
## @Developed by: Plaisier Lab ##
## (https://plaisierlab.engineering.asu.edu/) ##
## Arizona State University ##
@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 / consistilatorV2.py
Created June 5, 2018 18:56
Code to do consistency checking and plotting of network motifs.
##########################################################
## Consistilator: consistilatorV2.py ##
## ______ ______ __ __ ##
## /\ __ \ /\ ___\ /\ \/\ \ ##
## \ \ __ \ \ \___ \ \ \ \_\ \ ##
## \ \_\ \_\ \/\_____\ \ \_____\ ##
## \/_/\/_/ \/_____/ \/_____/ ##
## @Developed by: Plaisier Lab ##
## (https://plaisierlab.engineering.asu.edu/) ##
## Arizona State University ##