aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCalvin Morrison <mutantturkey@gmail.com>2014-08-05 15:30:59 -0400
committerCalvin Morrison <mutantturkey@gmail.com>2014-08-05 15:30:59 -0400
commit972add88040cac2f0a969e99c533051be7220ccc (patch)
tree61fdc7302b143f780166b0914bd84dffb4b0fe91
parent765a73ed7bb055d11aea2627af8daa9cfc6d664b (diff)
bg ratio
-rw-r--r--README.md1
-rwxr-xr-xSelectiveWholeGenomeAmplification5
-rwxr-xr-xSelectiveWholeGenomeAmplificationUI4
-rwxr-xr-xsrc/score_mers.py6
4 files changed, 13 insertions, 3 deletions
diff --git a/README.md b/README.md
index 0dbe2b5..b18b21a 100644
--- a/README.md
+++ b/README.md
@@ -164,6 +164,7 @@ max\_mer\_distance | 5000 | maximum distance between mers in foreground
min\_melting\_temp | 0° | minimum melting temp of mers
max\_melting\_temp | 30° | maximum melting temp of mers
min\_foreground\_binding\_average | 50000 | eliminate mers that appear less frequently than the average (length of foreground / # of occurrances)
+min\_bg\_ratio | Not Enabled | eliminate mers where the background ration is less than the minimum
ignore\_mers | Not Enabled | mers to explicitly ignore, space separated ex. ignore\_mers="ACAGTA ACCATAA ATATATAT"
ignore\_all\_mers\_from\_files | Not Enabled | ignore any mers found in these files. space separated.
output\_directory | $foreground\_$background/ | ex. if fg is Bacillus.fasta and bg is HumanGenome.fasta then folder would be $PWD/Bacillus.fasta\_HumanGenome\_output.fasta/
diff --git a/SelectiveWholeGenomeAmplification b/SelectiveWholeGenomeAmplification
index 23b14bc..7a3d46b 100755
--- a/SelectiveWholeGenomeAmplification
+++ b/SelectiveWholeGenomeAmplification
@@ -179,6 +179,9 @@ done
# sort score by the minimum or maximum value. acceptable parameters are min or max.
: ${sort_by="min"}
+# bg_ratio
+: ${min_bg_ratio=0}
+
export ignore_mers
export min_mer_range
export max_mer_range
@@ -194,8 +197,6 @@ export min_melting_temp
export fg_weight
export primer_weight
-
-echo
# check foreground and background
if [[ ! -f "$foreground" ]]; then
echo "Error: could not open foreground: $foreground"
diff --git a/SelectiveWholeGenomeAmplificationUI b/SelectiveWholeGenomeAmplificationUI
index b6514a9..5eb0049 100755
--- a/SelectiveWholeGenomeAmplificationUI
+++ b/SelectiveWholeGenomeAmplificationUI
@@ -53,6 +53,10 @@ questions = [
'def': "5000 bases",
'v': 'max_mer_distance' },
+ { 'q': 'minimum background ratio?',
+ 'def': "None",
+ 'v': 'min_bg_ratio' },
+
{ 'q': 'maximum melting temperature for mers?', 'def': '30c', 'v': 'max_melting_temp' },
{ 'q': 'minimum melting temperature for mers?', 'def': '0c', 'v': 'min_melting_temp' },
{ 'q': 'DNA Concentration (nM)?', 'def': '5000nM', 'v': 'dna_con' },
diff --git a/src/score_mers.py b/src/score_mers.py
index 7d265a3..65e7dc1 100755
--- a/src/score_mers.py
+++ b/src/score_mers.py
@@ -32,6 +32,7 @@ debug = os.environ.get("debug", False)
max_select = int(os.environ.get("max_select", 15))
max_check = int(os.environ.get("max_check", 35))
max_mer_distance = int(os.environ.get("max_mer_distance", 5000))
+min_bg_ratio = int(os.environ.get("min_bg_ratio", 0))
max_consecutive_binding = int(os.environ.get("max_consecutive_binding", 4))
primer_weight = float(os.environ.get("primer_weight", 0))
score_str = os.environ.get("score_func", None)
@@ -233,6 +234,7 @@ def print_rejected(total_reject, total_checked, total_scored, excluded):
print " max distance: " + percentage(excluded[0], total_reject) + " (" + str(excluded[0]) + ")"
print " mers overlap: " + percentage(excluded[1], total_reject) + " (" + str(excluded[1]) + ")"
print " heterodimers: " + percentage(excluded[2], total_reject) + " (" + str(excluded[2]) + ")"
+ print " min bg ratio: " + percentage(excluded[3], total_reject) + " (" + str(excluded[3]) + ")"
print ""
print " total combinations checked: ", total_checked
print " total combinations scored: ", total_scored
@@ -243,7 +245,7 @@ def score_specific_combinations(mers):
total_scored = 0
total_checked = 0
- excluded = [0, 0, 0]
+ excluded = [0, 0, 0, 0]
p = Pool(cpus)
@@ -352,6 +354,8 @@ def score(combination):
bg_ratio = (bg_genome_length / bg_counts)
+ if(bg_ratio < min_bg_ratio)
+ return 3
nb_primers = len(combination)
fg_mean_dist = np.mean(fg_dist)