PyTFBS 1.0.13__tar.gz → 1.0.14__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyTFBS
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: PyTFBS: A Python Package for Transcription Factor Binding Site Prediction
5
5
  Author-email: Tinghua Huang <thua45@126.com>
6
6
  License-Expression: MIT
@@ -162,7 +162,7 @@ def read_rexp_file(file=None, data_dir=None):
162
162
  return df_rexps
163
163
 
164
164
  def read_PyTFBS_output(file):
165
- tf_tars = set()
165
+ tar_scores = {}
166
166
  for line in open(file):
167
167
  if line[0] == '#':
168
168
  continue
@@ -171,8 +171,13 @@ def read_PyTFBS_output(file):
171
171
  score = float(lblocks[3])
172
172
  jindex = float(lblocks[2])
173
173
  if score > 0.8 and jindex > 0.3:
174
- tf_tars.add(gene_name)
175
- return tf_tars
174
+ if gene_name in tar_scores:
175
+ if tar_scores[gene_name] < score:
176
+ tar_scores[gene_name] = score
177
+ else:
178
+ tar_scores[gene_name] = score
179
+ sorted_tars = sorted(tar_scores, key=tar_scores.get, reverse=True)
180
+ return sorted_tars[:8000]
176
181
 
177
182
  def get_rexp_files(species=None, data_dir=None):
178
183
  if data_dir == None:
@@ -210,5 +215,5 @@ if __name__ == '__main__':
210
215
  tar_exps = {idx: row.tolist() for idx, row in df_rexps_tars.iterrows()}
211
216
  rcis = rci(tar_exps, tf_exp)
212
217
  for rci in rcis:
213
- score = rci[1] + (random.uniform(1E-15, 1E-10) * random.choice([1, -1]))
218
+ score = rci[1] + (10 ** random.uniform(-15, -10) * random.choice([1, -1]))
214
219
  print(tf_cname[0] + '\t' + rci[0] + '\t' + str(score))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: PyTFBS
3
- Version: 1.0.13
3
+ Version: 1.0.14
4
4
  Summary: PyTFBS: A Python Package for Transcription Factor Binding Site Prediction
5
5
  Author-email: Tinghua Huang <thua45@126.com>
6
6
  License-Expression: MIT
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "PyTFBS"
7
- version = "1.0.13"
7
+ version = "1.0.14"
8
8
  license = "MIT" # SPDX expression
9
9
  description = "PyTFBS: A Python Package for Transcription Factor Binding Site Prediction"
10
10
  readme = "README.md"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes