示例#1
0
 /// <summary>
 /// Extract and group chain names from all chains
 /// </summary>
 private void BuildChainNames()
 {
     ChainNames = ProteinDB
                  .Where(x => string.IsNullOrWhiteSpace(x.Tag))
                  .GroupBy(x => x.Description ?? string.Empty)
                  .Select(x => new ChainNameGroup
     {
         Name      = x.Key,
         Count     = x.Count(),
         LengthMax = x.Max(y => y.Length),
         LengthMin = x.Min(y => y.Length),
         LengthAvg = x.Average(y => y.Length),
         Chains    = x.AsEnumerable()
     });
     Log("{0} chain names found in {1} chains", ChainNames.Count(), ProteinDB.Count());
     Stats = ProteinDB
             .GroupBy(x => x.Tag)
             .Select(x => new
     {
         Tag   = x.Key,
         Count = x.Count()
     });
     OnSelectedChainNamesChanged();
 }