/** * Returns a newly allocated VC that is the same as VC, but without genotypes * @param vc variant context * @return new VC without genotypes */ public static VariantContext sitesOnlyVariantContext(VariantContext vc) { return new VariantContextBuilder(vc).noGenotypes().make(); }
/** * Returns a newly allocated VC that is the same as VC, but without genotypes * @param vc variant context * @return new VC without genotypes */ public static VariantContext sitesOnlyVariantContext(VariantContext vc) { return new VariantContextBuilder(vc).noGenotypes().make(); }
/** * Returns a newly allocated VC that is the same as VC, but without genotypes * @param vc variant context * @return new VC without genotypes */ @Requires("vc != null") @Ensures("result != null") public static VariantContext sitesOnlyVariantContext(VariantContext vc) { return new VariantContextBuilder(vc).noGenotypes().make(); }
variantContextBuilder.noGenotypes(); } else { variantContextBuilder.genotypes(genotypes);
public String toString() { StringBuilder b = new StringBuilder(); b.append("VariantContextTestData: ["); final VariantContext vc = vcs.get(0); final VariantContextBuilder builder = new VariantContextBuilder(vc); builder.noGenotypes(); b.append(builder.make().toString()); if ( vc.getNSamples() < 5 ) { for ( final Genotype g : vc.getGenotypes() ) b.append(g.toString()); } else { b.append(" nGenotypes = ").append(vc.getNSamples()); } if ( vcs.size() > 1 ) b.append(" ----- with another ").append(vcs.size() - 1).append(" VariantContext records"); b.append("]"); return b.toString(); } }
variantContextBuilder.noGenotypes(); } else { variantContextBuilder.genotypes(genotypes);
@Override public void add( VariantContext vc ) { if ( doNotWriteGenotypes ) vc = new VariantContextBuilder(vc).noGenotypes().make(); vc = vc.fullyDecode(header, false); super.add(vc); // allow on the fly indexing try { final byte[] infoBlock = buildSitesData(vc); final byte[] genotypesBlock = buildSamplesData(vc); // write the two blocks to disk writeBlock(infoBlock, genotypesBlock); } catch ( IOException e ) { throw new RuntimeException("Error writing record to BCF2 file: " + vc.toString(), e); } }
builder.loc(loc.getContig(), loc.getStart(), stop); builder.alleles(Arrays.asList(refAllele, altAllele)); builder.noGenotypes(); if (doMultiAllelicCalls) { vcs.add(builder.make());
builder.noGenotypes(); final List<Genotype> newGenotypes = new ArrayList<Genotype>(ctx.getNSamples()); for (final Genotype gt : ctx.getGenotypes()) {
builder.noGenotypes(); final List<Genotype> newGenotypes = new ArrayList<Genotype>(ctx.getNSamples()); for (final Genotype gt : ctx.getGenotypes()) {
builder.noGenotypes(); } else { builder.genotypes(genotypes);
/** * Add a record to the file */ @Override public void add(final VariantContext context) { try { super.add(context); if (this.doNotWriteGenotypes) write(this.vcfEncoder.encode(new VariantContextBuilder(context).noGenotypes().make())); else write(this.vcfEncoder.encode(context)); write("\n"); writeAndResetBuffer(); } catch (IOException e) { throw new RuntimeException("Unable to write the VCF object to " + getStreamName(), e); } } }
/** * Add a record to the file */ @Override public void add(final VariantContext context) { try { super.add(context); if (this.mHeader == null) { throw new IllegalStateException("Unable to write the VCF: header is missing, " + "try to call writeHeader or setHeader first."); } if (this.doNotWriteGenotypes) { this.vcfEncoder.write(this.writer, new VariantContextBuilder(context).noGenotypes().make()); } else { this.vcfEncoder.write(this.writer, context); } write("\n"); writeAndResetBuffer(); outputHasBeenWritten = true; } catch (IOException e) { throw new RuntimeIOException("Unable to write the VCF object to " + getStreamName(), e); } }
/** * Add a record to the file */ @Override public void add(final VariantContext context) { try { super.add(context); if (this.mHeader == null) { throw new IllegalStateException("Unable to write the VCF: header is missing, " + "try to call writeHeader or setHeader first."); } if (this.doNotWriteGenotypes) { this.vcfEncoder.write(this.writer, new VariantContextBuilder(context).noGenotypes().make()); } else { this.vcfEncoder.write(this.writer, context); } write("\n"); writeAndResetBuffer(); outputHasBeenWritten = true; } catch (IOException e) { throw new RuntimeIOException("Unable to write the VCF object to " + getStreamName(), e); } }
@Override public void add( VariantContext vc ) { if ( doNotWriteGenotypes ) vc = new VariantContextBuilder(vc).noGenotypes().make(); vc = vc.fullyDecode(header, false); super.add(vc); // allow on the fly indexing try { final byte[] infoBlock = buildSitesData(vc); final byte[] genotypesBlock = buildSamplesData(vc); // write the two blocks to disk writeBlock(infoBlock, genotypesBlock); outputHasBeenWritten = true; } catch ( IOException e ) { throw new RuntimeIOException("Error writing record to BCF2 file: " + vc.toString(), e); } }
@Override public void add( VariantContext vc ) { if ( doNotWriteGenotypes ) vc = new VariantContextBuilder(vc).noGenotypes().make(); vc = vc.fullyDecode(header, false); super.add(vc); // allow on the fly indexing try { final byte[] infoBlock = buildSitesData(vc); final byte[] genotypesBlock = buildSamplesData(vc); // write the two blocks to disk writeBlock(infoBlock, genotypesBlock); outputHasBeenWritten = true; } catch ( IOException e ) { throw new RuntimeIOException("Error writing record to BCF2 file: " + vc.toString(), e); } }
modified = new VariantContextBuilder(cfg.vc).genotypes(gc).make(); Assert.assertEquals(modified.getGenotypes(), gc); modified = new VariantContextBuilder(cfg.vc).noGenotypes().make(); Assert.assertTrue(modified.getGenotypes().isEmpty());
builder.noGenotypes(); result_builder.noGenotypes();