private boolean containsRefAllele(List<Allele> siteAlleles) { for (Allele all : siteAlleles) { if (all.isReference()) return true; } return false; }
public boolean isValid() { return nFormatFields >= 0 && nSamples >= 0 && alleles != null && ! alleles.isEmpty() && alleles.get(0).isReference(); }
public boolean isValid() { return nFormatFields >= 0 && nSamples >= 0 && alleles != null && ! alleles.isEmpty() && alleles.get(0).isReference(); }
public boolean isValid() { return nFormatFields >= 0 && nSamples >= 0 && alleles != null && ! alleles.isEmpty() && alleles.get(0).isReference(); }
public AlleleSpecificAnnotationData(final List<Allele> inputAlleles, final String inputData) { super(inputData); attributeMap = new HashMap<>(); for(final Allele a : inputAlleles) { attributeMap.put(a, null); } alleleList = inputAlleles; for(Allele a : alleleList) { if(a.isReference()) { refAllele = a; } } }
public void setAlt(Allele altAllele, X newValue){ if (altAllele == null || newValue == null){ throw new IllegalArgumentException("altAllele or newValue is null"); } if (altAllele.isReference()){ throw new IllegalArgumentException("Setting reference allele as alt"); } altAlleleValueMap.put(altAllele, newValue); }
public X getAlt(Allele allele){ if (allele == null){ throw new IllegalArgumentException("allele is null"); } if (allele.isReference()){ throw new IllegalArgumentException("allele is not an alt allele"); } if (altAlleleValueMap.containsKey(allele)) { return(altAlleleValueMap.get(allele)); } else { throw new IllegalArgumentException("Requested alt allele is not in the collection"); } }
public enum Validation { ALLELES, GENOTYPES }
public enum Validation { ALLELES, GENOTYPES }
@Override public int compareTo(final Allele other) { if ( isReference() && other.isNonReference() ) return -1; else if ( isNonReference() && other.isReference() ) return 1; else return getBaseString().compareTo(other.getBaseString()); // todo -- potential performance issue }
@Override public int compareTo(final Allele other) { if ( isReference() && other.isNonReference() ) return -1; else if ( isNonReference() && other.isReference() ) return 1; else return getBaseString().compareTo(other.getBaseString()); // todo -- potential performance issue }
public int compareTo(Allele other) { if ( isReference() && other.isNonReference() ) return -1; else if ( isNonReference() && other.isReference() ) return 1; else return getBaseString().compareTo(other.getBaseString()); // todo -- potential performance issue }
private int findReferenceAllele(final AlleleList<A> alleles) { final int alleleCount = alleles.alleleCount(); for (int i = 0; i < alleleCount; i++) if (alleles.alleleAt(i).isReference()) return i; return -1; }
private void checkRefAlleles() { boolean foundRef = false; for (Allele a : alleleList) { if (a.isReference()) { if (foundRef) throw new GATKException("ERROR: multiple reference alleles found in annotation data\n"); foundRef = true; } } if (!foundRef) throw new GATKException("ERROR: no reference alleles found in annotation data\n"); }
public static Allele extend(final Allele left, final byte[] right) { if (left.isSymbolic()) throw new IllegalArgumentException("Cannot extend a symbolic allele"); byte[] bases = new byte[left.length() + right.length]; System.arraycopy(left.getBases(), 0, bases, 0, left.length()); System.arraycopy(right, 0, bases, left.length(), right.length); return create(bases, left.isReference()); }
public static Allele extend(Allele left, byte[] right) { if (left.isSymbolic()) throw new IllegalArgumentException("Cannot extend a symbolic allele"); byte[] bases = new byte[left.length() + right.length]; System.arraycopy(left.getBases(), 0, bases, 0, left.length()); System.arraycopy(right, 0, bases, left.length(), right.length); return create(bases, left.isReference()); }
public static Allele extend(final Allele left, final byte[] right) { if (left.isSymbolic()) throw new IllegalArgumentException("Cannot extend a symbolic allele"); byte[] bases = new byte[left.length() + right.length]; System.arraycopy(left.getBases(), 0, bases, 0, left.length()); System.arraycopy(right, 0, bases, left.length(), right.length); return create(bases, left.isReference()); }
public void validateAllelesList() { boolean foundRef = false; for (final Allele a : this.getAlleles()) { if (a.isReference()) { if (foundRef) throw new GATKException("ERROR: multiple reference alleles found in annotation data\n"); foundRef = true; } } if (!foundRef) throw new GATKException("ERROR: no reference alleles found in annotation data\n"); }
@Test public void testCreatingSpanningDeletionAlleles() { Assert.assertTrue(SpandDel.isNonReference()); Assert.assertFalse(SpandDel.isReference()); Assert.assertTrue(SpandDel.basesMatch(Allele.SPAN_DEL_STRING)); Assert.assertEquals(SpandDel.length(), 1); }
@Test public void testCreatingNoCallAlleles() { Assert.assertTrue(NoCall.isNonReference()); Assert.assertFalse(NoCall.isReference()); Assert.assertFalse(NoCall.basesMatch(Allele.NO_CALL_STRING)); Assert.assertEquals(NoCall.length(), 0); Assert.assertTrue(NoCall.isNoCall()); Assert.assertFalse(NoCall.isCalled()); }