Exemple #1
0
        private static object fup(
            double logPow,
            string @class,
            object pKa,
            object pKa_base,
            bool denominatorOnly
            )
        {
            var Pnlw = Pow(10, logPow);

            var o = ExcelFunctions.Iwp(@class, pKa, pKa_base);

            if (o is ExcelError)
            {
                return(o);
            }
            var Iwp = (double)o;

            var Fwp  = _table1["plasma"]["Fw"];
            var Fnlp = _table1["plasma"]["Fnl"];

            var denominator = ((1 + Iwp) * Fwp + Pnlw * Fnlp);

            if (denominatorOnly)
            {
                return(denominator);
            }

            var fup = (1 + Iwp) / denominator;

            return(fup);
        }
Exemple #2
0
        public static object Kp(
            [ExcelArgument("Tissue (adipose|bone|brain|gut|heart|kidneys|liver|lungs|muscle|skin|spleen|thymus|blood cells")] string tissue,
            [ExcelArgument("Log octanol:water partition coefficient")] double logPow,
            [ExcelArgument("Ionization class (N|WB|SB|A|Z)")] string @class,
            [ExcelArgument("Does drug chemical structure consist of at least one oxygen atom? (TRUE|FALSE)")] bool containsOxygen,
            [ExcelArgument("pKa")] object pKa,
            [ExcelArgument(Name = "pKa,base", Description = "pKa,base (zwitterion only)")] object pKa_base
            )
        {
            object o;

            o = ExcelFunctions.fup(logPow, @class, pKa, pKa_base, true);
            if (o is ExcelError)
            {
                return(o);
            }
            var fup = (double)o;

            o = ExcelFunctions.fut(tissue, logPow, @class, containsOxygen, pKa, pKa_base, true);
            if (o is ExcelError)
            {
                return(o);
            }
            var fut = (double)o;

            var Kp = fut / fup;

            return(Kp);
        }
Exemple #3
0
        public static object Vss(
            [ExcelArgument("Log octanol:water partition coefficient")] double logPow,
            [ExcelArgument("Ionization class (N|WB|SB|A|Z)")] string @class,
            [ExcelArgument("Does drug chemical structure consist of at least one oxygen atom? (TRUE|FALSE)")] bool containsOxygen,
            [ExcelArgument("pKa")] object pKa,
            [ExcelArgument(Name = "pKa,base", Description = "pKa,base (zwitterion only)")] object pKa_base
            )
        {
            var tissues = _table1.Keys;

            var Vss = 0.0;

            foreach (var tissue in tissues)
            {
                if (tissue == "plasma")
                {
                    Vss += _table1[tissue]["V"];
                }
                else
                {
                    var o = ExcelFunctions.Kp(tissue, logPow, @class, containsOxygen, pKa, pKa_base);
                    if (o is ExcelError)
                    {
                        return(o);
                    }
                    var Kp = (double)o;
                    Vss += Kp * _table1[tissue]["V"];
                }
            }

            return(Vss);
        }
Exemple #4
0
        private static object fut(
            string tissue,
            double logPow,
            string @class,
            bool containsOxygen,
            object pKa,
            object pKa_base,
            bool denominatorOnly
            )
        {
            if (string.IsNullOrWhiteSpace(tissue))
            {
                return(ExcelError.ExcelErrorValue);
            }
            tissue = tissue.ToLowerInvariant();
            if (tissue == "plasma")
            {
                return(ExcelError.ExcelErrorValue);
            }
            if (!_table1.ContainsKey(tissue))
            {
                return(ExcelError.ExcelErrorValue);
            }

            object o;
            double Pnlw;

            if (tissue == "adipose")
            {
                o = LogPvow(logPow, @class, containsOxygen);
                if (o is ExcelError)
                {
                    return(o);
                }
                var logPvow = (double)o;
                Pnlw = Pow(10, logPvow);
            }
            else
            {
                Pnlw = Pow(10, logPow);
            }

            o = ExcelFunctions.Iwt(@class, pKa, pKa_base);
            if (o is ExcelError)
            {
                return(o);
            }
            var Iwt = (double)o;

            var Fwt  = _table1[tissue]["Fw"];
            var Fnlt = _table1[tissue]["Fnl"];

            var denominator = ((1 + Iwt) * Fwt + Pnlw * Fnlt);

            if (denominatorOnly)
            {
                return(denominator);
            }

            o = ExcelFunctions.Iwp(@class, pKa, pKa_base);
            if (o is ExcelError)
            {
                return(o);
            }
            var Iwp = (double)o;

            var fut = (1 + Iwp) / denominator;

            return(fut);
        }