anchor.diff:      else
           Map.empty
   
  +/// Return either the first feature in features or an ORF if one is present.
  +/// Raise an exception if more than one ORF is found.
  +let chooseBestFeature features =
  +    match features |> Array.filter (fun f -> f.featType = "ORF") with
  +    | [||] -> features.[0]
  +    | [|orf|] -> orf
  +    | tooMany ->
  +        failwithf "Multiple ORF features found for a single feature group: %+A" tooMany
  +
  +
  +/// Filter features down to a preferred uniquely-named subset.
  +/// For each group of features keyed by systematic name, choose an ORF if that feature
  +// type is present, otherwise choose whichever feature appears first.
  +let filterBestFeatures features =
  +    features
  +    |> Array.groupBy (fun f -> f.sysName)
  +    |> Array.map (snd >> chooseBestFeature)
  +
   /// Init genome definition, genes etc
   type GenomeDef(libDir: string, name: string) as this = class
       let mutable fasta = None
  -    let mutable feats = None
  -    let mutable featIndex = None
  +    let mutable features : Map<string,Feature> option = None
       let mutable suffixTreePath : string option = None
       let mutable suffixTree : SuffixTreeDisk option = None
   
  
positive.code:                         d.Add(kv.Key,(Dna(kv.Value, true, AllowAmbiguousBases)))
                    Some d
                    )
          feats <-  Some(sgd.loadFeatures featsPath)
          
          let i1 = feats.Value |> Array.mapi (fun i f -> f.sysName,i)
          let i2 = feats.Value |> Array.mapi (fun i f -> f.gene,i)
          featIndex <- Array.concat [ i1 ; i2 ] |> Seq.filter (fun (x,_) -> x <> "") |> Map.ofSeq |> Some 
      
      member x.get(g:string) =
          ensureLoaded()
          match featIndex with
              | None -> failwith "Access to unloaded GenomeDef"
              | Some(fi) -> feats.Value.[fi.[g]]
  
      /// Return a list of codons to avoid, if this reference genome has them defined.
      member x.GetCodonAvoid() =
  
negative.code:     /// Return array of all genomic features we have loaded
      member x.GetAllFeats() =
          ensureLoaded()
          features.Value
          |> Map.toSeq
          |> Seq.map snd
          |> Seq.distinct
          |> Array.ofSeq
  
      member x.Dna(errorContext:string,chr:string,l':int<ZeroOffset>,r':int<ZeroOffset>) =
              ensureLoaded()
  