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:
Mark DePristo 2012-06-13 20:28:23 -04:00
parent a19ae9434e
commit e34ca0acb1
1 changed files with 4 additions and 1 deletions

View File

@ -291,7 +291,10 @@ class BCF2Writer extends IndexingVariantContextWriter {
writer.start(encoder, vc);
for ( final String name : header.getGenotypeSamples() ) {
// 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.done(encoder, vc);