public final class GenotypeBuilder extends Object
Constructor and Description |
---|
GenotypeBuilder()
Create a empty builder.
|
GenotypeBuilder(Genotype g)
Create a new builder starting with the values in Genotype g
|
GenotypeBuilder(String sampleName)
Create a builder using sampleName.
|
GenotypeBuilder(String sampleName,
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(List<Allele> alleles)
Set this genotype's alleles
|
GenotypeBuilder |
attribute(String key,
Object value)
This genotype has this attribute key / value pair.
|
GenotypeBuilder |
attributes(Map<String,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(String sampleName,
List<Allele> alleles) |
protected static Genotype |
create(String sampleName,
List<Allele> alleles,
double[] gls) |
static Genotype |
create(String sampleName,
List<Allele> alleles,
Map<String,Object> attributes) |
static Genotype |
createMissing(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(String filter)
Most efficient version of setting filters -- just set the filters string to filters
|
GenotypeBuilder |
filters(List<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(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.
|
GenotypeBuilder |
maxAttributes(int i)
Tell's this builder that we have at most these number of attributes
|
GenotypeBuilder |
name(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(String sampleName)
sampleName
- public GenotypeBuilder(String sampleName, List<Allele> alleles)
sampleName
- alleles
- public GenotypeBuilder(Genotype g)
g
- public static Genotype create(String sampleName, List<Allele> alleles, Map<String,Object> attributes)
public static Genotype createMissing(String sampleName, int ploidy)
sampleName
- the name of this samplepublic GenotypeBuilder copy(Genotype g)
g
- public final void reset(boolean keepSampleName)
public Genotype make()
public GenotypeBuilder name(String sampleName)
sampleName
- public GenotypeBuilder alleles(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(Map<String,Object> attributes)
public GenotypeBuilder noAttributes()
public GenotypeBuilder attribute(String key, Object value)
public GenotypeBuilder filters(List<String> filters)
filters
- non-null list of filters. empty list => PASSpublic GenotypeBuilder filters(String... filters)
filters
- public GenotypeBuilder filter(String filter)
filter
- if filters == null or filters.equals("PASS") => genotype is PASSpublic GenotypeBuilder unfiltered()
public GenotypeBuilder maxAttributes(int i)