aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md4
-rwxr-xr-xSelectiveGenomeAmplificationUI3
-rwxr-xr-xsrc/score_mers.py3
3 files changed, 6 insertions, 4 deletions
diff --git a/README.md b/README.md
index 5cfce11..6ef2f2e 100644
--- a/README.md
+++ b/README.md
@@ -153,7 +153,7 @@ max\_consecutive\_binding | 4 | The maximum number of consecutive binding nucleo
fg\_weight | 0 | How much extra weight to give higher frequency mers in fg. see "equations" (between 0 and 1)
primer\_weight | 0 | How much extra weight to give to sets with a higher number of primers. (between 0 and 1)
output\_top\_nb | 10000 | How many scores do you want to output in your sorted output file?
-=======
+score\_func | Not Enabled | see the [custom scoring](#custom-scoring-function) section
## Equations
@@ -203,7 +203,7 @@ This is a security hole.
you can specify it like any other parameter like so:
# the default function
- scoring\_func="(nb_primers**primer_weight) * (fg_mean_dist * fg_std_dist) / bg_ratio" SelectiveGenomeAmplification....
+ score_func="(nb_primers**primer_weight) * (fg_mean_dist * fg_std_dist) / bg_ratio" SelectiveGenomeAmplification....
You need to use **valid** python code.
diff --git a/SelectiveGenomeAmplificationUI b/SelectiveGenomeAmplificationUI
index 297471b..4455a02 100755
--- a/SelectiveGenomeAmplificationUI
+++ b/SelectiveGenomeAmplificationUI
@@ -56,7 +56,8 @@ questions = [
{ 'question': 'maximum number of consecutively binding mers in hetero and homodimers?', 'default_str': '4', 'variable': 'max_consecutive_binding' },
{ 'question': 'what extra weight do you want for highgly binding primers? (0-1)', 'default_str': '0', 'variable': 'fg_weight' },
{ 'question': 'what extra weight do you want for sets with a higher number of primers? (0-1)', 'default_str': '0', 'variable': 'primer_weight'},
- { 'question': 'How many scored sets would you like in the top_scored_sets output file?', 'default_str':'10000', 'variable': 'output_top_nb'}
+ { 'question': 'how many scored sets would you like in the top_scored_sets output file?', 'default_str':'10000', 'variable': 'output_top_nb'},
+ { 'question': 'would you like to use a custom scoring function? see README.md for details', 'default_str':'', 'variable': 'score_func'}
]
def bool_ask(ask_string, default):
diff --git a/src/score_mers.py b/src/score_mers.py
index 1cb4bbb..267d7ff 100755
--- a/src/score_mers.py
+++ b/src/score_mers.py
@@ -198,8 +198,9 @@ def percentage(part, whole, precision=2):
def write_header(fh):
fh.write("# variables used: max_select=" + str(max_select) + " max_check=" + str(max_check) + " max_mer_distance=" + str(max_mer_distance) + " max_consecutive_binding=" + str(max_consecutive_binding) + " primer_weight=" + str(primer_weight) + "\n")
- fh.write("# scoring function:" + str(score_str) + "\n")
+ fh.write("# scoring function: " + str(score_str) + "\n")
fh.write("nb_primers\tCombination\tScore\tFG_mean_dist\tFG_stdev_dist\tBG_ratio\n")
+
def write_result(fh, score_res):
combination, score_val, fg_mean_dist, fg_stddev_dist, bg_ratio = score_res
fh.write(str(len(combination)) + "\t")