Exemplo n.º 1
0
        public object Assemble(object cached, object owner)
        {
            if (cached == null)
            {
                return(null);
            }

            if (cached == DBNull.Value)
            {
                return(null);
            }

            if (!(cached is string))
            {
                throw new ArgumentException();
            }

            var serializedString = cached as string;

            string[] serializedTokens = serializedString.Split(' ');

            var result = new DistinctMatchFormat
            {
                IsChargeDistinct               = Convert.ToInt32(serializedTokens[0]) != 0 ? true : false,
                IsAnalysisDistinct             = Convert.ToInt32(serializedTokens[1]) != 0 ? true : false,
                AreModificationsDistinct       = Convert.ToInt32(serializedTokens[2]) != 0 ? true : false,
                ModificationMassRoundToNearest = Convert.ToDecimal(serializedTokens[3])
            };

            return(result);
        }
Exemplo n.º 2
0
        public DistinctMatchKey(Peptide peptide, PeptideSpectrumMatch psm, DistinctMatchFormat format, string key, long?id)
        {
            Peptide = peptide;
            Key     = key;
            Format  = format;
            Id      = id;

            if (format.IsChargeDistinct)
            {
                Charge = psm.Charge;
            }

            if (format.IsAnalysisDistinct)
            {
                Analysis = psm.Analysis;
            }
        }
Exemplo n.º 3
0
        public DistinctMatchKey(Peptide peptide, PeptideSpectrumMatch psm, DistinctMatchFormat format, string key, long?id)
        {
            Peptide = peptide;
            Key     = key.Replace(",", Properties.Settings.Default.GroupConcatSeparator);
            Format  = format;
            Id      = id;

            if (format.IsChargeDistinct)
            {
                Charge = psm.Charge;
            }

            if (format.IsAnalysisDistinct)
            {
                Analysis = psm.Analysis;
            }
        }