public final class GenotypeBuilder
extends java.lang.Object
Constructor and Description |
---|
GenotypeBuilder()
Create a empty builder.
|
GenotypeBuilder(Genotype g)
Create a new builder starting with the values in Genotype g
|
GenotypeBuilder(java.lang.String sampleName)
Create a builder using sampleName.
|
GenotypeBuilder(java.lang.String sampleName,
java.util.List<Allele> alleles)
Make a builder using sampleName and alleles for starting values
|
Modifier and Type | Method and Description |
---|---|
GenotypeBuilder |
AD(int[] AD)
This genotype has this AD value
|
GenotypeBuilder |
alleles(java.util.List<Allele> alleles)
Set this genotype's alleles
|
GenotypeBuilder |
attribute(java.lang.String key,
java.lang.Object value)
This genotype has this attribute key / value pair.
|
GenotypeBuilder |
attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
This genotype has these attributes.
|
GenotypeBuilder |
copy(Genotype g)
Copy all of the values for this builder from Genotype g
|
static Genotype |
create(java.lang.String sampleName,
java.util.List<Allele> alleles) |
protected static Genotype |
create(java.lang.String sampleName,
java.util.List<Allele> alleles,
double[] gls) |
static Genotype |
create(java.lang.String sampleName,
java.util.List<Allele> alleles,
java.util.Map<java.lang.String,java.lang.Object> attributes) |
static Genotype |
createMissing(java.lang.String sampleName,
int ploidy)
Create a new Genotype object for a sample that's missing from the VC (i.e., in
the output header).
|
GenotypeBuilder |
DP(int DP)
This genotype has this DP value
|
GenotypeBuilder |
filter(java.lang.String filter)
Most efficient version of setting filters -- just set the filters string to filters
|
GenotypeBuilder |
filters(java.util.List<java.lang.String> filters)
Tells this builder to make a Genotype object that has had filters applied,
which may be empty (passes) or have some value indicating the reasons
why it's been filtered.
|
GenotypeBuilder |
filters(java.lang.String... filters)
varargs version of #filters
|
GenotypeBuilder |
GQ(int GQ) |
GenotypeBuilder |
log10PError(double pLog10Error)
Set the GQ with a log10PError value
|
Genotype |
make()
Create a new Genotype object using the values set in this builder.
|
Genotype |
makeWithShallowCopy()
Create a new Genotype object using the values set in this builder, and perform a
shallow copy of reference types to allow safer re-use of this builder
After creation the values in this builder can be modified and more Genotypes
created.
|
GenotypeBuilder |
maxAttributes(int i)
Tell's this builder that we have at most these number of attributes
|
GenotypeBuilder |
name(java.lang.String sampleName)
Set this genotype's name
|
GenotypeBuilder |
noAD()
This genotype has no AD value
|
GenotypeBuilder |
noAttributes()
Tells this builder to remove all extended attributes
|
GenotypeBuilder |
noDP()
This genotype has no DP value
|
GenotypeBuilder |
noGQ()
This genotype has no GQ value
|
GenotypeBuilder |
noPL()
This genotype has no PL value
|
GenotypeBuilder |
phased(boolean phased)
Is this genotype phased?
|
GenotypeBuilder |
PL(double[] GLs)
This genotype has this PL value, converted from double[].
|
GenotypeBuilder |
PL(int[] PL)
This genotype has this PL value, as int[].
|
void |
reset(boolean keepSampleName)
Reset all of the builder attributes to their defaults.
|
GenotypeBuilder |
unfiltered()
This genotype is unfiltered
|
public GenotypeBuilder()
public GenotypeBuilder(java.lang.String sampleName)
sampleName
- public GenotypeBuilder(java.lang.String sampleName, java.util.List<Allele> alleles)
sampleName
- alleles
- public GenotypeBuilder(Genotype g)
g
- public static Genotype create(java.lang.String sampleName, java.util.List<Allele> alleles, java.util.Map<java.lang.String,java.lang.Object> attributes)
protected static Genotype create(java.lang.String sampleName, java.util.List<Allele> alleles, double[] gls)
public static Genotype createMissing(java.lang.String sampleName, int ploidy)
sampleName
- the name of this samplepublic GenotypeBuilder copy(Genotype g)
g
- public final void reset(boolean keepSampleName)
public Genotype make()
makeWithShallowCopy()
to safely re-use the same builder object
multiple times.public Genotype makeWithShallowCopy()
public GenotypeBuilder name(java.lang.String sampleName)
sampleName
- public GenotypeBuilder alleles(java.util.List<Allele> alleles)
alleles
- public GenotypeBuilder phased(boolean phased)
phased
- public GenotypeBuilder GQ(int GQ)
public GenotypeBuilder log10PError(double pLog10Error)
pLog10Error
- public GenotypeBuilder noGQ()
public GenotypeBuilder noAD()
public GenotypeBuilder noDP()
public GenotypeBuilder noPL()
public GenotypeBuilder DP(int DP)
public GenotypeBuilder AD(int[] AD)
public GenotypeBuilder PL(int[] PL)
public GenotypeBuilder PL(double[] GLs)
public GenotypeBuilder attributes(java.util.Map<java.lang.String,java.lang.Object> attributes)
public GenotypeBuilder noAttributes()
public GenotypeBuilder attribute(java.lang.String key, java.lang.Object value)
public GenotypeBuilder filters(java.util.List<java.lang.String> filters)
filters
- non-null list of filters. empty list => PASSpublic GenotypeBuilder filters(java.lang.String... filters)
filters
- public GenotypeBuilder filter(java.lang.String filter)
filter
- if filters == null or filters.equals("PASS") => genotype is PASSpublic GenotypeBuilder unfiltered()
public GenotypeBuilder maxAttributes(int i)