Esempio n. 1
0
        //writes a list of proteins added to the exclusion list
        private static void WriteExcludedProteinList(ExclusionProfile exclusionProfile)
        {
            List <string> excludedProteins = exclusionProfile.getDatabase().getExcludedProteins();
            String        outputFile       = Path.Combine(InputFileOrganizer.OutputFolderOfTheRun, "ExcludedProteinList.txt");
            StreamWriter  sw = new StreamWriter(outputFile);

            foreach (String prot in excludedProteins)
            {
                sw.WriteLine(prot);
            }
            sw.Close();
        }
Esempio n. 2
0
        private void postProcessingCalculations(int ddaNum, ProteinProphetResult ppr, ExclusionProfile exclusionProfile)
        {
            BaselineComparison bc = baselineComparisonSet[ddaNum];
            List <String>      proteinsIdentifiedByNoExclusion = bc.getProteinsIdentifiedByNoExclusion();
            int totalResourcesNaiveExperiment        = bc.getTotalResourcesNaiveExperiment();
            int numProteinsIdentifiedNaiveExperiment = bc.getNumProteinsIdentifiedNaiveExperiment();

            // set proteins identified first
            setProteinsIdentified(ppr, proteinsIdentifiedByNoExclusion);

            int correctlyExcluded = (int)data[Header.EvaluateExclusion_FoundOnCurrentExclusionList]
                                    + (int)data[Header.EvaluateExclusion_FoundOnCurrentObservedExclusionList];
            int incorrectlyExcluded = (int)data[Header.EvaluateExclusion_NotFoundOnExclusionList];

            /*
             * found on past observed, found on past exclusion list, and found on future
             * exclusion list are not incorrect exclusions, they are retention time being
             * predicted incorrectly...
             */
            double ratioIncorrectlyExcludedOverCorrectlyExcluded = takeRatio(incorrectlyExcluded, correctlyExcluded);

            ChangeValue(Header.CorrectlyExcluded, correctlyExcluded);
            ChangeValue(Header.IncorrectlyExcluded, incorrectlyExcluded);
            ChangeValue(Header.RatioIncorrectlyExcludedOverCorrectlyExcluded, ratioIncorrectlyExcludedOverCorrectlyExcluded);

            // Resources saved in total # available MS2 - # ms2 used foreach analysis
            int    resourcesSaved        = totalResourcesNaiveExperiment - (int)data[Header.NumMS2Analyzed];
            double percentResourcesSaved = takeRatio(resourcesSaved, totalResourcesNaiveExperiment);
            double percentResourcesUsed  = 1 - percentResourcesSaved;

            ChangeValue(Header.PercentResourcesSaved, percentResourcesSaved);
            ChangeValue(Header.PercentResourcesUsed, percentResourcesUsed);

            /*-
             * Protein Identification Sensitivity = # proteins identified / # proteins identified in whole experiment
             * Protein Identification Fold Change = # proteins identified / # proteins identified by naive approach
             * Protein Identification Sensitivity Limited DDA = # proteins identified also identified in naive approach / proteins identified by naive approach
             */
            ChangeValue(Header.ProteinIdentificationSensitivity,
                        takeRatio((int)data[Header.NumProteinsIdentified], numProteinsIdentifiedOriginalExperiment));
            ChangeValue(Header.ProteinIdentificationFoldChange,
                        takeRatio((int)data[Header.NumProteinsIdentified], numProteinsIdentifiedNaiveExperiment));
            ChangeValue(Header.ProteinIdentificationSensitivityLimitedDDA,
                        takeRatio((int)data[Header.ProteinsIdentifiedInLimitedDDA], numProteinsIdentifiedNaiveExperiment));

            List <String> inProgramExcludedProteins = exclusionProfile.getDatabase().getExcludedProteins();
            int           proteinOverlap_inProgramExcluded_vs_NoExclusion = compareProteins(inProgramExcludedProteins, proteinsIdentifiedByNoExclusion);

            ChangeValue(Header.NumProteinOverlap_ExcludedProteinsAgainstNoExclusionProteins, proteinOverlap_inProgramExcluded_vs_NoExclusion);
            ChangeValue(Header.ProteinGroupsIdentified, ppr.getFilteredProteinGroups().Count);
        }
        public static String DoJob(ProteinProphetResult ppr, ExclusionProfile exclusionProfile, int experimentNum)
        {
            String       outputFile = Path.Combine(InputFileOrganizer.OutputFolderOfTheRun, "NumberOfPeptidesPerIdentifiedProtein_" + experimentNum + ".txt");
            StreamWriter sw         = new StreamWriter(outputFile);

            sw.WriteLine("Accession\tNumberOfPeptides\tSpectralCount");

            List <String> confidentlyIdentifiedProts = ppr.getProteinsIdentified();

            foreach (String accession in confidentlyIdentifiedProts)
            {
                Protein          prot             = exclusionProfile.getDatabase().getProtein(accession);
                HashSet <String> peptidesObserved = new HashSet <String>();
                foreach (PeptideScore pepEvidence in prot.getPeptideScore())
                {
                    peptidesObserved.Add(pepEvidence.getPeptideSequence());
                }
                sw.WriteLine("{0}\t{1}\t{2}", accession, peptidesObserved.Count, prot.getPeptideScore().Count);
            }

            sw.Close();
            return(outputFile);
        }