Пример #1
0
 public boolean useValidation(VariantContext validation, ReferenceContext ref) {
   if (goodSite(validation)) {
     // if using record keeps us below expected proportion, use it
     logger.debug(
         String.format(
             "boot: %d, test: %d, total: %d",
             bootstrapSetSize, testSetSize, bootstrapSetSize + testSetSize + 1));
     if ((bootstrapSetSize + 1.0) / (1.0 + bootstrapSetSize + testSetSize) <= bootstrap) {
       if (bootstrapVCFOutput != null) {
         bootstrapVCFOutput.add(
             new VariantContextBuilder(validation).filters(BOOTSTRAP_FILTER).make());
       }
       bootstrapSetSize++;
       return true;
     } else {
       if (bootstrapVCFOutput != null) {
         bootstrapVCFOutput.add(validation);
       }
       testSetSize++;
       return false;
     }
   } else {
     if (validation != null && bootstrapVCFOutput != null) {
       bootstrapVCFOutput.add(validation);
     }
     return false;
   }
 }
Пример #2
0
  private void initializeVcfWriter() {
    final List<String> inputNames = Arrays.asList(validation.getName());

    // setup the header fields
    Set<VCFHeaderLine> hInfo = new HashSet<VCFHeaderLine>();
    hInfo.addAll(VCFUtils.getHeaderFields(getToolkit(), inputNames));
    hInfo.add(
        new VCFFilterHeaderLine(
            "bootstrap",
            "This site used for genotype bootstrapping with ProduceBeagleInputWalker"));

    bootstrapVCFOutput.writeHeader(
        new VCFHeader(hInfo, SampleUtils.getUniqueSamplesFromRods(getToolkit(), inputNames)));
  }