primerJinn 1.0.7.dev1__tar.gz → 1.0.41.dev0__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.1
2
2
  Name: primerJinn
3
- Version: 1.0.7.dev1
3
+ Version: 1.0.41.dev0
4
4
  Summary: In silico PCR tool
5
5
  Home-page: https://github.com/SemiQuant/primerJinn
6
6
  Author: Jason D Limberis
@@ -15,9 +15,9 @@ Requires-Dist: scipy
15
15
  Requires-Dist: pandas
16
16
  Requires-Dist: biopython
17
17
  Requires-Dist: numpy
18
- Requires-Dist: primer3-py==2.0.3
18
+ Requires-Dist: primer3-py
19
19
  Requires-Dist: networkx
20
- Requires-Dist: scikit-learn==1.5.1
20
+ Requires-Dist: scikit-learn
21
21
  Requires-Dist: requests
22
22
  Requires-Dist: openpyxl
23
23
 
@@ -32,7 +32,7 @@ parser.add_argument('--product_size_max', type=int, help='The desired max size f
32
32
  parser.add_argument('--ret', type=int, help='The maximum number of primer pairs to return.', default=100)
33
33
  parser.add_argument('--Q5', action='store_true', help='Whether to use Q5 approximation settings for Tm calculations.', default=True)
34
34
  parser.add_argument('--background', type=str, help='The path to the mispriming library FASTA file.', default='')
35
- parser.add_argument('--no_self_background', action='store_true', help='If specified, primers are NOT checked for mispriming against the input genome as for large genomes this is very slow')
35
+ parser.add_argument('--no_self_background', action='store_true', help='If specified, primers are NOT checked for mispriming against the input genome as for large genomes this is very slow', default=False)
36
36
  parser.add_argument('--output', type=str, help='Output name.', default='MultiPlexPrimerSet')
37
37
  parser.add_argument('--eval', type=int, help='The maximum number of primer sets to evaluate.', default=10000)
38
38
  parser.add_argument('--wiggle', type=int, help='Half the region around the optimal Tm', default=3)
@@ -43,7 +43,7 @@ args = parser.parse_args()
43
43
 
44
44
  product_size_range = (args.product_size_min, args.product_size_max)
45
45
 
46
- def design_primers(input_file, region_start, region_end, target_tm=args.target_tm, primer_len=20, product_size_range=(400, 800), name='', ret=100, Q5=True, background='', wiggle=args.wiggle, clamp=args.clamp, poly=args.poly, no_self_background=False):
46
+ def design_primers(input_file, region_start, region_end, target_tm=args.target_tm, primer_len=20, product_size_range=(400, 800), name='', ret=100, Q5=True, background='', wiggle=args.wiggle, clamp=args.clamp, poly=args.poly, no_self_background=args.no_self_background, Q5=args.Q5):
47
47
  """
48
48
  This function takes a FASTA file, start and end positions of a target region, and desired melting temperature
49
49
  and primer length, and returns the best primer set for that region using Biopython and primer3.
@@ -89,21 +89,20 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
89
89
  with open(background, 'w') as file:
90
90
  file.writelines(new_lines)
91
91
 
92
- if region_start - 10000 > 0:
93
- target_seq = input_file.seq[region_start-10000:region_end+10000]
94
- seq_target = (10000-1, region_end-region_start)
95
- add_to = 10000
96
- if not no_self_background:
92
+ if not no_self_background:
93
+ if region_start - 10000 > 0:
94
+ target_seq = input_file.seq[region_start-10000:region_end+10000]
95
+ seq_target = (10000-1, region_end-region_start)
96
+ add_to = 10000
97
97
  with open(background, "a") as fasta_file:
98
98
  fasta_file.write(">appended_sequence\n")
99
99
  fasta_file.write(str(input_file.seq[0:region_start-10000]) + "\n")
100
100
  fasta_file.write(">appended_sequence2\n")
101
101
  fasta_file.write(str(input_file.seq[region_end+10000:]))
102
- else:
103
- target_seq = input_file.seq[0:region_end+10000]
104
- seq_target = (region_start-1, region_end-region_start)
105
- add_to = 0
106
- if not no_self_background:
102
+ else:
103
+ target_seq = input_file.seq[0:region_end+10000]
104
+ seq_target = (region_start-1, region_end-region_start)
105
+ add_to = 0
107
106
  with open(background, "a") as fasta_file:
108
107
  fasta_file.write(">appended_sequence\n")
109
108
  fasta_file.write(str(input_file.seq[region_end+10000:]) + "\n")
@@ -138,9 +137,6 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
138
137
  'PRIMER_PRODUCT_SIZE_RANGE': product_size_range,
139
138
  'PRIMER_INTERNAL_MAX_POLY_X':poly,
140
139
  }
141
-
142
- if no_self_background:
143
- del input_params['PRIMER_MISPRIMING_LIBRARY']
144
140
 
145
141
  if Q5:
146
142
  global_args.update({
@@ -155,19 +151,18 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
155
151
  global_args.update({'PRIMER_GC_CLAMP': clamp,})
156
152
 
157
153
  # Run primer3 to design the primers.
158
- primers = primer3.bindings.design_primers(input_params, global_args)
154
+ primers = primer3.bindings.designPrimers(input_params, global_args)
159
155
  no_miss = False
160
156
  if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
161
157
  print("No primers found for: " + name + "; trying with relaxed restraints.")
162
158
  del global_args['PRIMER_INTERNAL_MAX_POLY_X']
163
159
  global_args.update({'PRIMER_PICK_ANYWAY': 1,})
164
- primers = primer3.bindings.design_primers(input_params, global_args)
160
+ primers = primer3.bindings.designPrimers(input_params, global_args)
165
161
  if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
166
- if not no_self_background:
167
- del input_params['PRIMER_MISPRIMING_LIBRARY']
162
+ del input_params['PRIMER_MISPRIMING_LIBRARY']
168
163
  global_args.update({'PRIMER_MIN_TM': target_tm - wiggle * 1.5,})
169
164
  global_args.update({'PRIMER_MAX_TM': target_tm + wiggle * 1.5,})
170
- primers = primer3.bindings.design_primers(input_params, global_args)
165
+ primers = primer3.bindings.designPrimers(input_params, global_args)
171
166
  no_miss = True
172
167
  if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
173
168
  global_args.update({'PRIMER_MIN_TM': target_tm - wiggle * 5,})
@@ -176,7 +171,7 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
176
171
  global_args.update({'PRIMER_PRODUCT_SIZE_RANGE': product_size_range_tmp,})
177
172
  global_args.update({'PRIMER_MIN_SIZE': 5,})
178
173
  global_args.update({'PRIMER_MAX_SIZE': 36,})
179
- primers = primer3.bindings.design_primers(input_params, global_args)
174
+ primers = primer3.bindings.designPrimers(input_params, global_args)
180
175
  try:
181
176
  # Check if any primer pairs were returned.
182
177
  if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
@@ -238,9 +233,9 @@ def evaluate_combination(comb, Q5=args.Q5):
238
233
  heterodimer_scores = []
239
234
  for p in primer_pairs_sequences:
240
235
  if Q5:
241
- heterodimer_scores.append(primer3.calc_heterodimer(p[0], p[1], temp_c=args.target_tm, dv_conc = 2, mv_conc = 70, dna_conc = 3300).dg) #gibbs free energy
236
+ heterodimer_scores.append(primer3.calcHeterodimer(p[0], p[1], temp_c=args.target_tm, dv_conc = 2, mv_conc = 70, dna_conc = 3300).dg) #gibbs free energy
242
237
  else:
243
- heterodimer_scores.append(primer3.calc_heterodimer(p[0], p[1], temp_c=args.target_tm).dg) #gibbs free energy
238
+ heterodimer_scores.append(primer3.calcHeterodimer(p[0], p[1], temp_c=args.target_tm).dg) #gibbs free energy
244
239
  product_size_weight=0.2
245
240
  heterodimer_score_weight =0.8
246
241
  score = {'size': product_size_range,
@@ -259,14 +254,14 @@ def get_features(primer, target_tm=args.target_tm):
259
254
  avg_tm = (fwd_tm + rev_tm) / 2
260
255
  product_size = primer['Product Size']
261
256
  tm_difference = abs(fwd_tm - rev_tm)
262
- dimer_prob = primer3.calc_heterodimer(primer['Forward Primer'], primer['Reverse Primer'], temp_c=target_tm, dv_conc = 2, mv_conc = 70, dna_conc = 3300).dg
257
+ dimer_prob = primer3.calcHeterodimer(primer['Forward Primer'], primer['Reverse Primer'], temp_c=target_tm, dv_conc = 2, mv_conc = 70, dna_conc = 3300).dg
263
258
  return (avg_tm, product_size, tm_difference, dimer_prob)
264
259
 
265
260
 
266
261
  def cluster_primers(primers, target_tm=args.target_tm, distance_threshold=10):
267
262
  # Cluster the primers based on their features
268
263
  X = [get_features(primer) for primer in primers]
269
- clusterer = AgglomerativeClustering(n_clusters=None, metric='euclidean', linkage='ward', distance_threshold=distance_threshold)
264
+ clusterer = AgglomerativeClustering(n_clusters=None, affinity='euclidean', linkage='ward', distance_threshold=distance_threshold)
270
265
  clusters = clusterer.fit_predict(X)
271
266
 
272
267
  # Select the largest cluster
@@ -480,8 +475,7 @@ def main():
480
475
  name=name,
481
476
  ret=args.ret,
482
477
  Q5=args.Q5,
483
- background=tmp_back,
484
- no_self_background=args.no_self_background
478
+ background=tmp_back
485
479
  )
486
480
 
487
481
  if primer_tmp is not None and len(primer_tmp) > 0:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: primerJinn
3
- Version: 1.0.7.dev1
3
+ Version: 1.0.41.dev0
4
4
  Summary: In silico PCR tool
5
5
  Home-page: https://github.com/SemiQuant/primerJinn
6
6
  Author: Jason D Limberis
@@ -15,9 +15,9 @@ Requires-Dist: scipy
15
15
  Requires-Dist: pandas
16
16
  Requires-Dist: biopython
17
17
  Requires-Dist: numpy
18
- Requires-Dist: primer3-py==2.0.3
18
+ Requires-Dist: primer3-py
19
19
  Requires-Dist: networkx
20
- Requires-Dist: scikit-learn==1.5.1
20
+ Requires-Dist: scikit-learn
21
21
  Requires-Dist: requests
22
22
  Requires-Dist: openpyxl
23
23
 
@@ -2,8 +2,8 @@ scipy
2
2
  pandas
3
3
  biopython
4
4
  numpy
5
- primer3-py==2.0.3
5
+ primer3-py
6
6
  networkx
7
- scikit-learn==1.5.1
7
+ scikit-learn
8
8
  requests
9
9
  openpyxl
@@ -12,9 +12,9 @@ dependencies = [
12
12
  'pandas',
13
13
  'biopython',
14
14
  'numpy',
15
- 'primer3-py==2.0.3',
15
+ 'primer3-py',
16
16
  'networkx',
17
- 'scikit-learn==1.5.1',
17
+ 'scikit-learn',
18
18
  'requests',
19
19
  'openpyxl'
20
20
  ]
@@ -22,11 +22,10 @@ dependencies = [
22
22
  class CustomInstallCommand(install):
23
23
  def run(self):
24
24
  install.run(self)
25
- if not os.path.exists("ncbi-blast-2.14.0+"):
26
- r=os.system("wget https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.14.0/ncbi-blast-2.14.0+-x64-linux.tar.gz")
27
- if r: raise Exception("wget failed")
28
- r=os.system("tar -xzvf ncbi-blast-2.14.0+-x64-linux.tar.gz")
29
- if r: raise Exception("tar failed")
25
+ r=os.system("wget https://ftp.ncbi.nlm.nih.gov/blast/executables/blast+/2.14.0/ncbi-blast-2.14.0+-x64-linux.tar.gz")
26
+ if r: raise Exception("wget failed")
27
+ r=os.system("tar -xzvf ncbi-blast-2.14.0+-x64-linux.tar.gz")
28
+ if r: raise Exception("tar failed")
30
29
  # os.system("export PATH=$PATH:%s" % os.path.abspath("$(pwd)/ncbi-blast-2.14.0+/bin"))
31
30
  # - this command has no effect
32
31
  # (the 'export' lasts only until system() returned)
@@ -37,7 +36,7 @@ class CustomInstallCommand(install):
37
36
 
38
37
  setup(
39
38
  name='primerJinn',
40
- version='1.0.7dev1',
39
+ version='1.0.41dev',
41
40
  url='https://github.com/SemiQuant/primerJinn',
42
41
  install_requires=dependencies,
43
42
  description='In silico PCR tool',