public object Get(IFormatReader parameter) { var elementType = _classification.GetClassification(parameter, _declaredType).GetElementType(); var result = _reader.Get(parameter).ToArray(elementType ?? throw new InvalidOperationException("Element type not found.")); return(result); }
/** * 根据calculationItems中保存信息,计算在各个classifiedName中每个Object对应的肽段数量。 */ private void CalculatePeptideCount() { foreach (CalculationItem item in calculationItems) { item.ClassifyPeptideHit((m => sphc.GetClassification(m)), option.GetClassifiedNames()); } CalculatePeptideCountDistribution(); }
public object Get(T parameter) { using (var content = _readers.Get(parameter)) { var classification = _classification.GetClassification(content); var result = _serializers.Get(classification) .Get(content); return(result); } }
ReferenceIdentity?GetReference(IFormatReader parameter) { var identity = ReferenceIdentity.Get(parameter); if (identity.HasValue) { return(new ReferenceIdentity(identity.Value)); } var type = _classification.GetClassification(parameter, _definition); var entity = _entities.Get(type)?.Reference(parameter); if (entity != null) { return(new ReferenceIdentity(type, entity)); } return(null); }
ReferenceIdentity?GetReference(IFormatReader parameter) { if (parameter.Get().To <XmlReader>().NodeType != XmlNodeType.Attribute || MemberProperty.Default.Get(parameter)) { var identity = ReferenceIdentity.Get(parameter); if (identity.HasValue) { return(new ReferenceIdentity(identity.Value)); } var type = _classification.GetClassification(parameter, _definition); var entity = _entities.Get(type)?.Reference(parameter); if (entity != null) { return(new ReferenceIdentity(type, entity)); } } return(null); }
private List <int> GetPepCount(IClassification <IIdentifiedPeptide> classification, IEnumerable <IIdentifiedPeptide> curPeps) { var result = new List <int>(); var pepGroup = curPeps.GroupBy(m => classification.GetClassification(m)); foreach (var key in ClassificationSet.Keys) { int count = 0; foreach (var en in pepGroup) { if (en.Key == key) { count = en.Count(); break; } } result.Add(count); } return(result); }