Ejemplo n.º 1
0
 /// <summary>
 /// Enumerates all the alleles in this genotype at the specified resolution
 /// </summary>
 /// <param name="resolution"></param>
 /// <returns></returns>
 public IEnumerable <string> Enumerate(HlaIResolution resolution)
 {
     foreach (HlaI hla in NonMissingHlas)
     {
         foreach (string type in hla.Enumerate(resolution))
         {
             yield return(type);
         }
     }
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Enumerates all values at the given resolution.
        /// </summary>
        /// <param name="resolution"></param>
        /// <returns></returns>
        public IEnumerable <string> Enumerate(HlaIResolution resolution)
        {
            switch (resolution)
            {
            case HlaIResolution.Group:
                return(_groups.Select(type => Locus.ToString() + type));

            case HlaIResolution.Protein:
                return(_proteins.Select(type => Locus.ToString() + type));

            case HlaIResolution.Synonymous:
                return(_synChanges.Select(type => Locus.ToString() + type));

            default:
                throw new NotImplementedException("Can't get here.");
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Clears all resolution details that are higher than the specified resolution.
        /// </summary>
        /// <param name="resolution"></param>
        public void SetMaxResolution(HlaIResolution resolution)
        {
            switch (resolution)
            {
            case HlaIResolution.Synonymous:
                return;

            case HlaIResolution.Protein:
                this._synChanges.Clear();
                return;

            case HlaIResolution.Group:
                this._synChanges.Clear();
                this._proteins.Clear();
                return;

            default:
                throw new NotImplementedException("Shouldn't be possible.");
            }
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Clears all resolution details that are higher than the specified resolution.
 /// </summary>
 /// <param name="resolution"></param>
 public void SetMaxResolution(HlaIResolution resolution)
 {
     AllHlas().Where(hla => hla != null).ForEach(hla => hla.SetMaxResolution(resolution));
 }