示例#1
0
 public ExperimentalProteoform(string accession, IAggregatable root, bool is_target)
     : base(accession)
 {
     quant          = new QuantitativeProteoformValues(this);
     this.root      = root;
     this.is_target = is_target;
 }
 public void computeIndividualExperimentalProteoformFDRs(List <ExperimentalProteoform> satisfactoryProteoforms, List <TusherStatistic> permutedTestStatistics, List <TusherStatistic> sortedProteoformTestStatistics)
 {
     Parallel.ForEach(satisfactoryProteoforms, eP =>
     {
         eP.quant.TusherValues2.roughSignificanceFDR = QuantitativeProteoformValues.computeExperimentalProteoformFDR(eP.quant.TusherValues2.relative_difference, permutedTestStatistics, satisfactoryProteoforms.Count, sortedProteoformTestStatistics);
     });
 }
示例#3
0
        public List <BiorepIntensity> make_biorepIntensityList <T>(List <T> lt_quant_components, List <T> hv_quant_components, IEnumerable <string> ltConditionStrings, IEnumerable <string> hvConditionStrings)
            where T : IBiorepable
        {
            quant = new QuantitativeProteoformValues(this); //Reset quantitation if starting over from biorep requirements

            List <BiorepIntensity> biorepIntensityList = new List <BiorepIntensity>();

            foreach (string condition in ltConditionStrings.ToList())
            {
                foreach (int b in lt_quant_components.Where(c => c.input_file.lt_condition == condition).Select(c => c.input_file.biological_replicate).Distinct())
                {
                    biorepIntensityList.Add(new BiorepIntensity(true, false, b, condition, lt_quant_components.Where(c => c.input_file.biological_replicate == b).Sum(i => i.intensity_sum)));
                }
            }

            if (SaveState.lollipop.neucode_labeled)
            {
                foreach (string condition in hvConditionStrings.ToList())
                {
                    foreach (int b in hv_quant_components.Where(c => c.input_file.hv_condition == condition).Select(c => c.input_file.biological_replicate).Distinct())
                    {
                        biorepIntensityList.Add(new BiorepIntensity(false, false, b, condition, hv_quant_components.Where(c => c.input_file.biological_replicate == b).Sum(i => i.intensity_sum)));
                    }
                }
            }
            this.biorepIntensityList = biorepIntensityList;
            return(biorepIntensityList);
        }
示例#4
0
 public ExperimentalProteoform(string accession, IAggregatable root, List <IAggregatable> candidate_observations, bool is_target)
     : base(accession)
 {
     quant     = new QuantitativeProteoformValues(this);
     this.root = root;
     this.aggregated.AddRange(candidate_observations.Where(p => this.includes(p, this.root)));
     this.calculate_properties();
     this.root = this.aggregated.OrderByDescending(a => a.intensity_sum).FirstOrDefault();
 }
        /// <summary>
        /// Returns imputed intensities for a certain condition for biological replicates this proteoform was not observed in.
        /// </summary>
        /// <param name="observedBftIntensities"></param>
        /// <param name="bkgdAverageIntensity"></param>
        /// <param name="bkgdStDev"></param>
        /// <param name="condition"></param>
        /// <param name="bioreps"></param>
        /// <returns></returns>

        public static List <BiorepIntensity> imputedIntensities(IEnumerable <BiorepIntensity> observedBioreps, decimal bkgdAverageIntensity, decimal bkgdStDev, string condition, List <string> bioreps, bool useRandomSeed, Random seeded)
        {
            //bkgdAverageIntensity is log base 2
            //bkgdStDev is log base 2

            return((
                       from biorep in bioreps
                       where !observedBioreps.Any(k => k.condition == condition && k.biorep == biorep)
                       select new BiorepIntensity(true, biorep, condition, QuantitativeProteoformValues.imputed_intensity(bkgdAverageIntensity, bkgdStDev, useRandomSeed, seeded)))
                   .ToList());
        }
示例#6
0
        public List <BiorepIntensity> make_biorepIntensityList <T>(List <T> lt_quant_components, List <T> hv_quant_components, IEnumerable <string> ltConditionStrings, IEnumerable <string> hvConditionStrings)
            where T : IFileIntensity
        {
            quant = new QuantitativeProteoformValues(this); //Reset quantitation if starting over from biorep requirements

            List <BiorepIntensity>        biorepIntensityList  = new List <BiorepIntensity>();
            List <BiorepTechrepIntensity> biotechIntensityList = new List <BiorepTechrepIntensity>();

            foreach (string condition in ltConditionStrings.Concat(hvConditionStrings).Distinct().ToList())
            {
                List <T>         quants_from_condition = lt_quant_components.Where(c => c.input_file.lt_condition == condition).Concat(hv_quant_components.Where(c => c.input_file.hv_condition == condition)).ToList();
                List <InputFile> files   = quants_from_condition.Select(x => x.input_file).ToList();
                List <string>    bioreps = quants_from_condition.Select(c => c.input_file.biological_replicate).Distinct().ToList();
                biorepIntensityList.AddRange(bioreps.Select(b => new BiorepIntensity(false, b, condition, quants_from_condition.Where(c => c.input_file.biological_replicate == b).Sum(i => i.intensity_sum))));
                List <Tuple <string, string> > biotechs = quants_from_condition.Select(c => new Tuple <string, string>(c.input_file.biological_replicate, c.input_file.technical_replicate)).Distinct().ToList();
                biotechIntensityList.AddRange(biotechs.Select(x => new BiorepTechrepIntensity(false, x.Item1, condition, x.Item2, quants_from_condition.Where(c => c.input_file.biological_replicate == x.Item1 && c.input_file.technical_replicate == x.Item2).Sum(asdf => asdf.intensity_sum))));
            }

            this.biorepIntensityList        = biorepIntensityList;
            this.biorepTechrepIntensityList = biotechIntensityList;
            return(biorepIntensityList);
        }
示例#7
0
 // COPYING CONSTRUCTOR
 public ExperimentalProteoform(ExperimentalProteoform eP)
     : base(eP.accession, eP.modified_mass, eP.lysine_count, eP.is_target)
 {
     copy_aggregate(eP);
     quant = new QuantitativeProteoformValues(this);
 }
示例#8
0
        /// <summary>
        /// Returns imputed intensities for a certain condition for biological replicates this proteoform was not observed in.
        /// </summary>
        /// <param name="observedBioreps"></param>
        /// <param name="bkgdAverageIntensity"></param>
        /// <param name="bkgdStDev"></param>
        /// <param name="condition"></param>
        /// <param name="bioreps"></param>
        /// <returns></returns>
        public static List <BiorepTechrepIntensity> imputedIntensities(List <BiorepTechrepIntensity> observedBioreps, IEnumerable <InputFile> files, decimal bkgdAverageIntensity, decimal bkgdStDev, string condition, List <string> bioreps, bool useRandomSeed, Random seeded)
        {
            //bkgdAverageIntensity is log base 2
            //bkgdStDev is log base 2

            List <Tuple <string, string> > bt = files.Select(x => new Tuple <string, string>(x.biological_replicate, x.technical_replicate)).Distinct().ToList();

            return((
                       from x in bt
                       where !observedBioreps.Any(k => k.condition == condition && k.biorep == x.Item1 && k.techrep == x.Item2)
                       select new BiorepTechrepIntensity(true, x.Item1, condition, x.Item2, QuantitativeProteoformValues.imputed_intensity(bkgdAverageIntensity, bkgdStDev, useRandomSeed, seeded)))
                   .ToList());
        }