Skip to content

Commit

Permalink
fixed inconsistent whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
EVAN A. BOYLE committed Mar 3, 2014
1 parent ec0acf8 commit 871bdfe
Show file tree
Hide file tree
Showing 4 changed files with 409 additions and 409 deletions.
42 changes: 21 additions & 21 deletions MinusSVMipv4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,27 +4,27 @@
using namespace std;

string reverse_comp (string seq) {
string rev_comp;
for (int i = seq.length()-1; i >= 0; i--)
{
switch(seq[i])
{
case 'G':
rev_comp.append("C");
break;
case 'C':
rev_comp.append("G");
break;
case 'A':
rev_comp.append("T");
break;
case 'T':
rev_comp.append("A");
break;
default:
rev_comp.append(string(1, seq[i]));
}
}
string rev_comp;
for (int i = seq.length()-1; i >= 0; i--)
{
switch(seq[i])
{
case 'G':
rev_comp.append("C");
break;
case 'C':
rev_comp.append("G");
break;
case 'A':
rev_comp.append("T");
break;
case 'T':
rev_comp.append("A");
break;
default:
rev_comp.append(string(1, seq[i]));
}
}
return rev_comp;
}
MinusSVMipv4::MinusSVMipv4(string chromosome, int scan_start, int scan_stop, int ext_length, int lig_length):SVMipv4(chromosome, scan_start, scan_stop, ext_length, lig_length)
Expand Down
103 changes: 51 additions & 52 deletions SVMipv4.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,23 @@ double SVMipv4::count_ext_mer(string sub)
return count;
}
double SVMipv4::count_lig_mer(string sub)
{
double count = 0;
for (size_t offset = this->lig_probe_sequence.find(sub); offset != string::npos; offset = this->lig_probe_sequence.find(sub, offset + 1))
{
double count = 0;
for (size_t offset = this->lig_probe_sequence.find(sub); offset != string::npos; offset = this->lig_probe_sequence.find(sub, offset + 1))
{
count++;
}
return count;
count++;
}
return count;
}
double SVMipv4::count_insert_mer(string sub)
{
double count = 0;
for (size_t offset = this->scan_target_sequence.find(sub); offset != string::npos; offset = this->scan_target_sequence.find(sub, offset + 1))
{
double count = 0;
for (size_t offset = this->scan_target_sequence.find(sub); offset != string::npos; offset = this->scan_target_sequence.find(sub, offset + 1))
{
count++;
}
return count;
count++;
}
return count;
}


void SVMipv4::get_parameters(vector<double> & parameters, double long_range_content[])
Expand Down Expand Up @@ -119,39 +119,38 @@ double SVMipv4::get_score ()
double run_count = 0;
for (int i = 1; i< this->scan_size; i++)
{
string current_base = this->scan_target_sequence.substr(i, 1);

if (current_base == "G" || current_base == "C")
{
if (last_base == "G" || last_base == "C") {}
else
{
run_count++;
last_base = current_base;
}
}
else
{
if ("A" == last_base || "T" == last_base) {}
else {
run_count++;
last_base = current_base;
}
}
string current_base = this->scan_target_sequence.substr(i, 1);
if (current_base == "G" || current_base == "C")
{
if (last_base == "G" || last_base == "C") {}
else
{
run_count++;
last_base = current_base;
}
}
else
{
if ("A" == last_base || "T" == last_base) {}
else {
run_count++;
last_base = current_base;
}
}
}
run_count++;
double bases_per_switch = this->scan_size / run_count;
run_count++;
double bases_per_switch = this->scan_size / run_count;
double ext_g_count = (double) count(this->ext_probe_sequence.begin(), this->ext_probe_sequence.end(), 'G');
double lig_g_count = (double) count(this->lig_probe_sequence.begin(), this->lig_probe_sequence.end(), 'G');
double target_g_count = (double) count(this->scan_target_sequence.begin(), this->scan_target_sequence.end(), 'G');

double ext_gc_count = (double) count(this->ext_probe_sequence.begin(), this->ext_probe_sequence.end(), 'C') + ext_g_count;
double lig_gc_count = (double) count(this->lig_probe_sequence.begin(), this->lig_probe_sequence.end(), 'C') + lig_g_count;
double target_gc_count = (double) count(this->scan_target_sequence.begin(), this->scan_target_sequence.end(), 'C') + target_g_count;
double lig_gc_count = (double) count(this->lig_probe_sequence.begin(), this->lig_probe_sequence.end(), 'C') + lig_g_count;
double target_gc_count = (double) count(this->scan_target_sequence.begin(), this->scan_target_sequence.end(), 'C') + target_g_count;

double ext_a_count = (double) count(this->ext_probe_sequence.begin(), this->ext_probe_sequence.end(), 'A');
double lig_a_count = (double) count(this->lig_probe_sequence.begin(), this->lig_probe_sequence.end(), 'A');
double target_a_count = (double) count(this->scan_target_sequence.begin(), this->scan_target_sequence.end(), 'A');
double lig_a_count = (double) count(this->lig_probe_sequence.begin(), this->lig_probe_sequence.end(), 'A');
double target_a_count = (double) count(this->scan_target_sequence.begin(), this->scan_target_sequence.end(), 'A');

double ext_length = this->extension_arm_length;
double lig_length = this->ligation_arm_length;
Expand Down Expand Up @@ -249,20 +248,20 @@ double SVMipv4::get_score ()
};
void SVMipv4::set_junction_scores()
{
SVMipv4::junction_scores["AA"] = 0.0;
SVMipv4::junction_scores["AA"] = 0.0;
SVMipv4::junction_scores["AC"] = 0.35;
SVMipv4::junction_scores["AG"] = 0.046;
SVMipv4::junction_scores["AT"] = 0.079;
SVMipv4::junction_scores["CA"] = 0.34;
SVMipv4::junction_scores["CC"] = 0.22;
SVMipv4::junction_scores["CG"] = 0.55;
SVMipv4::junction_scores["CT"] = -0.071;
SVMipv4::junction_scores["GA"] = 0.35;
SVMipv4::junction_scores["GC"] = 0.92;
SVMipv4::junction_scores["GG"] = 0.24;
SVMipv4::junction_scores["GT"] = 0.48;
SVMipv4::junction_scores["TA"] = -0.46;
SVMipv4::junction_scores["TC"] = -0.35;
SVMipv4::junction_scores["TG"] = -0.25;
SVMipv4::junction_scores["TT"] = -0.98;
SVMipv4::junction_scores["AG"] = 0.046;
SVMipv4::junction_scores["AT"] = 0.079;
SVMipv4::junction_scores["CA"] = 0.34;
SVMipv4::junction_scores["CC"] = 0.22;
SVMipv4::junction_scores["CG"] = 0.55;
SVMipv4::junction_scores["CT"] = -0.071;
SVMipv4::junction_scores["GA"] = 0.35;
SVMipv4::junction_scores["GC"] = 0.92;
SVMipv4::junction_scores["GG"] = 0.24;
SVMipv4::junction_scores["GT"] = 0.48;
SVMipv4::junction_scores["TA"] = -0.46;
SVMipv4::junction_scores["TC"] = -0.35;
SVMipv4::junction_scores["TG"] = -0.25;
SVMipv4::junction_scores["TT"] = -0.98;
}
Binary file modified mipgen
Binary file not shown.
Loading

0 comments on commit 871bdfe

Please sign in to comment.