diff options
author | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-31 16:31:15 -0400 |
---|---|---|
committer | Calvin Morrison <mutantturkey@gmail.com> | 2014-03-31 16:31:15 -0400 |
commit | 38bb1f3a1303e2f73ff1c939bf63b5108182b440 (patch) | |
tree | b16e222d943fa96d6e8e22964974d6a34a02730a | |
parent | 48e071c3c4bdb8d9d9227ef05030b9af4395f437 (diff) |
add UI for scorign func, update doc and varaibles
-rw-r--r-- | README.md | 4 | ||||
-rwxr-xr-x | SelectiveGenomeAmplificationUI | 3 | ||||
-rwxr-xr-x | src/score_mers.py | 3 |
3 files changed, 6 insertions, 4 deletions
@@ -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") |