import jalview.ext.htsjdk.VCFReader;
import jalview.io.gff.SequenceOntologyI;
import jalview.util.MapList;
+import jalview.util.MappingUtils;
import java.io.IOException;
import java.util.HashMap;
String alleles = sb.toString(); // e.g. G,A,C
String type = SequenceOntologyI.SEQUENCE_VARIANT;
+
+ /*
+ * extract allele frequency as feature score, but only if
+ * a simple SNP (not for >1 co-located SNPs as each has a score)
+ */
float score = 0f;
if (alleleCount == 1)
{
/*
* mapping is 1:1 in length, so we trust it to have no discontinuities
*/
- if (rangeContains(fromRange, queryRange))
+ if (MappingUtils.rangeContains(fromRange, queryRange))
{
/*
* fromRange subsumes our query range
}
/**
- * Answers true if range's start-end positions include those of queryRange,
- * where either range might be in reverse direction, else false
- *
- * @param range
- * @param queryRange
- * @return
- */
- protected static boolean rangeContains(int[] range, int[] queryRange)
- {
- int min = Math.min(range[0], range[1]);
- int max = Math.max(range[0], range[1]);
-
- return (min <= queryRange[0] && max >= queryRange[0]
- && min <= queryRange[1] && max >= queryRange[1]);
- }
-
- /**
* Formats a ranges map lookup key
*
* @param chromosome