This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Load counts | |
| d0 = read.csv('gexp_counts.csv',header=T,row.names=1) | |
| d0 = d0[which(apply(d0,1,sum)!=0),] | |
| library(DESeq2) | |
| conds = data.frame(subset=factor(c(rep('Cntl_CD44Low',4), rep('Cntl_Ag85B_Plus_PD1_Plus',4), rep('Cntl_ESAT6_Plus_PD1_Plus',4), rep('Stim_Ag85B_Plus_PD1_Plus',4), rep('Stim_ESAT6_Plus_PD1_Plus',4)))) | |
| rownames(conds) = colnames(d0) | |
| # Make a map of Entrez IDs to UCSC transcript IDs | |
| d1 = read.csv('entrez2ucsc.csv',header=F) | |
| entrez2ucsc = list() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [General] | |
| num_iterations = 2000 | |
| num_clusters = 133 | |
| normalize_ratios = False | |
| num_cores = 6 | |
| checkpoint_interval = 100 | |
| stats_frequency = 50 | |
| result_frequency = 50 | |
| [SetEnrichment] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from itertools import imap | |
| import operator | |
| import logicFuncs as lf | |
| def mean_squared_error(r1, p1): | |
| #assert len(r1) == len(p1) | |
| return sum([(float(p1[i])-float(r1[i]))**2 for i in range(len(r1))])/float(len(r1)) | |
| def hammingDist(str1, str2): | |
| assert len(str1) == len(str2) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| motifName2entrezId = {} | |
| entrezId2motifName = {} | |
| # humanTFs_All.csv with columns separated by commas - Motif Name,Gene Symbol,Entrez ID | |
| with open('id_conversion/humanTFs_All.csv','r') as inFile: | |
| header = inFile.readline().strip().split(',') # Capture header, get rid of white space ".strip()", and split by commas ".split(',')" | |
| while 1: | |
| inLine = inFile.readline() | |
| #Breaks out of the while loop when we hit the end of the file | |
| if not inLine: | |
| break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Mar 12 18:16:24 2018 | |
| @author: Fuzzy | |
| """ | |
| import json | |
| with open('tfbsDb_plus_and_minus_5000_entrez.json', 'r') as f: | |
| data = json.load(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| """ | |
| Created on Mon Mar 12 18:16:24 2018 | |
| @author: Fuzzy | |
| """ | |
| import json | |
| with open('tfbsDb_plus_and_minus_5000_entrez.json', 'r') as f: | |
| data = json.load(f) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import GEOparse | |
| import pandas as pd | |
| import matplotlib.pyplot as plt | |
| import numpy | |
| from matplotlib.backends.backend_pdf import PdfPages | |
| #gseNums = ['GSE14860'] | |
| #gseNums = ['GSE49278', 'GSE19750', 'GSE10846'] | |
| gseNums = ['GSE19417', 'GSE49278', 'GSE19750', 'GSE10846', 'GSE39582', 'GSE35158', 'GSE19422', 'GSE19987', 'GSE32894', 'GSE35158', 'GSE27155', 'GSE33630', 'GSE56303', 'GSE29695', 'GSE10141', 'GSE9843', 'GSE25097', 'GSE32225', 'GSE26566', 'GSE65858', 'GSE39366', 'GSE22138', 'GSE46517', 'GSE71729', 'GSE8607', 'GSE4573', 'GSE29354', 'GSE71118', 'GSE19949', 'GSE15641', 'GSE26253', 'GSE15460', 'GSE21034', 'GSE9891', 'GSE32062', 'GSE72094', 'GSE26939', 'GSE29174', 'GSE31448', 'GSE45725', 'GSE40435', 'GSE14860'] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- 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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 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) |