/**
* Builds a map whose key is position in the protein sequence, and value is a
- * list of the base and all variants for each corresponding codon position
+ * list of the base and all variants for each corresponding codon position.
+ * <p>
+ * This depends on dna variants being held as a comma-separated list as
+ * property "alleles" on variant features.
*
* @param dnaSeq
* @param dnaToProtein
}
/*
- * extract dna variants to a string array
+ * ignore variant if not a SNP
*/
String alls = (String) sf.getValue(Gff3Helper.ALLELES);
if (alls == null)
{
continue; // non-SNP VCF variant perhaps - can't process this
}
+
String[] alleles = alls.toUpperCase().split(",");
- int i = 0;
+ boolean isSnp = true;
for (String allele : alleles)
{
- alleles[i++] = allele.trim(); // lose any space characters "A, G"
+ if (allele.trim().length() > 1)
+ {
+ isSnp = false;
+ }
+ }
+ if (!isSnp)
+ {
+ continue;
}
int[] mapsTo = dnaToProtein.locateInTo(dnaCol, dnaCol);