{
String type = SequenceOntologyI.SEQUENCE_VARIANT;
++ /*
++ * could we associate Consequence data with this allele and feature (transcript)?
++ * if so, prefer the consequence term from that data
++ */
if (csqAlleleFieldIndex == -1) // && snpEffAlleleFieldIndex == -1
{
/*
return type;
}
-- /*
-- * can we associate Consequence data with this allele and feature (transcript)?
-- * if so, prefer the consequence term from that data
-- */
- String consequence = getConsequenceForAlleleAndFeature(variant,
- CSQ_FIELD,
- altAlleleIndex, csqAlleleFieldIndex, csqAlleleNumberFieldIndex,
- seq.getName().toLowerCase(), csqFeatureFieldIndex);
if (consequence != null)
{
String[] csqFields = consequence.split(PIPE_REGEX);
/**
* Inspects CSQ data blocks (consequences) and adds attributes on the sequence
- * feature for the current allele (and transcript if applicable)
+ * feature.
* <p>
- * Allele matching: if field ALLELE_NUM is present, it must match
- * altAlleleIndex. If not present, then field Allele value must match the VCF
- * Allele.
- * <p>
- * Transcript matching: if sequence name can be identified to at least one of
- * the consequences' Feature values, then select only consequences that match
- * the value (i.e. consequences for the current transcript sequence). If not,
- * take all consequences (this is the case when adding features to the gene
- * sequence).
+ * If <code>myConsequence</code> is not null, then this is the specific
+ * consequence data (pipe-delimited fields) that is for the current allele and
+ * transcript (sequence) being processed)
*
* @param variant
- * @param seq
* @param sf
- * @param altAlleleIndex
- * (0, 1..)
+ * @param myConsequence
*/
- protected void addConsequences(VariantContext variant, SequenceI seq,
- SequenceFeature sf, int altAlleleIndex)
+ protected void addConsequences(VariantContext variant, SequenceFeature sf,
+ String myConsequence)
{
- /*
- * first try to identify the matching consequence
- */
- String myConsequence = getConsequenceForAlleleAndFeature(variant,
- CSQ_FIELD, altAlleleIndex, csqAlleleFieldIndex,
- csqAlleleNumberFieldIndex, seq.getName().toLowerCase(),
- csqFeatureFieldIndex);
-
Object value = variant.getAttribute(CSQ_FIELD);
- // TODO if CSQ not present, try ANN (for SnpEff consequence data)?
if (value == null || !(value instanceof List<?>))
{