/** * Returns true if the given header lines are from a file sorted according to this VariantContextComparator. * For sorting to work properly, the contig in each header line must have the same index. */ public boolean isCompatible(final Collection<VCFContigHeaderLine> headerLines) { for (final VCFContigHeaderLine headerLine : headerLines) { final Integer existingIndex = this.contigIndexLookup.get(headerLine.getID()); if (existingIndex == null || headerLine.getContigIndex() != existingIndex.intValue()) return false; } return true; } }
/** * Returns true if the given header lines are from a file sorted according to this VariantContextComparator. * For sorting to work properly, the contig in each header line must have the same index. */ public boolean isCompatible(final Collection<VCFContigHeaderLine> headerLines) { for (final VCFContigHeaderLine headerLine : headerLines) { final Integer existingIndex = this.contigIndexLookup.get(headerLine.getID()); if (existingIndex == null || headerLine.getContigIndex() != existingIndex.intValue()) return false; } return true; } }
/** * Returns true if the given header lines are from a file sorted according to this VariantContextComparator. * For sorting to work properly, the contig in each header line must have the same index. */ public boolean isCompatible(final Collection<VCFContigHeaderLine> headerLines) { for (final VCFContigHeaderLine headerLine : headerLines) { final Integer existingIndex = this.contigIndexLookup.get(headerLine.getID()); if (existingIndex == null || headerLine.getContigIndex() != existingIndex.intValue()) return false; } return true; } }
/** * Creates a VariantContextComparator from the given VCF contig header lines. The header lines' * index values are used to order the contigs. Throws IllegalArgumentException if there are dupe * */ public VariantContextComparator(final Collection<VCFContigHeaderLine> headerLines) { if (headerLines.isEmpty()) throw new IllegalArgumentException("One or more header lines must be in the header line collection."); final Map<String, Integer> protoContigIndexLookup = new HashMap<String, Integer>(); for (final VCFContigHeaderLine headerLine : headerLines) { protoContigIndexLookup.put(headerLine.getID(), headerLine.getContigIndex()); } if (protoContigIndexLookup.size() != headerLines.size()) { throw new IllegalArgumentException("There are duplicate contigs/chromosomes in the input header line collection."); } final Set<Integer> protoIndexValues = new HashSet<Integer>(protoContigIndexLookup.values()); if (protoIndexValues.size() != headerLines.size()) { throw new IllegalArgumentException("One or more contigs share the same index number."); } this.contigIndexLookup = Collections.unmodifiableMap(protoContigIndexLookup); }
/** * Creates a VariantContextComparator from the given VCF contig header lines. The header lines' * index values are used to order the contigs. Throws IllegalArgumentException if there are dupe * */ public VariantContextComparator(final Collection<VCFContigHeaderLine> headerLines) { if (headerLines.size() == 0) throw new IllegalArgumentException("One or more header lines must be in the header line collection."); final Map<String, Integer> protoContigIndexLookup = new HashMap<String, Integer>(); for (final VCFContigHeaderLine headerLine : headerLines) { protoContigIndexLookup.put(headerLine.getID(), headerLine.getContigIndex()); } if (protoContigIndexLookup.size() != headerLines.size()) { throw new IllegalArgumentException("There are duplicate contigs/chromosomes in the input header line collection."); } final Set<Integer> protoIndexValues = new HashSet<Integer>(protoContigIndexLookup.values()); if (protoIndexValues.size() != headerLines.size()) { throw new IllegalArgumentException("One or more contigs share the same index number."); } this.contigIndexLookup = Collections.unmodifiableMap(protoContigIndexLookup); }
/** * Creates a VariantContextComparator from the given VCF contig header lines. The header lines' * index values are used to order the contigs. Throws IllegalArgumentException if there are dupe * */ public VariantContextComparator(final Collection<VCFContigHeaderLine> headerLines) { if (headerLines.isEmpty()) throw new IllegalArgumentException("One or more header lines must be in the header line collection."); final Map<String, Integer> protoContigIndexLookup = new HashMap<String, Integer>(); for (final VCFContigHeaderLine headerLine : headerLines) { protoContigIndexLookup.put(headerLine.getID(), headerLine.getContigIndex()); } if (protoContigIndexLookup.size() != headerLines.size()) { throw new IllegalArgumentException("There are duplicate contigs/chromosomes in the input header line collection."); } final Set<Integer> protoIndexValues = new HashSet<Integer>(protoContigIndexLookup.values()); if (protoIndexValues.size() != headerLines.size()) { throw new IllegalArgumentException("One or more contigs share the same index number."); } this.contigIndexLookup = Collections.unmodifiableMap(protoContigIndexLookup); }
contigIndexMap.put(vcfContig.getID(), vcfContig.getContigIndex());
contigIndexMap.put(vcfContig.getID(), vcfContig.getContigIndex());