reflexive 1.2.5__py3-none-any.whl → 1.2.7__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- reflexive/res.py +19 -5
- {reflexive-1.2.5.dist-info → reflexive-1.2.7.dist-info}/METADATA +1 -1
- {reflexive-1.2.5.dist-info → reflexive-1.2.7.dist-info}/RECORD +5 -5
- {reflexive-1.2.5.dist-info → reflexive-1.2.7.dist-info}/WHEEL +0 -0
- {reflexive-1.2.5.dist-info → reflexive-1.2.7.dist-info}/licenses/LICENSE +0 -0
reflexive/res.py
CHANGED
|
@@ -121,14 +121,28 @@ class Res_display:
|
|
|
121
121
|
#Get RE sequence
|
|
122
122
|
df = self._add_res_sequence(df)
|
|
123
123
|
df = self._add_res_interactions(df)
|
|
124
|
+
df = self._add_res_weights(df)
|
|
124
125
|
df = self._add_res_adj_matrix(df)
|
|
125
126
|
return df
|
|
126
127
|
|
|
127
|
-
def show_graph(self,df:DataFrame,inline=True) -> str:
|
|
128
|
+
def show_graph(self,df:DataFrame,scale=100,inline=True) -> str:
|
|
128
129
|
for am in df.res_adj_matrix:
|
|
129
|
-
|
|
130
|
+
if scale > 1:
|
|
131
|
+
sm = self._scale_adj_matrix(am,scale)
|
|
132
|
+
else:
|
|
133
|
+
sm = am
|
|
134
|
+
g = RES_graph(sm)
|
|
130
135
|
g.show()
|
|
131
|
-
return
|
|
136
|
+
return ""
|
|
137
|
+
|
|
138
|
+
def _scale_adj_matrix(self,adj_matrix,scale):
|
|
139
|
+
new_adj = []
|
|
140
|
+
for row in adj_matrix:
|
|
141
|
+
new_row = []
|
|
142
|
+
for c in row:
|
|
143
|
+
new_row.append(round(c*scale,1))
|
|
144
|
+
new_adj.append(new_row)
|
|
145
|
+
return new_adj
|
|
132
146
|
|
|
133
147
|
def _add_res_sequence(self,df):
|
|
134
148
|
temp_df = df.copy()
|
|
@@ -186,10 +200,10 @@ class Res_display:
|
|
|
186
200
|
return re_ints
|
|
187
201
|
|
|
188
202
|
def _calc_res_weights(self,interactions:dict[tuple,int])->dict[tuple,float]:
|
|
189
|
-
|
|
203
|
+
max_count = max(interactions.values())
|
|
190
204
|
weights = dict()
|
|
191
205
|
for edge,count in interactions.items():
|
|
192
|
-
weights[edge] = round(count/(15*
|
|
206
|
+
weights[edge] = round(count/(15*max_count),3)
|
|
193
207
|
return weights
|
|
194
208
|
|
|
195
209
|
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
reflexive/__init__.py,sha256=x5l8GV_9yC8yJyjTLqiM_WkfuPMLuNgQxF6PIz5MfFU,422
|
|
2
2
|
reflexive/analyse.py,sha256=CU6mQ8PxQrkOvuSe4mmnuI18jGMkuxql3zLZ1vEeMEY,17466
|
|
3
3
|
reflexive/cfg.py,sha256=tDPiC9NwpEVoT05_831sMsMfHhJt8pVrSOsgbtzTNDM,4267
|
|
4
|
-
reflexive/res.py,sha256=
|
|
4
|
+
reflexive/res.py,sha256=rMaXSf0xRrbER9HWqGviTuAKBeyxcv_j2wyTBUshFbQ,7833
|
|
5
5
|
reflexive/res_functions.py,sha256=YF45yUF8NYMSC19DFpE0lmV4xyNxv3QqbbzZmdwmFzg,1231
|
|
6
6
|
reflexive/session.py,sha256=8STWo8sqmWn-1PHcloFbgmLEvd7lsiFTU4t7ESRTsvw,10046
|
|
7
7
|
reflexive/util.py,sha256=uU7-lqUmiCiCaR85AdNFKXrdrBspjb1Rmd-yThA3fRU,3699
|
|
8
8
|
reflexive/visualise.py,sha256=pVnsPJOnHiLAIvDDm9P0u6-sGQINC4GVOY9b0GrzTK4,11725
|
|
9
|
-
reflexive-1.2.
|
|
10
|
-
reflexive-1.2.
|
|
11
|
-
reflexive-1.2.
|
|
12
|
-
reflexive-1.2.
|
|
9
|
+
reflexive-1.2.7.dist-info/METADATA,sha256=7NseRqUpaOJYKjJmg-UmseqANTCye8khCfYMkGDYWEE,574
|
|
10
|
+
reflexive-1.2.7.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
|
|
11
|
+
reflexive-1.2.7.dist-info/licenses/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
12
|
+
reflexive-1.2.7.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|