infoMap.put("TYPE", vc.getType().toString()); infoMap.put("QUAL", String.valueOf(vc.getPhredScaledQual()));
for ( final VariantContext.Type type : VariantContext.Type.values() ) { if ( VCsByType.containsKey(type) ) { VCsByType.get(type).addAll(refs); for (final VariantContext.Type type : VariantContext.Type.values()) { if (!EXCLUDE_NON_VARIANTS || !type.equals(VariantContext.Type.NO_VARIATION)) { if (VCsByType.containsKey(type)) { mergedVCs.add(GATKVariantContextUtils.simpleMerge(VCsByType.get(type), priority, rodNames.size(),
if (variantContext.getType().equals(VariantContext.Type.NO_VARIATION)) { builder.setType(VariantType.NO_VARIATION);
variant.setType(getEnumFromString(VariantProto.VariantType.class, variantContext.getType().toString()));
for (VariantContext.Type t : VariantContext.Type.values()) selectedTypes.add(t);
else if (context.isSNP()) snpWriter.add(context); else { if (STRICT) throw new IllegalStateException("Found a record with type " + context.getType().name()); else incorrectVariantCount++;
Assert.assertEquals(jEXLContext.get("TYPE"), VariantContext.Type.SNP.name()); Assert.assertEquals(jEXLContext.get("QUAL"), -10.0); // because of noGQ() when building the genotype Assert.assertEquals(jEXLContext.get("ALLELES"), vc.getAlleles());
VariantContext pairedComp = null; for ( VariantContext comp : compList ) { if ( evalType.equals(comp.getType()) ) { pairedComp = comp; break;
else if (context.isSNP()) snpWriter.add(context); else { if (STRICT) throw new IllegalStateException("Found a record with type " + context.getType().name()); else incorrectVariantCount++;
public Map<String, Object> annotate(final RefMetaDataTracker tracker, final AnnotatorCompatible walker, final ReferenceContext ref, final Map<String, AlignmentContext> stratifiedContexts, final VariantContext vc, final Map<String, PerReadAlleleLikelihoodMap> stratifiedPerReadAlleleLikelihoodMap) { StringBuffer type = new StringBuffer(""); if ( vc.isVariant() && !vc.isBiallelic() ) type.append("MULTIALLELIC_"); if ( !vc.isIndel() ) { type.append(vc.getType().toString()); } else { if (vc.isSimpleInsertion()) type.append("INSERTION."); else if (vc.isSimpleDeletion()) type.append("DELETION."); else type.append("COMPLEX."); ArrayList<Integer> inds = IndelUtils.findEventClassificationIndex(vc, ref); type.append(IndelUtils.getIndelClassificationName(inds.get(0))); for (int i = 1; i < inds.size(); i++ ) { type.append("."); type.append(IndelUtils.getIndelClassificationName(inds.get(i))); } } Map<String, Object> map = new HashMap<>(); map.put(getKeyNames().get(0), String.format("%s", type)); return map; }
public void initialize() { // Get list of samples to include in the output Map<String, VCFHeader> vcfRods = GATKVCFUtils.getVCFHeadersFromRods(getToolkit()); TreeSet<String> vcfSamples = new TreeSet<String>(SampleUtils.getSampleList(vcfRods, GATKVariantContextUtils.GenotypeMergeType.REQUIRE_UNIQUE)); Collection<String> samplesFromFile = SampleUtils.getSamplesFromFiles(sampleFiles); Collection<String> samplesFromExpressions = SampleUtils.matchSamplesExpressions(vcfSamples, sampleExpressions); // first, add any requested samples samples.addAll(samplesFromFile); samples.addAll(samplesFromExpressions); samples.addAll(sampleNames); // if none were requested, we want all of them if ( samples.isEmpty() ) { samples.addAll(vcfSamples); } sampleSelector = getSampleSelectorObject(sampleMode, samples); // initialize frequency mode selector frequencyModeSelector = getFrequencyModeSelectorObject(freqMode, getToolkit().getGenomeLocParser()); // if user specified types to include, add these, otherwise, add all possible variant context types to list of vc types to include if (TYPES_TO_INCLUDE.isEmpty()) { for (VariantContext.Type t : VariantContext.Type.values()) selectedTypes.add(t); } else { for (VariantContext.Type t : TYPES_TO_INCLUDE) selectedTypes.add(t); } Set<VCFHeaderLine> headerLines = new HashSet<VCFHeaderLine>(); headerLines.add(new VCFHeaderLine("source", "ValidationSiteSelector")); vcfWriter.writeHeader(new VCFHeader(headerLines)); }
private static Object splitAlleleTypes(VariantContext vc) { final int numAltAlleles = vc.getAlternateAlleles().size(); if (numAltAlleles == 1) return vc.getType().toString(); List<Allele> altAlleles = vc.getAlternateAlleles(); List<String> alleleTypes = new ArrayList<>(numAltAlleles); for (Allele allele : altAlleles) { if (allele.length() == vc.getReference().length()) { if ( allele.length() == 1 ) alleleTypes.add("SNP"); else alleleTypes.add("MNP"); } else alleleTypes.add("INDEL"); } return alleleTypes; } }
public String getType() { return variantContext.getType().toString(); }
x.put("TYPE", new AttributeGetter() { public Object get(VariantContext vc) { return vc.getType().toString(); }}); x.put("QUAL", new AttributeGetter() { public Object get(VariantContext vc) { return -10 * vc.getLog10PError(); }});
getters.put("TYPE", new Getter() { public String get(VariantContext vc) { return vc.getType().toString(); } }); getters.put("VAR", new Getter() { public String get(VariantContext vc) { return Integer.toString(vc.getHetCount() + vc.getHomVarCount()); } });
public List<Object> getRelevantStates(ReferenceContext ref, RefMetaDataTracker tracker, VariantContext comp, String compName, VariantContext eval, String evalName, String sampleName, String FamilyName) { return eval == null ? Collections.emptyList() : Collections.singletonList((Object)eval.getType().toString()); }
@Override public VariantFilters<VariantContext> addTypeFilter(String type) { filters.add(variantContext -> variantContext.getType().equals(type)); return this; }
private VCFVariant tstStart(String chr, int fileFeatStart, VariantContext.Type variantType, int expFeatStart) throws Exception{ VCFVariant variant = get_hc_mod_Feat(chr, fileFeatStart - 5, fileFeatStart + 5); assertEquals(variantType.toString(), variant.getType()); assertEquals(expFeatStart, variant.getStart()); return variant; } }