[Swift-commit] r3082 - SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations
noreply at svn.ci.uchicago.edu
noreply at svn.ci.uchicago.edu
Sat Aug 8 11:05:37 CDT 2009
Author: andric
Date: 2009-08-08 11:05:37 -0500 (Sat, 08 Aug 2009)
New Revision: 3082
Added:
SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/concat_sort.py
SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_dist.py
SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_distOLD.py
SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/untar.py
Log:
python script for handling the permutations
Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/concat_sort.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/concat_sort.py (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/concat_sort.py 2009-08-08 16:05:37 UTC (rev 3082)
@@ -0,0 +1,26 @@
+#!/usr/bin/python
+
+import os
+import commands
+import time
+
+
+brains = range(1001,3001,1)
+#brains = range(1,3,1)
+
+def concat_sort(nn):
+ commands.getoutput("cat "+`nn`+"PermFriedman*_*.txt > PermBrain"+`nn`+"_gather.txt")
+ print "gather file (PermBrain"+`nn`+"_gather.txt): "+commands.getoutput("wc PermBrain"+`nn`+"_gather.txt")
+ commands.getoutput("sort -g -k 1 PermBrain"+`nn`+"_gather.txt > PermBrain"+`nn`+"_output.txt")
+ print "count of sorted file (PermBrain"+`nn`+"_output.txt): "+commands.getoutput("wc PermBrain"+`nn`+"_output.txt")
+ commands.getoutput("rm -rf "+`nn`+"PermFriedman*_*.txt")
+ commands.getoutput("rm -rf PermBrain"+`nn`+"_gather.txt")
+
+
+
+os.chdir(os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/")
+print os.getcwd()
+print "starting concat_sort process\ntime is: "+time.ctime()
+
+for nn in brains:
+ concat_sort(nn)
Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_dist.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_dist.py (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_dist.py 2009-08-08 16:05:37 UTC (rev 3082)
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+
+#---- revised coding: Saturday; August 23, 2008
+# reads a set of output files from surfclust
+# and copies the line containing the largest
+# cluster (most nodes) and writes all of
+# those lines to a new file.
+# if the output file contains no data, a
+# 0 is entered
+
+### no user parameters need be entered
+
+import commands
+import os
+import sys
+from stat import *
+
+
+rmm_vals = ["2.2","2.5"]
+
+
+def sort_dist(rmm):
+ file_list = commands.getoutput("ls *_Thresh9_ClstTable_r"+rmm+"_a2.0.1D")
+
+ fl = file_list.split('\n')
+
+ filename = "ClstDistribution_rhRMM"+rmm+"_Thresh9.txt"
+ perm_clust_out = open("ClstDistribution_rhRMM"+rmm+"_Thresh9.txt", "w")
+
+ for f in fl:
+ sz = os.stat(f)[ST_SIZE]
+ if sz == 0:
+ perm_clust_out.write('0\n')
+ else:
+ clst_file = open(f, "r")
+ ln_16 = clst_file.readlines()[16]
+ perm_clust_out.write(ln_16)
+ clst_file.close()
+
+ perm_clust_out.close()
+ commands.getoutput("sort -r -g -k 2 "+filename+" > srtdClstDistribution_rhRMM"+rmm+"_Thresh9.txt.txt")
+
+
+for rmm in rmm_vals:
+ sort_dist(rmm)
Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_distOLD.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_distOLD.py (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/permClst_distOLD.py 2009-08-08 16:05:37 UTC (rev 3082)
@@ -0,0 +1,36 @@
+#!/usr/bin/python
+
+# reads a set of output files from surfclust
+# and copies the line containing the largest
+# cluster (most nodes) and writes all of
+# those lines to a new file.
+# if the output file contains no data, a
+# 0 is entered
+
+### no user parameters need be entered
+
+import commands
+import os
+import sys
+from stat import *
+
+file_list = commands.getoutput("ls *_Thresh9_ClstTable_r2.8_a2.0.1D")
+
+fl = file_list.split('\n')
+
+
+filename = "permClst_distributionThresh9.txt"
+perm_clust_out = open("permClst_distributionThresh9.txt", "w")
+
+for f in fl:
+ sz = os.stat(f)[ST_SIZE]
+ if sz == 0:
+ perm_clust_out.write('0\n')
+ else:
+ clst_file = open(f, "r")
+ ln_16 = clst_file.readlines()[16]
+ perm_clust_out.write(ln_16)
+ clst_file.close()
+
+perm_clust_out.close()
+commands.getoutput("sort -r -g -k 2 "+filename+" > srtdPerm_DistributionThresh9.txt")
Added: SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/untar.py
===================================================================
--- SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/untar.py (rev 0)
+++ SwiftApps/SIDGrid/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/untar.py 2009-08-08 16:05:37 UTC (rev 3082)
@@ -0,0 +1,12 @@
+#!/usr/bin/python
+
+import commands
+import time
+import os
+import sys
+
+
+os.chdir(os.getenv("cnari")+"/swift/projects/andric/ccf_emblem/NonParametric_lag_analy/NewPermutations/")
+print os.getcwd()
+print commands.getoutput("ls *PermFriedman*.tar | wc")
+print commands.getoutput("find -name '*PermFriedman*.tar' -exec tar xvf '{}' ';'")
More information about the Swift-commit
mailing list