Esempio n. 1
0
        public static string GetResultsText(TransitionGroupDocNode nodeGroup,
                                            PeptideDocNode nodePep, int indexResult, int indexRatio)
        {
            float?     libraryProduct = nodeGroup.GetLibraryDotProduct(indexResult);
            float?     isotopeProduct = nodeGroup.GetIsotopeDotProduct(indexResult);
            RatioValue ratio          = nodeGroup.GetPeakAreaRatio(indexResult, indexRatio);

            if (null == ratio && !isotopeProduct.HasValue && !libraryProduct.HasValue)
            {
                return(string.Empty);
            }
            StringBuilder sb  = new StringBuilder(@" (");
            int           len = sb.Length;

            if (isotopeProduct.HasValue)
            {
                sb.Append(string.Format(@"idotp {0}", isotopeProduct.Value.ToString(DOTP_FORMAT)));
            }
            if (libraryProduct.HasValue)
            {
                if (sb.Length > len)
                {
                    sb.Append(CS_SEPARATOR);
                }
                sb.Append(string.Format(@"dotp {0}", libraryProduct.Value.ToString(DOTP_FORMAT)));
            }
            if (ratio != null)
            {
                if (sb.Length > len)
                {
                    sb.Append(CS_SEPARATOR);
                }
                if (!double.IsNaN(ratio.StdDev))
                {
                    sb.Append(string.Format(@"rdotp {0}", ratio.DotProduct.ToString(DOTP_FORMAT)));
                    sb.Append(CS_SEPARATOR);
                }

                sb.Append(string.Format(Resources.TransitionGroupTreeNode_GetResultsText_total_ratio__0__,
                                        MathEx.RoundAboveZero(ratio.Ratio, 2, 4)));
            }
            sb.Append(@")");
            return(sb.ToString());
        }
        public static string GetResultsText(TransitionGroupDocNode nodeGroup,
            PeptideDocNode nodePep, int indexResult, int indexRatio)
        {
            float? libraryProduct = nodeGroup.GetLibraryDotProduct(indexResult);
            float? isotopeProduct = nodeGroup.GetIsotopeDotProduct(indexResult);
            RatioValue ratio = nodeGroup.GetPeakAreaRatio(indexResult, indexRatio);
            if (null == ratio && !isotopeProduct.HasValue && !libraryProduct.HasValue)
                return string.Empty;
            StringBuilder sb = new StringBuilder(" ("); // Not L10N
            int len = sb.Length;
            if (isotopeProduct.HasValue)
                sb.Append(string.Format("idotp {0}", isotopeProduct.Value.ToString(DOTP_FORMAT))); // Not L10N
            if (libraryProduct.HasValue)
            {
                if (sb.Length > len)
                    sb.Append(CS_SEPARATOR);
                sb.Append(string.Format("dotp {0}", libraryProduct.Value.ToString(DOTP_FORMAT))); // Not L10N
            }
            if (ratio != null)
            {
                if (sb.Length > len)
                    sb.Append(CS_SEPARATOR);
                if (!double.IsNaN(ratio.StdDev))
                {
                    sb.Append(string.Format("rdotp {0}", ratio.DotProduct.ToString(DOTP_FORMAT))); // Not L10N
                    sb.Append(CS_SEPARATOR);
                }

                sb.Append(string.Format(Resources.TransitionGroupTreeNode_GetResultsText_total_ratio__0__,
                                        MathEx.RoundAboveZero(ratio.Ratio, 2, 4)));
            }
            sb.Append(")"); // Not L10N
            return sb.ToString();
        }