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
| goTerms = {} | |
| inFile = open('gene_ontology.obo','r') | |
| while 1: | |
| line = inFile.readline() | |
| if not line: | |
| break | |
| if line.strip()=='[Term]': | |
| id1 = inFile.readline().strip().split('id: ')[1] | |
| name = inFile.readline().strip().split('name: ')[1] | |
| namespace = inFile.readline().strip().split('namespace: ')[1] |
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
| library(topGO) | |
| # Read in GO mappings to gene ids | |
| # <gene>\t<GOID>,<GOID>,... | |
| vng2GO <- readMappings(file='vng2GO.map') | |
| # Load up cluster or gene set identifiers | |
| geneSets <- ## Depends on your analysis, list of vectors of gene ids | |
| ################ |
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
| ################################################################# | |
| # @Program: FIRM.py # | |
| # @Version: 1 # | |
| # @Author: Christopher L Plaisier, PhD # | |
| # @Sponsored by: # | |
| # Nitin Baliga, ISB # | |
| # Institute for Systems Biology # | |
| # 401 Terry Ave North # | |
| # Seattle, Washington 98109-5234 # | |
| # (216) 732-2139 # |
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 cPickle, os, re, math | |
| from pssm import pssm | |
| from copy import deepcopy | |
| from multiprocessing import Pool, cpu_count, Manager | |
| from subprocess import * | |
| # Make the files for a TomTom run | |
| def makeQueryFile(nucFreqs, queryPssms, num, strands='+ -'): | |
| # Header crap | |
| memeHeader = '' |
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 glob | |
| # Get a list of the '.clone' files in the | |
| files = glob.glob('*.clone') | |
| # Read in expression data and put it into a dictionary | |
| matrixDictionary = {} | |
| conditions = [] | |
| for file in files: | |
| condition = file.split('.')[0] |
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 subprocess import * | |
| from shutil import move | |
| import os | |
| # Read in manifest of samples to process | |
| samples = [] | |
| inFile = open('manifest.csv','r') | |
| while 1: | |
| line = inFile.readline() | |
| if not line: |
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
| ################################################################# | |
| # @Program: tomtom.py # | |
| # @Version: 1 # | |
| # @Author: Chris Plaisier # | |
| # @Sponsored by: # | |
| # Nitin Baliga, ISB # | |
| # Institute for Systems Biology # | |
| # 1441 North 34th Street # | |
| # Seattle, Washington 98103-8904 # | |
| # (216) 732-2139 # |
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
| # Read in clusters of biclusters | |
| clusters = {} | |
| inFile = open('clustersOfBiclusters_VALL.csv','r') | |
| inFile.readline() # Get rid of header | |
| while 1: | |
| line = inFile.readline() | |
| if not line: | |
| break | |
| splitUp = line.strip().split(',') | |
| if not splitUp[1] in clusters: |
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 subprocess import * | |
| def phyper(q, m, n, k): | |
| # Get an array of values to run | |
| rProc = Popen('R --no-save --slave', shell=True, stdin=PIPE, stdout=PIPE, stderr=PIPE) | |
| runMe = [] | |
| for i in range(len(q)): | |
| runMe.append('phyper('+str(q[i])+','+str(m[i])+','+str(n[i])+','+str(k[i])+',lower.tail=F)') | |
| runMe = '\n'.join(runMe)+'\n' | |
| out = rProc.communicate(runMe) |
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
| entrezIds = {} | |
| inFile = open('mart_export.txt','r') | |
| inFile.readline() # Get rid of header | |
| while 1: | |
| line = inFile.readline() | |
| if not line: | |
| break | |
| splitUp = line.strip().split(',') | |
| if not splitUp[3]=='': | |
| if not splitUp[3] in entrezIds: |
OlderNewer