Exemple #1
0
    timeStart = time.time()
    td.run_with_multiprocessing(termDistancePath,cpus=30)
    print time.strftime('%H:%M:%S', time.gmtime(time.time()-timeStart))

# Calculate gene distances
geneDistancePath = os.path.join(homeDir,"gene-distances.csv")
if not os.path.exists(geneDistancePath):
    gd = GeneDistances(termsPath,termDistancePath,outFile=geneDistancePath)
    gd.run()

# Spectral Clustering parameter search 
silvalFile = re.sub("\.csv","-scparams-sv.csv",geneDistancePath)
clustersFile = re.sub("\.csv","-scparams-cl.csv",geneDistancePath)
if not os.path.exists(silvalFile):
    scps = SpectralClusterParamSearch(geneDistancePath,dtype='distance')
    scps.run(chunks=15)

## plot the parameter search 
psFigureFile = os.path.join(homeDir,"param-scan-%s.png"%(_aspect))
if not os.path.exists(psFigureFile):
    scr = SpectralClusterResults(silvalFile,clustersFile)
    scr.plot(figName=psFigureFile)

## run spectral clustering
k = 20
sigma = 0.08

labelsPath = os.path.join(homeDir,"sc-labels-%s.csv"%(_aspect))
if not os.path.exists(labelsPath):
    sc = SpectralCluster(geneDistancePath,dtype='distance')
    sc.run(k,sk=None,sigma=sigma,verbose=True)
Exemple #2
0
    td = TermDistances(termsPath, graphPath)
    print("total distances to evaluate: %s" % td.totalDistances)
    td.run_with_multiprocessing(termDistancePath, cpus=7)

# Calculate gene distances
geneDistancePath = os.path.join(gsaDir, "gene-distances-%s.csv" % (_aspect))
if not os.path.exists(geneDistancePath):
    gd = GeneDistances(termsPath, termDistancePath, outFile=geneDistancePath)
    gd.run()

# Spectral Clustering parameter search
silvalFile = re.sub("\.csv", "-scparams-sv.csv", geneDistancePath)
clustersFile = re.sub("\.csv", "-scparams-cl.csv", geneDistancePath)
if not os.path.exists(silvalFile):
    scps = SpectralClusterParamSearch(geneDistancePath, dtype='distance')
    scps.run(chunks=5, kRange=range(3, 11))

## plot the parameter search
psFigureFile = os.path.join(gsaDir, "param-scan-%s.png" % (_aspect))
if not os.path.exists(psFigureFile):
    scr = SpectralClusterResults(silvalFile, clustersFile)
    scr.plot(figName=psFigureFile)

## run spectral clustering
k = 3
sigma = 0.43

labelsPath = os.path.join(gsaDir, "sc-labels-%s.csv" % (_aspect))

if not os.path.exists(labelsPath):
    sc = SpectralCluster(geneDistancePath, dtype='distance')
Exemple #3
0
    td = TermDistances(termsPath,graphPath)
    print("total distances to evaluate: %s"%td.totalDistances)
    td.run_with_multiprocessing(termDistancePath,cpus=7)

# Calculate gene distances
geneDistancePath = os.path.join(gsaDir,"gene-distances-%s.csv"%(_aspect))
if not os.path.exists(geneDistancePath):
    gd = GeneDistances(termsPath,termDistancePath,outFile=geneDistancePath)
    gd.run()

# Spectral Clustering parameter search
silvalFile = re.sub("\.csv","-scparams-sv.csv",geneDistancePath)
clustersFile = re.sub("\.csv","-scparams-cl.csv",geneDistancePath)
if not os.path.exists(silvalFile):
    scps = SpectralClusterParamSearch(geneDistancePath,dtype='distance')
    scps.run(chunks=5,kRange=range(3,11))

## plot the parameter search
psFigureFile = os.path.join(gsaDir,"param-scan-%s.png"%(_aspect))
if not os.path.exists(psFigureFile):
    scr = SpectralClusterResults(silvalFile,clustersFile)
    scr.plot(figName=psFigureFile)

## run spectral clustering
k = 3
sigma = 0.43

labelsPath = os.path.join(gsaDir,"sc-labels-%s.csv"%(_aspect))


if not os.path.exists(labelsPath):
Exemple #4
0
    timeStart = time.time()
    td.run_with_multiprocessing(termDistancePath, cpus=30)
    print time.strftime('%H:%M:%S', time.gmtime(time.time() - timeStart))

# Calculate gene distances
geneDistancePath = os.path.join(homeDir, "gene-distances.csv")
if not os.path.exists(geneDistancePath):
    gd = GeneDistances(termsPath, termDistancePath, outFile=geneDistancePath)
    gd.run()

# Spectral Clustering parameter search
silvalFile = re.sub("\.csv", "-scparams-sv.csv", geneDistancePath)
clustersFile = re.sub("\.csv", "-scparams-cl.csv", geneDistancePath)
if not os.path.exists(silvalFile):
    scps = SpectralClusterParamSearch(geneDistancePath, dtype='distance')
    scps.run(chunks=15)

## plot the parameter search
psFigureFile = os.path.join(homeDir, "param-scan-%s.png" % (_aspect))
if not os.path.exists(psFigureFile):
    scr = SpectralClusterResults(silvalFile, clustersFile)
    scr.plot(figName=psFigureFile)

## run spectral clustering
k = 20
sigma = 0.08

labelsPath = os.path.join(homeDir, "sc-labels-%s.csv" % (_aspect))
if not os.path.exists(labelsPath):
    sc = SpectralCluster(geneDistancePath, dtype='distance')
    sc.run(k, sk=None, sigma=sigma, verbose=True)