/**
* Transfers VCF features to sequences to which this sequence has a mapping.
- * If the mapping is 1:3, computes peptide variants from nucleotide variants.
+ * If the mapping is 3:1, computes peptide variants from nucleotide variants.
*
* @param seq
*/
*/
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
* call (e.g.) http://rest.ensembl.org/map/human/GRCh38/17:45051610..45109016:1/GRCh37
*/
EnsemblMap mapper = new EnsemblMap();
- int[] mapping = mapper.getMapping(species, chromosome, fromRef, toRef,
+ int[] mapping = mapper.getAssemblyMapping(species, chromosome, fromRef,
+ toRef,
queryRange);
if (mapping == null)