Passing all unittests
-- Final merge conflicts resolved -- BCF2Writer now supports case where a sample is present in the header but the sample isn't in the VC, in which case we create an empty sample and encode that
This commit is contained in:
parent
a19ae9434e
commit
e34ca0acb1
|
|
@ -291,7 +291,10 @@ class BCF2Writer extends IndexingVariantContextWriter {
|
||||||
writer.start(encoder, vc);
|
writer.start(encoder, vc);
|
||||||
for ( final String name : header.getGenotypeSamples() ) {
|
for ( final String name : header.getGenotypeSamples() ) {
|
||||||
// todo -- can we optimize this get (string -> genotype) which can be expensive
|
// todo -- can we optimize this get (string -> genotype) which can be expensive
|
||||||
final Genotype g = vc.getGenotype(name);
|
Genotype g = vc.getGenotype(name);
|
||||||
|
if ( g == null )
|
||||||
|
// we don't have any data about g at all
|
||||||
|
g = new GenotypeBuilder(name).make();
|
||||||
writer.addGenotype(encoder, vc, g);
|
writer.addGenotype(encoder, vc, g);
|
||||||
}
|
}
|
||||||
writer.done(encoder, vc);
|
writer.done(encoder, vc);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue