File: entry_setters.cpp

package info (click to toggle)
vcftools 0.1.12%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,680 kB
  • ctags: 1,215
  • sloc: cpp: 12,118; perl: 10,973; ansic: 1,467; pascal: 1,064; makefile: 67; php: 57; sh: 12
file content (41 lines) | stat: -rw-r--r-- 660 bytes parent folder | download | duplicates (6)
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
/*
	entry_setters.cpp
 *
 *  Created on: Nov 11, 2009
 *      Author: Adam Auton
 *      ($Revision: 230 $)
 */

#include "entry.h"

void entry::add_ALT_allele(const string &in)
{
	if (in != ".")
	{
		if (find(ALT.begin(), ALT.end(),in) == ALT.end())
		{
			ALT.push_back(in);
		}
		else
		{
			LOG.warning(" Duplicate alternate alleles found at " + CHROM + ":" + LOG.int2str(POS));
			ALT.push_back(in);
		}
	}
	parsed_ALT = true;
}

void entry::set_indv_DEPTH(unsigned int indv, int in)
{
	parsed_DP[indv] = true;
	if (in == -1)
	{
		if (!DEPTH.empty())
			DEPTH[indv] = -1;
		return;
	}
	if (DEPTH.empty())
		DEPTH.resize(N_indv, -1);

	DEPTH[indv] = in;
}