File: accepthit.cpp

package info (click to toggle)
pilercr 1.06%2Bdfsg-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 844 kB
  • sloc: cpp: 14,339; makefile: 67; sh: 36
file content (30 lines) | stat: -rwxr-xr-x 747 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "pilercr.h"
#include <algorithm>

static bool LocalAcceptHit(const DPHit &Hit)
	{
	int Length = GetHitLength(Hit);
	if (Length < g_DraftMinRepeatLength || Length > g_DraftMaxRepeatLength)
		return false;

	//int StartSpace = std::min(Hit.aHi, Hit.bHi);
	//int EndSpace = std::max(Hit.aLo, Hit.bLo);
	//int Space = EndSpace - StartSpace + 1;
	//if (Space < g_DraftMinSpacerLength || Space > g_DraftMaxSpacerLength)
	//	return false;

	if (GlobalPosToContigIndex(Hit.aLo) != GlobalPosToContigIndex(Hit.bHi))
		return false;

	return true;
	}

bool AcceptHit(const DPHit &Hit)
	{
	bool Accepted = LocalAcceptHit(Hit);
	if (Accepted)
		++g_AcceptedHitCount;
	else
		++g_NotAcceptedHitCount;
	return Accepted;
	}