primerJinn 1.0.4.dev0__tar.gz → 1.0.7.dev2__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.
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/PKG-INFO +2 -2
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/README.md +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn/PCRinSilico.py +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn/__init__.py +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn/getMultiPrimerSet.py +27 -21
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn/primerJinn.py +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/PKG-INFO +2 -2
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/requires.txt +1 -1
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/setup.py +7 -6
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/SOURCES.txt +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/dependency_links.txt +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/entry_points.txt +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/primerJinn.egg-info/top_level.txt +0 -0
- {primerJinn-1.0.4.dev0 → primerjinn-1.0.7.dev2}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: primerJinn
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7.dev2
|
|
4
4
|
Summary: In silico PCR tool
|
|
5
5
|
Home-page: https://github.com/SemiQuant/primerJinn
|
|
6
6
|
Author: Jason D Limberis
|
|
@@ -15,7 +15,7 @@ Requires-Dist: scipy
|
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: biopython
|
|
17
17
|
Requires-Dist: numpy
|
|
18
|
-
Requires-Dist: primer3-py
|
|
18
|
+
Requires-Dist: primer3-py==2.0.3
|
|
19
19
|
Requires-Dist: networkx
|
|
20
20
|
Requires-Dist: scikit-learn
|
|
21
21
|
Requires-Dist: requests
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -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')
|
|
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):
|
|
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):
|
|
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,20 +89,21 @@ 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
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
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:
|
|
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
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
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:
|
|
106
107
|
with open(background, "a") as fasta_file:
|
|
107
108
|
fasta_file.write(">appended_sequence\n")
|
|
108
109
|
fasta_file.write(str(input_file.seq[region_end+10000:]) + "\n")
|
|
@@ -137,6 +138,9 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
|
|
|
137
138
|
'PRIMER_PRODUCT_SIZE_RANGE': product_size_range,
|
|
138
139
|
'PRIMER_INTERNAL_MAX_POLY_X':poly,
|
|
139
140
|
}
|
|
141
|
+
|
|
142
|
+
if no_self_background:
|
|
143
|
+
del input_params['PRIMER_MISPRIMING_LIBRARY']
|
|
140
144
|
|
|
141
145
|
if Q5:
|
|
142
146
|
global_args.update({
|
|
@@ -151,18 +155,19 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
|
|
|
151
155
|
global_args.update({'PRIMER_GC_CLAMP': clamp,})
|
|
152
156
|
|
|
153
157
|
# Run primer3 to design the primers.
|
|
154
|
-
primers = primer3.bindings.
|
|
158
|
+
primers = primer3.bindings.design_primers(input_params, global_args)
|
|
155
159
|
no_miss = False
|
|
156
160
|
if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
|
|
157
161
|
print("No primers found for: " + name + "; trying with relaxed restraints.")
|
|
158
162
|
del global_args['PRIMER_INTERNAL_MAX_POLY_X']
|
|
159
163
|
global_args.update({'PRIMER_PICK_ANYWAY': 1,})
|
|
160
|
-
primers = primer3.bindings.
|
|
164
|
+
primers = primer3.bindings.design_primers(input_params, global_args)
|
|
161
165
|
if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
|
|
162
|
-
|
|
166
|
+
if not no_self_background:
|
|
167
|
+
del input_params['PRIMER_MISPRIMING_LIBRARY']
|
|
163
168
|
global_args.update({'PRIMER_MIN_TM': target_tm - wiggle * 1.5,})
|
|
164
169
|
global_args.update({'PRIMER_MAX_TM': target_tm + wiggle * 1.5,})
|
|
165
|
-
primers = primer3.bindings.
|
|
170
|
+
primers = primer3.bindings.design_primers(input_params, global_args)
|
|
166
171
|
no_miss = True
|
|
167
172
|
if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
|
|
168
173
|
global_args.update({'PRIMER_MIN_TM': target_tm - wiggle * 5,})
|
|
@@ -171,7 +176,7 @@ def design_primers(input_file, region_start, region_end, target_tm=args.target_t
|
|
|
171
176
|
global_args.update({'PRIMER_PRODUCT_SIZE_RANGE': product_size_range_tmp,})
|
|
172
177
|
global_args.update({'PRIMER_MIN_SIZE': 5,})
|
|
173
178
|
global_args.update({'PRIMER_MAX_SIZE': 36,})
|
|
174
|
-
primers = primer3.bindings.
|
|
179
|
+
primers = primer3.bindings.design_primers(input_params, global_args)
|
|
175
180
|
try:
|
|
176
181
|
# Check if any primer pairs were returned.
|
|
177
182
|
if 'PRIMER_PAIR_NUM_RETURNED' not in primers or primers['PRIMER_PAIR_NUM_RETURNED'] == 0:
|
|
@@ -233,9 +238,9 @@ def evaluate_combination(comb, Q5=args.Q5):
|
|
|
233
238
|
heterodimer_scores = []
|
|
234
239
|
for p in primer_pairs_sequences:
|
|
235
240
|
if Q5:
|
|
236
|
-
heterodimer_scores.append(primer3.
|
|
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
|
|
237
242
|
else:
|
|
238
|
-
heterodimer_scores.append(primer3.
|
|
243
|
+
heterodimer_scores.append(primer3.calc_heterodimer(p[0], p[1], temp_c=args.target_tm).dg) #gibbs free energy
|
|
239
244
|
product_size_weight=0.2
|
|
240
245
|
heterodimer_score_weight =0.8
|
|
241
246
|
score = {'size': product_size_range,
|
|
@@ -254,14 +259,14 @@ def get_features(primer, target_tm=args.target_tm):
|
|
|
254
259
|
avg_tm = (fwd_tm + rev_tm) / 2
|
|
255
260
|
product_size = primer['Product Size']
|
|
256
261
|
tm_difference = abs(fwd_tm - rev_tm)
|
|
257
|
-
dimer_prob = primer3.
|
|
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
|
|
258
263
|
return (avg_tm, product_size, tm_difference, dimer_prob)
|
|
259
264
|
|
|
260
265
|
|
|
261
266
|
def cluster_primers(primers, target_tm=args.target_tm, distance_threshold=10):
|
|
262
267
|
# Cluster the primers based on their features
|
|
263
268
|
X = [get_features(primer) for primer in primers]
|
|
264
|
-
clusterer = AgglomerativeClustering(n_clusters=None,
|
|
269
|
+
clusterer = AgglomerativeClustering(n_clusters=None, metric='euclidean', linkage='ward', distance_threshold=distance_threshold)
|
|
265
270
|
clusters = clusterer.fit_predict(X)
|
|
266
271
|
|
|
267
272
|
# Select the largest cluster
|
|
@@ -475,7 +480,8 @@ def main():
|
|
|
475
480
|
name=name,
|
|
476
481
|
ret=args.ret,
|
|
477
482
|
Q5=args.Q5,
|
|
478
|
-
background=tmp_back
|
|
483
|
+
background=tmp_back,
|
|
484
|
+
no_self_background=args.no_self_background
|
|
479
485
|
)
|
|
480
486
|
|
|
481
487
|
if primer_tmp is not None and len(primer_tmp) > 0:
|
|
File without changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: primerJinn
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.7.dev2
|
|
4
4
|
Summary: In silico PCR tool
|
|
5
5
|
Home-page: https://github.com/SemiQuant/primerJinn
|
|
6
6
|
Author: Jason D Limberis
|
|
@@ -15,7 +15,7 @@ Requires-Dist: scipy
|
|
|
15
15
|
Requires-Dist: pandas
|
|
16
16
|
Requires-Dist: biopython
|
|
17
17
|
Requires-Dist: numpy
|
|
18
|
-
Requires-Dist: primer3-py
|
|
18
|
+
Requires-Dist: primer3-py==2.0.3
|
|
19
19
|
Requires-Dist: networkx
|
|
20
20
|
Requires-Dist: scikit-learn
|
|
21
21
|
Requires-Dist: requests
|
|
@@ -12,7 +12,7 @@ dependencies = [
|
|
|
12
12
|
'pandas',
|
|
13
13
|
'biopython',
|
|
14
14
|
'numpy',
|
|
15
|
-
'primer3-py',
|
|
15
|
+
'primer3-py==2.0.3',
|
|
16
16
|
'networkx',
|
|
17
17
|
'scikit-learn',
|
|
18
18
|
'requests',
|
|
@@ -22,10 +22,11 @@ dependencies = [
|
|
|
22
22
|
class CustomInstallCommand(install):
|
|
23
23
|
def run(self):
|
|
24
24
|
install.run(self)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
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")
|
|
29
30
|
# os.system("export PATH=$PATH:%s" % os.path.abspath("$(pwd)/ncbi-blast-2.14.0+/bin"))
|
|
30
31
|
# - this command has no effect
|
|
31
32
|
# (the 'export' lasts only until system() returned)
|
|
@@ -36,7 +37,7 @@ class CustomInstallCommand(install):
|
|
|
36
37
|
|
|
37
38
|
setup(
|
|
38
39
|
name='primerJinn',
|
|
39
|
-
version='1.0.
|
|
40
|
+
version='1.0.7dev2',
|
|
40
41
|
url='https://github.com/SemiQuant/primerJinn',
|
|
41
42
|
install_requires=dependencies,
|
|
42
43
|
description='In silico PCR tool',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|