Skip to content

Commit

Permalink
Remove parts of original cnF2freq output logic. #1
Browse files Browse the repository at this point in the history
  • Loading branch information
cnettel committed Apr 25, 2016
1 parent 3ca621e commit 1d8d21b
Showing 1 changed file with 4 additions and 33 deletions.
37 changes: 4 additions & 33 deletions cnF2freq.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2999,18 +2999,15 @@ template<bool full, typename reporterclass> void doit(FILE* out, bool printalot
}
}


for (unsigned int i = 0; i < chromstarts.size() - 1; i++)
{
//printf("Chromosome %d\n", i + 1);

// The output for all individuals in a specific iteration is stored, as we have parallelized the logic and
// want the output to be done in order.
vector<vector<char> > outqueue;

outqueue.resize(dous.size());


#pragma omp parallel for schedule(dynamic,1)
for (int j = 0; j < (int)dous.size(); j++)
{
Expand All @@ -3023,7 +3020,6 @@ template<bool full, typename reporterclass> void doit(FILE* out, bool printalot
threadblock tborig;
threadblock tb = tborig;


resizecaches();

if (dous[j]->markerdata.size())
Expand Down Expand Up @@ -3131,6 +3127,7 @@ template<bool full, typename reporterclass> void doit(FILE* out, bool printalot
bool anygood = false;
anygood |= dous[j]->pars[0] && !dous[j]->pars[0]->empty;
anygood |= dous[j]->pars[1] && !dous[j]->pars[1]->empty;

//if (!anygood) shiftend = 2;
if (!anygood)
{
Expand Down Expand Up @@ -3163,43 +3160,21 @@ template<bool full, typename reporterclass> void doit(FILE* out, bool printalot
}
factor -= log(1 << countf2i);

// This output can get ugly due to race conditions. One shouldn't rely on it.
printf("%d,%03d,%03d: %lf\t", dous[j]->n, flag2ignore, shiftignore, factor);
factor += log(realfactor);
printf("%lf %d\n", factor, shiftend);
fflush(stdout);
if (_isnan(factor) || factor < MINFACTORm) continue;

//fflush(stdout);
// Flushing can be useful for debugging, but not for performance!
// This output can get ugly due to race conditions. One shouldn't rely on it.

if (_isnan(factor)) continue;

char lineout[255];

/* // States are mapped onto values describing the line/strain origin, in the sense of 00, 01, 10 or 11 (old comment)
PerStateArray<int>::T maptogeno;
shiftflagmode = 0;
for (int g = 0; g < NUMTYPES; g++)
{
int sum = 0;
dous[j]->trackpossible<false, true>(tb, UnknownMarkerVal, 0
, 0, g * 2, 0, 0, trackpossibleparams(0, &sum));u
maptogeno[g] = sum;
printf("Maptogeno %d\n", sum);
}*/

// Walk over all chromosome positions, whether it be markers (negative q values <= -1000) or grid positions


// Walk over all chromosome positions, whether it be markers (negative q values <= -1000) or grid positions
for (int q = qstart; q != qend; q += qd)
{
reporterclass reporter;
//double mwvals[NUMTYPES][NUMTYPES] = {0};
//double mwfvals[NUMTYPES] = {0};
double mwvals[1][1];
double mwfvals[1];

double mwval[4] = { 0 };

for (int g = 0; g < NUMTYPES; g++)
Expand All @@ -3211,21 +3186,17 @@ template<bool full, typename reporterclass> void doit(FILE* out, bool printalot
if (q <= -1000 && false)
{
double val;

for (int g2 = 0; g2 < NUMTYPES; g2++)
{
val = dous[j]->doanalyze<noneturner>(tb, none, chromstarts[i], chromstarts[i + 1] - 1, twicestop(q, g, g2),
-1, true, 0, -5000.0 + factor) - factor;


val = exp(val);
mwvals[g][g2] += val;
if (q == -1010 && false)
{
printf("%d: %d -> %d: %lf\n", dous[j]->n, g, g2, val);
}
// fprintf(stderr, "%d:%d %d %d %lf\n", dous[j]->n, q, g, g2, val);

}

val = 0;
Expand Down

0 comments on commit 1d8d21b

Please sign in to comment.