GeneLociI seqCoords = seq.getGeneLoci();
if (seqCoords == null)
{
+ System.out.println(String.format(
+ "Can't query VCF for %s as chromosome coordinates not known",
+ seq.getName()));
return 0;
}
*/
VariantContext variant = variants.next();
- /*
- * we can only process SNP variants (which can be reported
- * as part of a MIXED variant record
- */
- if (!variant.isSNP() && !variant.isMixed())
- {
- // continue;
- }
-
int start = variant.getStart() - offset;
int end = variant.getEnd() - offset;
/*
* convert chromosomal location to sequence coordinates
+ * - may be reverse strand (convert to forward for sequence feature)
* - null if a partially overlapping feature
*/
int[] seqLocation = mapping.locateInFrom(start, end);
if (seqLocation != null)
{
- count += addAlleleFeatures(seq, variant, seqLocation[0],
- seqLocation[1], forwardStrand);
+ int featureStart = Math.min(seqLocation[0], seqLocation[1]);
+ int featureEnd = Math.max(seqLocation[0], seqLocation[1]);
+ count += addAlleleFeatures(seq, variant, featureStart, featureEnd,
+ forwardStrand);
}
}
String reference = variant.getReference().getBaseString();
Allele alt = variant.getAlternateAllele(altAlleleIndex);
String allele = alt.getBaseString();
- if (allele.length() != 1)
- {
- /*
- * not a SNP variant
- */
- // return 0;
- }
/*
* build the ref,alt allele description e.g. "G,A", using the base