public class NuclearFamilies
extends java.lang.Object
Class NuclearFamilies
stores parent-offspring relationships
in a list of samples. In particular, class NuclearFamilies
stores a list of the single individuals in the list of samples,
a list of the parent-offspring duos in the list of samples, and a list of
the parent-offspring trios in the list of samples. A single individual is
an individuals without a parent or offspring in the list of samples.
Instances of class NuclearFamilies
are immutable.
Constructor and Description |
---|
NuclearFamilies(Samples samples,
java.io.File pedFile)
Constructs a new
NuclearFamilies instance. |
Modifier and Type | Method and Description |
---|---|
int |
duoOffspring(int index)
Returns the sample index of the offspring of the specified
parent-offspring duo.
|
int |
duoParent(int index)
Returns the sample index of the parent of the specified
parent-offspring duo.
|
int |
father(int sample)
Returns the sample index of the father of the specified sample,
or returns
-1 if the father is unknown or is not present
in the list of samples. |
int |
mother(int sample)
Returns the sample index of the mother of the specified sample,
or returns
-1 if the mother is unknown or is not present
in the list of samples. |
int |
nDuos()
Returns the number of parent-offspring duos in the list of samples.
|
int |
nSamples()
Returns the number of samples.
|
int |
nSingles()
Returns the number of single individuals in the list of samples.
|
int |
nTrios()
Returns the number of parent-offspring trios in the list of samples.
|
Samples |
samples()
Returns the list of samples.
|
int |
single(int index)
Returns the sample index of the specified single individual.
|
java.lang.String |
toString()
Returns a string representation of
this . |
int |
trioFather(int index)
Returns the sample index of the father of the specified
parent-offspring trio.
|
int |
trioMother(int index)
Returns the sample index of the mother of the specified
parent-offspring trio.
|
int |
trioOffspring(int index)
Returns the sample index of the offspring of the specified
parent-offspring trio.
|
public NuclearFamilies(Samples samples, java.io.File pedFile)
NuclearFamilies
instance.samples
- the list of samples.pedFile
- a linkage-format pedigree file, or null
if no pedigree relationships are known. A pedigree file must have
at least 4 white-space delimited columns. The first column of the
pedigree file (family ID) is ignored. The second, third, and fourth
columns are the individual's ID, the individual's father's ID, and
the individual's mother's ID respectively.java.lang.IllegalArgumentException
- if a pedigree file is specified,
and if the file has a non-blank line with less than 4 white-space
delimited fieldsjava.lang.IllegalArgumentException
- if a pedigree file is specified,
and if the file has duplicate individual identifiers in the
second white-space delimited columnjava.lang.NullPointerException
- if samples == null
public Samples samples()
public int nSamples()
public int nSingles()
public int nDuos()
public int nTrios()
public int single(int index)
index
- the index of a single individualjava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nSingles()
public int duoParent(int index)
index
- the index of a parent-offspring duojava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nDuos()
public int duoOffspring(int index)
index
- the index of a parent-offspring duojava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nDuos()
public int trioFather(int index)
index
- the index of a parent-offspring triojava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nTrios()
public int trioMother(int index)
index
- the index of a parent-offspring triojava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nTrios()
public int trioOffspring(int index)
index
- the index of a parent-offspring triojava.lang.IndexOutOfBoundsException
- if
index < 0 || index >= this.nTrios()
public int father(int sample)
-1
if the father is unknown or is not present
in the list of samples.sample
- a sample index-1
if the father is unknown or is not present in
the list of samplesjava.lang.IndexOutOfBoundsException
- if
sample < 0 || sample >= this.nSamples()()
public int mother(int sample)
-1
if the mother is unknown or is not present
in the list of samples.sample
- a sample index-1
if the mother is unknown or is not present
in the list of samplesjava.lang.IndexOutOfBoundsException
- if
sample < 0 || sample >= this.nSamples()()
public java.lang.String toString()
this
. The exact details of
the representation are unspecified and subject to change.toString
in class java.lang.Object
this