aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md6
-rwxr-xr-xSelectiveGenomeAmplification8
-rwxr-xr-xSelectiveGenomeAmplificationUI4
-rwxr-xr-xsrc/score_mers.py5
4 files changed, 17 insertions, 6 deletions
diff --git a/README.md b/README.md
index a745b19..18334c9 100644
--- a/README.md
+++ b/README.md
@@ -48,7 +48,8 @@ ignore\_mers | Not Enabled | mers to explicitly ignore, space seperated ex. igno
foreground | Not Enabled | path of foreground file
background | Not Enabled | path of background file
max\_consecutive\_binding | 4 | The maxium number of consecutive binding nucleotides in homodimer and heterodimers
-fg\_weight | 0 | How much extra weight to give higher frequency mers in fg. see "equations"
+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 priemrs. (between 0 and 1)
## Equations
@@ -66,3 +67,6 @@ environmental variable if you wish to do so.
hit = abundance of primer X (ex. 'ATGTA') in background
(foreground hit / background hit) * (foreground hit ^ fg_weight)
+
+
+### Score function
diff --git a/SelectiveGenomeAmplification b/SelectiveGenomeAmplification
index b875fe0..ad8d4a5 100755
--- a/SelectiveGenomeAmplification
+++ b/SelectiveGenomeAmplification
@@ -56,9 +56,12 @@ fi
# maximum number of mers that are consecutively binding
: ${max_consecutive_binding=4}
-# fg_weight, now much to weight to give the higher bindnig primers
+# fg_weight, how much to weight to give the higher bindnig primers
: ${fg_weight=0}
+# primer_weight, how much weight to give to sets with a higher number of priemrs. (between 0 and 1)
+: ${primer_weight=0}
+
export ignore_mers
export min_mer_range
export max_mer_range
@@ -72,6 +75,7 @@ export max_melting_temp
export min_melting_temp
export fg_weight
+export primer_weight
# Make our output directory
@@ -131,7 +135,7 @@ if [ "$ignore_mers" ]; then
fi
echo "outputing current run parameters"
-for var in ignore_mers min_mer_range max_check cpus max_consecutive_binding max_mer_range max_select min_mer_count max_mer_distance max_melting_temp min_melting_temp foreground background; do
+for var in ignore_mers min_mer_range max_mer_range max_check cpus max_consecutive_binding max_select min_foreground_binding_average max_mer_distance min_melting_temp max_melting_temp foreground background; do
echo $var "${!var}" >> $output_directory/$current_run/parameters
done;
diff --git a/SelectiveGenomeAmplificationUI b/SelectiveGenomeAmplificationUI
index 47a488d..810d0ca 100755
--- a/SelectiveGenomeAmplificationUI
+++ b/SelectiveGenomeAmplificationUI
@@ -50,8 +50,8 @@ questions = [
{ 'question': 'maximum melting temperature for mers?', 'default_str': '30c', 'variable': 'max_melting_temp' },
{ 'question': 'minimum melting temperature for mers?', 'default_str': '0c', 'variable': 'min_melting_temp' },
{ 'question': 'maximum number of consecutively binding mers in hetero and homodimers?', 'default_str': '4', 'variable': 'max_consecutive_binding' },
- { 'question': 'what extra weight you want for highgly binding primers?', 'default_str': '0', 'variable': 'fg_weight' }
-
+ { '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'}
]
def bool_ask(ask_string, default):
diff --git a/src/score_mers.py b/src/score_mers.py
index 7b6da7a..07d2ff9 100755
--- a/src/score_mers.py
+++ b/src/score_mers.py
@@ -34,6 +34,9 @@ max_check = int(os.environ.get("max_check", 35))
max_mer_distance = int(os.environ.get("max_mer_distance", 5000))
max_consecutive_binding = int(os.environ.get("max_consecutive_binding", 4))
+
+primer_weight = float(os.environ.get("primer_weight", 0))
+
def get_max_consecutive_binding(mer1, mer2):
'''
Return the maximum number of consecutively binding mers
@@ -262,7 +265,7 @@ def score(combination):
fg_std_dist = np.std(fg_dist)
# this is our equation
- mer_score = (nb_primers * fg_mean_dist * fg_std_dist) / bg_ratio
+ mer_score = (nb_primers**primer_weight) * (fg_mean_dist * fg_std_dist) / bg_ratio
return [combination, mer_score, fg_mean_dist, fg_std_dist, bg_ratio]