File: Read.cpp

package info (click to toggle)
snap-aligner 2.0.3%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 6,652 kB
  • sloc: cpp: 41,051; ansic: 5,239; python: 227; makefile: 85; sh: 28
file content (53 lines) | stat: -rw-r--r-- 1,083 bytes parent folder | download | duplicates (3)
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*++


Module Name:

    Read.cpp

Abstract:

   Read class for the SNAP sequencer

Authors:

    Bill Bolosky, May, 2012

Environment:

    User mode service.

Revision History:

--*/

#include "stdafx.h"
#include "Read.h"
#include "SAM.h"
#include "Error.h"

	bool
isAValidAlignmentResult(
	AlignmentResult result)
{
	return result == NotFound || result == SingleHit || result == MultipleHits || result == UnknownAlignment;
}

	void
Read::checkIdMatch(
	Read* read0,
	Read* read1)
{
    if (!readIdsMatch(read0, read1)) {
        unsigned n[2] = {min(read0->getIdLength(), 200u), min(read1->getIdLength(), 200u)};
        char* p[2] = {(char*) alloca((size_t)n[0] + 1), (char*) alloca((size_t)n[1] + 1)};
        memcpy(p[0], read0->getId(), n[0]); p[0][n[0]] = 0;
        memcpy(p[1], read1->getId(), n[1]); p[1][n[1]] = 0;
        WriteErrorMessage("Unmatched read IDs '%s' and '%s'.  Use the -I option to ignore this.\n", p[0], p[1]);
        soft_exit(1);
    }
}

    
const unsigned Read::localBufferLength = 3 * MAX_READ_LENGTH;
const unsigned DEFAULT_MIN_READ_LENGTH = 50;