Added decode method to LazyGenotypesContext
-- AbstractVCFCodec calls this if the samples are not sorted. Previously called getGenotypes() which didn't actually trigger the decode
This commit is contained in:
parent
ab2efe3bd3
commit
9ea7b70a02
|
|
@ -321,6 +321,11 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec {
|
|||
final LazyGenotypesContext.LazyParser lazyParser = new LazyVCFGenotypesParser(alleles, chr, pos);
|
||||
final int nGenotypes = header.getGenotypeSamples().size();
|
||||
LazyGenotypesContext lazy = new LazyGenotypesContext(lazyParser, parts[8], nGenotypes);
|
||||
|
||||
// did we resort the sample names? If so, we need to load the genotype data
|
||||
if ( !header.samplesWereAlreadySorted() )
|
||||
lazy.decode();
|
||||
|
||||
builder.genotypesNoValidation(lazy);
|
||||
}
|
||||
|
||||
|
|
@ -332,9 +337,6 @@ public abstract class AbstractVCFCodec implements FeatureCodec, NameAwareCodec {
|
|||
generateException(e.getMessage());
|
||||
}
|
||||
|
||||
// did we resort the sample names? If so, we need to load the genotype data
|
||||
if ( !header.samplesWereAlreadySorted() )
|
||||
vc.getGenotypes();
|
||||
|
||||
return vc;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -177,4 +177,11 @@ public class LazyGenotypesContext extends GenotypesContext {
|
|||
public Object getUnparsedGenotypeData() {
|
||||
return unparsedGenotypeData;
|
||||
}
|
||||
|
||||
/**
|
||||
* Force us to decode the genotypes
|
||||
*/
|
||||
public void decode() {
|
||||
buildCache();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue