Skip to content

Commit

Permalink
fix primer region bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Tao Zhu committed Aug 6, 2019
1 parent 96a8707 commit 0de767f
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 312 deletions.
3 changes: 3 additions & 0 deletions primerserver2/core/design_primer.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def single(site):
'SEQUENCE_TEMPLATE': template,
type: [pos,length]
})
p3['SEQUENCE_RELATIVE_TARGET_START'] = pos
return([{'id': id, 'primers': p3}])
if type=='FORCE_END':
p3_settings['PRIMER_MIN_LEFT_THREE_PRIME_DISTANCE'] = -1
Expand All @@ -49,6 +50,7 @@ def single(site):
'SEQUENCE_TEMPLATE': template,
'SEQUENCE_FORCE_LEFT_END': pos
})
p3_L['SEQUENCE_RELATIVE_TARGET_START'] = pos

p3_settings['PRIMER_MIN_LEFT_THREE_PRIME_DISTANCE'] = 3
p3_settings['PRIMER_MIN_RIGHT_THREE_PRIME_DISTANCE'] = -1
Expand All @@ -59,6 +61,7 @@ def single(site):
'SEQUENCE_TEMPLATE': template,
'SEQUENCE_FORCE_RIGHT_END': pos
})
p3_R['SEQUENCE_RELATIVE_TARGET_START'] = pos

return([{'id': id+'-LEFT', 'primers': p3_L},
{'id': id+'-RIGHT', 'primers': p3_R}
Expand Down
1 change: 1 addition & 0 deletions primerserver2/core/make_primers.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def make_primers(query):
primers[id][f'PRIMER_LEFT_{rank}_GC_PERCENT'] = calculate_GC(seq_F)
primers[id][f'PRIMER_RIGHT_{rank}_GC_PERCENT'] = calculate_GC(seq_R)
primers[id][f'PRIMER_PAIR_{rank}_PRODUCT_SIZE'] = -1
primers[id]['SEQUENCE_RELATIVE_TARGET_START'] = 0

return primers

Expand Down
8 changes: 4 additions & 4 deletions primerserver2/data/p3_settings.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"PRIMER_EXPLAIN_FLAG": 1,
"PRIMER_NUM_RETURN": 30,
"PRIMER_MIN_SIZE": 18,
"PRIMER_MIN_SIZE": 14,
"PRIMER_OPT_SIZE": 20,
"PRIMER_MAX_SIZE": 23,
"PRIMER_MAX_SIZE": 28,
"PRIMER_MIN_TM": 57.0,
"PRIMER_OPT_TM": 60.0,
"PRIMER_MAX_TM": 63.0,
"PRIMER_PAIR_MAX_DIFF_TM": 3.0,
"PRIMER_MIN_GC": 35.0,
"PRIMER_MIN_GC": 20.0,
"PRIMER_OPT_GC_PERCENT": 50.0,
"PRIMER_MAX_GC": 65.0,
"PRIMER_MAX_GC": 80.0,
"PRIMER_MAX_END_STABILITY": 9.0,
"PRIMER_MIN_LEFT_THREE_PRIME_DISTANCE": 3,
"PRIMER_MIN_RIGHT_THREE_PRIME_DISTANCE": 3,
Expand Down
5 changes: 4 additions & 1 deletion primerserver2/web/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ def progress():
bp = Blueprint('run', __name__)
@bp.route('/run', methods=['POST'])
def run():
################### init #############################
global_var.init()

################### Design primers ###################
query_string = request.form['query']
dbs = [db_dir+'/'+x for x in request.form['selected_dbs'].split(',')]
Expand All @@ -49,7 +52,6 @@ def run():

################### Checking specificity #############
if request.form['app-type']!='design':
global_var.init()
primers = run_blast.run_blast_parallel(primers=primers, dbs=dbs, cpu=web_config['cpu'],\
checking_size_max=int(request.form['checking_size_max']), checking_size_min=int(request.form['checking_size_min']), \
report_amplicon_seq=bool(int(request.form['report_amplicon_seqs'])), Tm_diff=int(request.form['Tm_diff']), \
Expand All @@ -60,4 +62,5 @@ def run():

@bp.route('/monitor')
def monitor():
time.sleep(1)
return Response(progress(), mimetype= 'text/event-stream')
1 change: 0 additions & 1 deletion primerserver2/web/static/css/bootstrap-table.min.css

This file was deleted.

8 changes: 0 additions & 8 deletions primerserver2/web/static/js/bootstrap-table.min.js

This file was deleted.

6 changes: 4 additions & 2 deletions primerserver2/web/static/js/generate_html_result.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function generate_html_result(selected_dbs, db_name_change, data){
$('#primers-result').append($('#primers-result-template-site').html());
$('#primers-result-template-site').html(raw_html_site);

var retrieve_start = site_pos - result_data[site_id]['SEQUENCE_RELATIVE_TARGET_START']

// primer
for (var i=0; i<primer_num; i++) {
var raw_html_primer = $('#primers-result-template-primer').html();
Expand All @@ -65,7 +67,7 @@ function generate_html_result(selected_dbs, db_name_change, data){
.html('Primer '+primer_rank);

var p_start = result_data[site_id]['PRIMER_LEFT_'+raw_rank][0]+1;
p_start = p_start==0 ? '' : p_start;
p_start = p_start==0 ? '' : p_start+retrieve_start;
var p_len = result_data[site_id]['PRIMER_LEFT_'+raw_rank][1];
var p_end = p_start=='' ? '' : p_start+p_len-1;
$('#primers-result-template-primer .primer-seq-detail')
Expand All @@ -78,7 +80,7 @@ function generate_html_result(selected_dbs, db_name_change, data){
+'</tr>')

p_start = result_data[site_id]['PRIMER_RIGHT_'+raw_rank][0]+1;
p_start = p_start==0 ? '' : p_start;
p_start = p_start==0 ? '' : p_start+retrieve_start;
p_len = result_data[site_id]['PRIMER_RIGHT_'+raw_rank][1];
p_end = p_start=='' ? '' : p_start+p_len-1;
$('#primers-result-template-primer .primer-seq-detail')
Expand Down
277 changes: 0 additions & 277 deletions primerserver2/web/static/js/jquery.timer.js

This file was deleted.

Loading

0 comments on commit 0de767f

Please sign in to comment.