Showing
4 changed files
with
45 additions
and
22 deletions
.~lock.pertenencia.xlsx#
deleted
100644 → 0
1 | -,iarroyof,bisnaga,20.02.2018 21:25,file:///home/iarroyof/.config/libreoffice/4; | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
... | @@ -8,7 +8,6 @@ from numpy import log10 | ... | @@ -8,7 +8,6 @@ from numpy import log10 |
8 | def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): | 8 | def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): |
9 | dic_part = {} | 9 | dic_part = {} |
10 | with open(eigenvectors) as f: | 10 | with open(eigenvectors) as f: |
11 | - | ||
12 | eigenvector = [c for c in f.readlines() if c.startswith("(" + | 11 | eigenvector = [c for c in f.readlines() if c.startswith("(" + |
13 | str(group_anlized) + ",")][0] | 12 | str(group_anlized) + ",")][0] |
14 | x = eigenvector.split(" ")[1] | 13 | x = eigenvector.split(" ")[1] |
... | @@ -29,8 +28,6 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): | ... | @@ -29,8 +28,6 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): |
29 | fO.write("%f\t%f\t%s\t%s\t%s\n" % (abs(eigen['value']), eigen['value'], | 28 | fO.write("%f\t%f\t%s\t%s\t%s\n" % (abs(eigen['value']), eigen['value'], |
30 | tfs.split('\t')[0], tfs.split('\t')[1].strip(), | 29 | tfs.split('\t')[0], tfs.split('\t')[1].strip(), |
31 | eigenvector.strip())) | 30 | eigenvector.strip())) |
32 | - #print("The corresponding TFs: %s" % tfs.split('\t')[1]) | ||
33 | - #print("The corresponding eigenvector: %s" % eigenvector) | ||
34 | group = {} | 31 | group = {} |
35 | ss = tfs.split(",") | 32 | ss = tfs.split(",") |
36 | 33 | ||
... | @@ -40,7 +37,6 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): | ... | @@ -40,7 +37,6 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): |
40 | 37 | ||
41 | partition = [] | 38 | partition = [] |
42 | for i in reversed(range(2, rev)): | 39 | for i in reversed(range(2, rev)): |
43 | - #if i.endswith(".cls"): # You could also add "and i.startswith('f') | ||
44 | name = "gus_originales_" + str(i).zfill(3) + ".cls" | 40 | name = "gus_originales_" + str(i).zfill(3) + ".cls" |
45 | with open(gropus_dir + name, 'r') as f: | 41 | with open(gropus_dir + name, 'r') as f: |
46 | gropus = f.readlines() | 42 | gropus = f.readlines() |
... | @@ -53,9 +49,9 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): | ... | @@ -53,9 +49,9 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): |
53 | tf.partition("(")[-1].strip().strip(")"))] | 49 | tf.partition("(")[-1].strip().strip(")"))] |
54 | for tf in ss} | 50 | for tf in ss} |
55 | 51 | ||
56 | - if set((t for t in list(TFs.keys()))) <= set(TFss): # verify if TFs | 52 | + if set((t for t in list(TFs.keys()))) <= set(TFss): |
57 | - not_in = set(TFs.keys()) ^ set(list(TFss.keys())) # are in the | 53 | + not_in = set(TFs.keys()) ^ set(list(TFss.keys())) |
58 | - for k in list(TFs.keys()): # current cluster | 54 | + for k in list(TFs.keys()): |
59 | TFs[k] += TFss[k] | 55 | TFs[k] += TFss[k] |
60 | 56 | ||
61 | if not_in: | 57 | if not_in: |
... | @@ -73,14 +69,14 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): | ... | @@ -73,14 +69,14 @@ def analyze_pair(group_anlized, gropus_dir, rev, eigenvectors, fo): |
73 | 69 | ||
74 | 70 | ||
75 | def get_cmap(n, name='hsv'): | 71 | def get_cmap(n, name='hsv'): |
76 | - '''Returns a function that maps each index in 0, 1, ..., n-1 to a distinct | ||
77 | - RGB color; the keyword argument name must be a standard mpl colormap name.''' | ||
78 | return plt.cm.get_cmap(name, n) | 72 | return plt.cm.get_cmap(name, n) |
79 | 73 | ||
74 | + | ||
80 | rev = 120 | 75 | rev = 120 |
81 | -ff = "report_persistence.csv" | 76 | +ff = "report_persistence_.csv" |
82 | eigenvectors = "one-by-one/eigen_vectors/eigenBOs_120-eigens.txt" | 77 | eigenvectors = "one-by-one/eigen_vectors/eigenBOs_120-eigens.txt" |
83 | gropus_dir = "one-by-one/groups/" | 78 | gropus_dir = "one-by-one/groups/" |
79 | +marked = "Zur ZntR" | ||
84 | 80 | ||
85 | # Candidatos que inician con 2 o 3 TFs desde la particion de 120 grupos | 81 | # Candidatos que inician con 2 o 3 TFs desde la particion de 120 grupos |
86 | groups_analyzed = [97, 80, 74, 68, 63, 53, 52, 49, 47, 44, 43, 40, 39, 38, 37, | 82 | groups_analyzed = [97, 80, 74, 68, 63, 53, 52, 49, 47, 44, 43, 40, 39, 38, 37, |
... | @@ -88,7 +84,7 @@ groups_analyzed = [97, 80, 74, 68, 63, 53, 52, 49, 47, 44, 43, 40, 39, 38, 37, | ... | @@ -88,7 +84,7 @@ groups_analyzed = [97, 80, 74, 68, 63, 53, 52, 49, 47, 44, 43, 40, 39, 38, 37, |
88 | 13, 12, 9] | 84 | 13, 12, 9] |
89 | cmap = get_cmap(len(groups_analyzed)) | 85 | cmap = get_cmap(len(groups_analyzed)) |
90 | 86 | ||
91 | - | 87 | +# Write the header of the report |
92 | with open(ff, "w") as f: | 88 | with open(ff, "w") as f: |
93 | f.write("Singular value (abs)\tSingular value\tThe analized group\tThe corresponding TFs\tThe corresponding eigenvector\n") | 89 | f.write("Singular value (abs)\tSingular value\tThe analized group\tThe corresponding TFs\tThe corresponding eigenvector\n") |
94 | 90 | ||
... | @@ -103,24 +99,18 @@ fig = plt.figure() | ... | @@ -103,24 +99,18 @@ fig = plt.figure() |
103 | ax1 = fig.add_subplot(111) | 99 | ax1 = fig.add_subplot(111) |
104 | 100 | ||
105 | for i, p in enumerate(plots): | 101 | for i, p in enumerate(plots): |
106 | - if " ".join(p['tfs'][0]) == "Zur ZntR": | 102 | + if " ".join(p['tfs'][0]) == marked: |
107 | - width = 4 | 103 | + width = 6 |
108 | mark = "D" | 104 | mark = "D" |
109 | else: | 105 | else: |
110 | width = 2 | 106 | width = 2 |
111 | mark = "" | 107 | mark = "" |
112 | 108 | ||
113 | - ax1.plot(p['part'], log10(p['n_tfs']), c=cmap(i), linewidth=width, marker=mark, | 109 | + ax1.plot(p['part'], log10(p['n_tfs']), c=cmap(i), linewidth=width, |
114 | - label=" ".join(p['tfs'][0])) | 110 | + marker=mark, label=" ".join(p['tfs'][0])) |
115 | 111 | ||
116 | -#ax1.scatter(x[40:],y[40:], s=10, c='r', marker="o", label='second') | ||
117 | plt.legend(loc='upper right') | 112 | plt.legend(loc='upper right') |
118 | plt.title("TF pair persistence through partitions of model resolution") | 113 | plt.title("TF pair persistence through partitions of model resolution") |
119 | plt.xlabel("Partition") | 114 | plt.xlabel("Partition") |
120 | plt.ylabel("Number of TFs (log_10)") | 115 | plt.ylabel("Number of TFs (log_10)") |
121 | plt.show() | 116 | plt.show() |
122 | - | ||
123 | -#print(TFs.keys()) | ||
124 | -#print(TFss.keys()) | ||
125 | -#partition = zip(*partition) | ||
126 | -#print(partition) | ... | ... |
report_persistence_.csv
0 → 100644
1 | +Singular value (abs) Singular value The analized group The corresponding TFs The corresponding eigenvector | ||
2 | +0.273000 -0.273000 97 ArgR(0.374), PuuR(-0.39) (97, u'-0.273*"putrescine_ext" + -0.265*"glrr" + -0.247*"putrescine" + 0.247*"n2-succinylornithine" + -0.230*"alanine" + 0.216*"n2-succinylarginine" + 0.184*"arginine" + -0.161*"gaba" + 0.125*"2-acetamido-5-oxopentanoate" + -0.115*"tyrosine"') | ||
3 | +0.242000 0.242000 80 BaeR(0.339), MntR(0.406) (80, u'0.242*"mn(ii)" + 0.220*"mdtabcd-baesr_mrna" + 0.220*"mdtabcd-baesr" + 0.182*"mn(ii)_ext" + -0.175*"tartrate" + -0.155*"fe+2" + 0.133*"dps" + 0.133*"mntp" + 0.129*"mannitol-1-p" + 0.122*"marrab"') | ||
4 | +0.442000 -0.442000 74 BetI(0.395), YqhC(-0.56) (74, u'-0.442*"rcho" + -0.346*"alcohol" + 0.250*"arsenite" + 0.247*"rna" + -0.235*"hns" + 0.217*"betaine" + 0.203*"rpos" + 0.176*"choline" + 0.155*"aldehyde" + -0.141*"dna"') | ||
5 | +0.490000 0.490000 68 DinJ-YafQ(-0.49), SdiA(0.692) (68, u'0.490*"ftsq" + -0.337*"dinj-yafq" + 0.325*"ftsq-ftsb-ftsl" + 0.258*"gadw" + -0.225*"yafq-dinj" + -0.225*"dinj-yafq_mrna" + -0.189*"rna" + 0.151*"ftsz" + 0.151*"ftsa" + 0.148*"gadw_mrna"') | ||
6 | +0.297000 0.297000 63 DpiA(-0.34), UidR(0.453) (63, u'0.297*"uidabc" + 0.297*"uidabc_mrna" + 0.202*"hyacinthin" + -0.165*"exut" + -0.158*"ftsq" + -0.149*"tartrate" + -0.130*"ureidoglycolate" + -0.129*"rpos" + 0.128*"i-cit" + -0.123*"lyase"') | ||
7 | +0.226000 -0.226000 53 CueR(0.408), CusR(0.522) (53, u'-0.226*"fructose-6-p" + 0.177*"cu(i)" + 0.166*"cu(i)_ext" + 0.150*"carbonate" + 0.143*"silver" + -0.140*"alpha-d-mannose-6-p" + 0.132*"silver_ext" + 0.132*"trans-rxn-90" + 0.132*"cuscfba_mrna" + 0.132*"cuscfba"') | ||
8 | +0.216000 -0.216000 52 EnvY(0.408), NanR(0.398) (52, u'-0.216*"ribulose" + 0.214*"beta-neu5ac" + 0.199*"n-acetylneuraminate" + 0.147*"short-chain" + -0.147*"nickel" + 0.139*"alpha-neu5ac" + 0.124*"3-keto-l-gulonate" + -0.123*"fe+2" + 0.122*"alcohol" + -0.120*"lactate"') | ||
9 | +0.308000 0.308000 49 MetR(0.311), RbsR(0.586) (49, u'0.308*"aicar" + 0.282*"5\'-p-ribosylglycinamide" + 0.249*"faicar" + 0.181*"thf" + 0.181*"polyglutamate" + 0.174*"5-phosphoribosylamine" + 0.167*"glycine" + 0.131*"aidb" + 0.112*"lactate" + -0.111*"lactose"') | ||
10 | +0.343000 -0.343000 47 TorR(-0.39), TrpR(-0.57) (47, u'-0.343*"tryptophan" + -0.218*"indole" + -0.205*"flda" + -0.205*"serine" + 0.192*"fructose-6-p" + -0.166*"vitamin" + -0.142*"chorismate" + -0.131*"shikimate" + -0.131*"shikimate-5-p" + -0.122*"tryptophan_ext"') | ||
11 | +0.387000 0.387000 44 Ada(0.367), AidB(0.413) (44, u'0.387*"aidb" + 0.299*"carbonate" + -0.189*"marrab_mrna" + -0.189*"marrab" + 0.166*"co2" + -0.149*"hyfabcdefghijr-focb_mrna" + -0.149*"hyfabcdefghijr-focb" + 0.145*"aidb_mrna" + 0.124*"dna" + -0.115*"hydrogenase"') | ||
12 | +0.437000 -0.437000 43 ArsR(-0.36), NikR(-0.56), RcnR(-0.70) (43, u'-0.437*"ion" + -0.330*"cobalt" + -0.322*"nickel" + -0.250*"nickel_ext" + -0.225*"arsenite" + -0.180*"nikabcder_mrna" + -0.180*"nikabcder" + -0.159*"melibiose" + -0.150*"nikd-nike-nikb-nikc-nika" + -0.139*"ion_ext"') | ||
13 | +0.336000 0.336000 40 FhlA(0.723), HyfR(0.703) (40, u'0.336*"hyfabcdefghijr-focb_mrna" + 0.336*"hyfabcdefghijr-focb" + 0.322*"hydrogenase" + 0.261*"hydrogen" + 0.260*"electron" + 0.252*"hyfg-hyfi-hyfa-hyfb-hyfc-hyfd-hyfe-hyff-hyfh" + 0.252*"mvhmeth-rxn" + 0.181*"3" + 0.136*"aidb" + -0.134*"vitamin"') | ||
14 | +0.267000 -0.267000 39 BasR(-0.44), PutA(-0.53) (39, u'-0.267*"puta" + 0.233*"flda" + -0.229*"glutamate-semialdehyde" + -0.229*"5-carboxylate" + -0.229*"pyrroline" + -0.199*"thioredoxin" + -0.198*"proline" + -0.176*"qsebc_mrna" + -0.176*"qsebc" + -0.155*"fumarate"') | ||
15 | +0.361000 0.361000 38 AlsR(0.390), RhaR(0.500) (38, u'0.361*"fructose-6-p" + -0.265*"1,6-diphosphate" + -0.265*"tagatofuranose" + 0.262*"rhasr" + 0.262*"rhasr_mrna" + 0.220*"rhar" + 0.214*"rhamnose" + 0.196*"fumarate" + 0.172*"rhas" + -0.169*"tagaaldol-rxn"') | ||
16 | +0.277000 0.277000 37 MalT(0.398), MhpR(-0.31) (37, u'0.277*"amylose" + 0.211*"fmn" + -0.206*"acid" + 0.195*"flavin" + 0.177*"d-glucose" + 0.174*"1-phosphate" + -0.168*"2,3-dihydroxycinnamic" + -0.165*"carbonate" + 0.162*"maltohexaose" + 0.155*"fumarate"') | ||
17 | +0.316000 0.316000 36 Cbl(0.548), CysB(0.546) (36, u'0.316*"fmn" + 0.282*"flavin" + -0.274*"amylose" + 0.213*"sulfite" + 0.202*"mononucleotide" + 0.199*"sulfide" + -0.168*"thioredoxin" + -0.158*"d-glucose" + -0.149*"flda" + -0.146*"maltohexaose"') | ||
18 | +0.249000 -0.249000 34 HcaR(-0.35), HypT(0.409), MetJ(0.412) (34, u'-0.249*"oxygen" + 0.237*"methionine" + 0.221*"ketoglutarate" + -0.166*"2,3-dihydroxycinnamic" + 0.159*"acetyl-coa" + 0.155*"biodex" + -0.146*"2,3-dhp" + -0.139*"fmn" + -0.138*"gaba" + 0.136*"lysine"') | ||
19 | +0.436000 -0.436000 32 AllR(-0.77), CdaR(-0.58) (32, u'-0.436*"glycerate" + -0.435*"tartronate-s-ald" + -0.284*"ureidoglycolate" + -0.249*"glyoxylate" + -0.224*"allantoate" + -0.186*"5-kdg" + -0.164*"allantoin" + -0.164*"alls" + -0.127*"methionine" + -0.116*"2-p-d-glycerate"') | ||
20 | +0.262000 0.262000 31 AppY(0.558), YdeO(0.502) (31, u'0.262*"hyaabcdef_mrna" + 0.262*"hyaabcdef" + 0.217*"fructuronate" + 0.214*"appcbxa_mrna" + 0.214*"appcbxa" + 0.184*"uidabc_mrna" + 0.184*"uidabc" + 0.171*"flda" + 0.159*"uxur" + -0.155*"methionine"') | ||
21 | +0.331000 0.331000 30 ExuR(0.560), UxuR(0.695) (30, u'0.331*"fructuronate" + 0.280*"uidabc_mrna" + 0.280*"uidabc" + 0.241*"uxur" + 0.220*"mannonate" + -0.188*"hyaabcdef_mrna" + -0.188*"hyaabcdef" + 0.182*"uxuab_mrna" + 0.182*"uxuab" + -0.154*"appcbxa"') | ||
22 | +0.227000 0.227000 29 PepA(0.337), RutR(0.353) (29, u'0.227*"carbonate" + -0.221*"methionine" + -0.193*"oxygen" + -0.183*"succinate" + -0.174*"fumarate" + 0.151*"aminoacrylate" + 0.151*"glutamine" + -0.148*"hyaabcdef_mrna" + -0.148*"hyaabcdef" + -0.147*"aspartate"') | ||
23 | +0.385000 0.385000 27 CadC(0.619), GadE-RcsB(0.606) (27, u'0.385*"biodex" + 0.287*"lysine" + -0.255*"ketoglutarate" + 0.190*"1-_ext" + 0.179*"cadba_mrna" + 0.179*"cadba" + -0.170*"thioredoxin" + 0.160*"acid" + 0.149*"lysine_ext" + 0.142*"cadc"') | ||
24 | +0.349000 -0.349000 26 AgaR(-0.55), CreB(-0.40) (26, u'-0.349*"glyceraldehyde-p" + -0.304*"dhap" + -0.247*"1,6-diphosphate" + -0.247*"tagatofuranose" + 0.195*"phosphate" + -0.182*"fructose-6-p" + 0.176*"3-keto-l-gulonate" + 0.170*"ribulose-5-p" + -0.167*"tagaaldol-rxn" + -0.153*"sedoheptulose-7-p"') | ||
25 | +0.595000 -0.595000 24 YefM(-0.98), YefM-YoeB(-0.98) (24, u'-0.595*"yefm-yoeb" + -0.478*"yefm-yoeb_mrna" + -0.478*"yoeb-yefm" + -0.362*"yefm" + -0.239*"yoeb" + 0.000*"zinc" + 0.000*"zinc_ext" + 0.000*"zint" + 0.000*"poly-beta-1,6-n-acetyl-d-glucosamine" + 0.000*"acetyl-coa"') | ||
26 | +0.717000 -0.717000 23 ZntR(-0.94), Zur(-0.94) (23, u'-0.717*"zinc" + -0.614*"zinc_ext" + -0.146*"zint" + -0.117*"poly-beta-1,6-n-acetyl-d-glucosamine" + -0.073*"zint_mrna" + -0.066*"acetyl-coa" + -0.058*"n-deacetylated" + -0.058*"partially" + -0.055*"poly-beta-1,6-n-acetyl-d-glucosamine_ext" + -0.047*"coenzyme"') | ||
27 | +0.527000 0.527000 21 RelB(0.993), RelB-RelE(0.993) (21, u'0.527*"relbe-hokd_mrna" + 0.527*"relb-rele" + 0.527*"relbe-hokd" + 0.260*"relb" + 0.260*"rele" + 0.176*"hokd" + 0.000*"7,8-dihydrofolate" + 0.000*"yefm-yoeb" + -0.000*"poly-beta-1,6-n-acetyl-d-glucosamine" + 0.000*"yoeb-yefm"') | ||
28 | +0.408000 0.408000 20 NhaR(0.547), OmpR(0.564) (20, u'0.408*"poly-beta-1,6-n-acetyl-d-glucosamine" + 0.204*"n-deacetylated" + 0.204*"partially" + 0.191*"poly-beta-1,6-n-acetyl-d-glucosamine_ext" + 0.187*"7,8-dihydrofolate" + -0.171*"mazefg_mrna" + -0.171*"mazefg" + -0.157*"acetyl-coa" + -0.130*"biodex" + -0.128*"coenzyme"') | ||
29 | +0.616000 -0.616000 19 TdcA(-0.94), TdcR(-0.94) (19, u'-0.616*"tdcabcdefg" + -0.616*"tdcabcdefg_mrna" + -0.132*"tdca" + -0.130*"serine" + -0.112*"serine_ext" + -0.101*"dehydroalanine" + -0.088*"propanoyl-p" + -0.088*"tdce" + -0.088*"threonine_ext" + -0.088*"tdcd"') | ||
30 | +0.308000 -0.308000 18 AtoC(-0.32), PaaX(-0.30) (18, u'-0.308*"acetyl-coa" + 0.234*"acpp" + 0.181*"ketoglutarate" + -0.170*"tdcabcdefg_mrna" + -0.170*"tdcabcdefg" + 0.169*"trans" + -0.167*"coenzyme" + -0.129*"hyaabcdef_mrna" + -0.129*"hyaabcdef" + 0.127*"hexadecenoyl-[acp]"') | ||
31 | +0.482000 -0.482000 15 AlaS(-0.48), IscR(-0.75), OxyR(-0.69) (15, u'-0.482*"alanine" + -0.215*"desulfurase]" + -0.210*"persulfide" + -0.210*"[l-cysteine" + -0.210*"l-cysteine" + -0.199*"cysteines" + -0.167*"protein" + -0.159*"unsulfurated" + -0.159*"donor]" + -0.159*"[sulfur"') | ||
32 | +0.293000 0.293000 13 GalR(0.610), GalS(0.610), HU(0.443) (13, u'0.293*"udpg" + 0.269*"udp-galactose" + 0.244*"thioredoxin" + 0.241*"d-glucose" + 0.202*"1-phosphate" + -0.199*"oxygen" + 0.188*"galactose-1-p" + -0.179*"acetyl-coa" + 0.143*"alanine" + -0.141*"ketoglutarate"') | ||
33 | +0.356000 -0.356000 12 ArgP(-0.43), DnaA(-0.44), NrdR(-0.34) (12, u'-0.356*"thioredoxin" + 0.267*"udpg" + 0.245*"udp-galactose" + 0.236*"d-glucose" + -0.206*"flda" + 0.200*"1-phosphate" + 0.171*"galactose-1-p" + -0.170*"disulfide" + 0.162*"amylose" + 0.162*"acetyl-coa"') | ||
34 | +0.313000 -0.313000 9 RcsB-BglJ(-0.52), StpA(-0.53) (9, u'-0.313*"gluconate" + 0.298*"6-phosphate" + -0.265*"arbutin-6p" + -0.235*"salicin-6-p" + -0.207*"beta-d-glucose-6-p" + -0.202*"6-p" + -0.161*"xylulose-p" + -0.159*"bglg" + -0.159*"bglgfb" + -0.159*"bglgfb_mrna"') |
-
Please register or login to post a comment