Ejemplo n.º 1
0
        /// <summary>
        /// Constructor where the PeptideHit result type is explicitly set
        /// </summary>
        /// <param name="inputFilePath">Input file to read</param>
        /// <param name="resultType">Source file PeptideHit result type</param>
        /// <param name="startupOptions">Startup options</param>
        public clsPHRPReader(string inputFilePath, PeptideHitResultTypes resultType, clsPHRPStartupOptions startupOptions)
        {
            ErrorMessages   = new List <string>();
            WarningMessages = new List <string>();

            throw new Exception("Class clsPHRPReader is obsolete; replace with the ReaderFactory class");
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor where the PeptideHit result type is explicitly set
        /// </summary>
        /// <param name="inputFilePath">Input file to read</param>
        /// <param name="resultType">Source file PeptideHit result type</param>
        /// <param name="loadModsAndSeqInfo">If True, looks for and auto-loads the modification definitions from the _ModSummary.txt file</param>
        /// <param name="loadMSGFResults">If True, looks for and auto-loads the MSGF results from the _msg.txt file</param>
        /// <param name="loadScanStats">If True, looks for and auto-loads the MASIC scan stats files (used to determine collision mode and to refine the precursor m/z values)</param>
        public clsPHRPReader(string inputFilePath, PeptideHitResultTypes resultType, bool loadModsAndSeqInfo, bool loadMSGFResults,
                             bool loadScanStats)
        {
            ErrorMessages   = new List <string>();
            WarningMessages = new List <string>();

            throw new Exception("Class clsPHRPReader is obsolete; replace with the ReaderFactory class");
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="datasetName">Dataset name</param>
        /// <param name="inputDirectoryPath">Input file path</param>
        /// <param name="peptideHitResultType">Peptide Hit result type</param>
        /// <param name="phrpDataFileName">The base PHRP data file name; used when calling AutoSwitchToLegacyMSGFDBIfRequired and AutoSwitchToFHTIfRequired</param>
        public PHRPSeqMapReader(string datasetName, string inputDirectoryPath, PeptideHitResultTypes peptideHitResultType, string phrpDataFileName)
        {
            DatasetName = datasetName;

            if (string.IsNullOrEmpty(DatasetName))
            {
                ErrorMessage = "Dataset name cannot be empty";
                throw new Exception(ErrorMessage);
            }

            InputDirectoryPath = inputDirectoryPath;
            if (string.IsNullOrEmpty(InputDirectoryPath))
            {
                InputDirectoryPath = string.Empty;
            }

            PeptideHitResultType = peptideHitResultType;

            ResultToSeqMapFilename = ReaderFactory.GetPHRPResultToSeqMapFileName(peptideHitResultType, DatasetName);
            if (string.IsNullOrEmpty(ResultToSeqMapFilename))
            {
                ErrorMessage = "Unable to determine ResultToSeqMap filename for peptideHitResultType: " + peptideHitResultType.ToString();
                throw new Exception(ErrorMessage);
            }

            ResultToSeqMapFilename = ReaderFactory.FindPHRPFile(InputDirectoryPath, phrpDataFileName, ResultToSeqMapFilename, out _);

            SeqToProteinMapFilename = ReaderFactory.GetPHRPSeqToProteinMapFileName(peptideHitResultType, DatasetName);
            if (string.IsNullOrEmpty(SeqToProteinMapFilename))
            {
                ErrorMessage = "Unable to determine SeqToProteinMap filename for peptideHitResultType: " + peptideHitResultType.ToString();
                throw new Exception(ErrorMessage);
            }

            SeqToProteinMapFilename = ReaderFactory.FindPHRPFile(InputDirectoryPath, phrpDataFileName, SeqToProteinMapFilename, out _);

            mSeqInfoFilename = ReaderFactory.GetPHRPSeqInfoFileName(peptideHitResultType, DatasetName);
            if (string.IsNullOrEmpty(mSeqInfoFilename))
            {
                ErrorMessage = "Unable to determine SeqInfo filename for peptideHitResultType: " + peptideHitResultType.ToString();
                throw new Exception(ErrorMessage);
            }

            mSeqInfoFilename = ReaderFactory.FindPHRPFile(InputDirectoryPath, phrpDataFileName, mSeqInfoFilename, out _);

            PepToProteinMapFilename = ReaderFactory.GetPHRPPepToProteinMapFileName(peptideHitResultType, DatasetName);
            if (string.IsNullOrEmpty(PepToProteinMapFilename))
            {
                ErrorMessage = "Unable to determine PepToProtMap filename for PeptideHitResultType: " + peptideHitResultType.ToString();
                throw new Exception(ErrorMessage);
            }

            PepToProteinMapFilename = ReaderFactory.FindPHRPFile(InputDirectoryPath, phrpDataFileName, PepToProteinMapFilename, out _);

            MaxProteinsPerSeqID = 0;
        }
Ejemplo n.º 4
0
 public static string FindModSummaryFile(
     PeptideHitResultTypes peptideHitResultType,
     string datasetName,
     string inputDirectoryPath,
     string inputFileName,
     out string modSummaryFileNamePreferred)
 {
     modSummaryFileNamePreferred = string.Empty;
     return(string.Empty);
 }
Ejemplo n.º 5
0
        public static string AutoDetermineBestInputFile(string inputDirectoryPath, string datasetName,
                                                        out PeptideHitResultTypes matchedResultType)
        {
            var datasetNames = new List <string>
            {
                datasetName
            };

            return(AutoDetermineBestInputFile(inputDirectoryPath, datasetNames, out matchedResultType));
        }
Ejemplo n.º 6
0
        public void TestLoadSearchEngineParameters(PeptideHitResultTypes resultType, string parameterFilePath)
        {
            var parameterFile = FindFile(parameterFilePath);

            if (parameterFile.Directory == null)
            {
                throw new NullReferenceException("Unable to determine the parent directory of the parameter file");
            }

            var startupOptions = new StartupOptions
            {
                DisableOpeningInputFiles = true
            };

            var placeholderInputFilePath = Path.Combine(parameterFile.Directory.FullName, ReaderFactory.NON_EXISTENT_FILE_PLACEHOLDER_NAME);
            var factory = new ReaderFactory(placeholderInputFilePath, resultType, startupOptions);

            factory.SynFileReader.LoadSearchEngineParameters(parameterFile.Name, out var searchEngineParams);

            Console.WriteLine();
            Console.WriteLine("{0,-21} {1}", "Search Engine:", searchEngineParams.SearchEngineName);
            Console.WriteLine("{0,-21} {1} {2}", "Precursor tolerance:", searchEngineParams.PrecursorMassTolerancePpm, "ppm");
            Console.WriteLine("{0,-21} {1} {2}", "Precursor tolerance:", searchEngineParams.PrecursorMassToleranceDa, "Da");
            Console.WriteLine("{0,-21} {1}", "Min number termini:", searchEngineParams.MinNumberTermini);
            Console.WriteLine("{0,-21} {1}", "Enzyme:", searchEngineParams.Enzyme);

            if (!string.IsNullOrWhiteSpace(searchEngineParams.FastaFilePath))
            {
                Console.WriteLine("{0,-21} {1}", "FASTA File:", searchEngineParams.FastaFilePath);
            }

            foreach (var modInfo in searchEngineParams.ModList)
            {
                Console.WriteLine(modInfo.ToString());
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="datasetName">Dataset name</param>
 /// <param name="inputDirectoryPath">Input file path</param>
 /// <param name="peptideHitResultType">Peptide Hit result type</param>
 public PHRPSeqMapReader(string datasetName, string inputDirectoryPath, PeptideHitResultTypes peptideHitResultType)
     : this(datasetName, inputDirectoryPath, peptideHitResultType, ReaderFactory.GetPHRPSynopsisFileName(peptideHitResultType, datasetName))
 {
 }
Ejemplo n.º 8
0
 public static string GetToolVersionInfoFilename(PeptideHitResultTypes resultType)
 {
     return(ReaderFactory.GetToolVersionInfoFilename(resultType));
 }
Ejemplo n.º 9
0
 public static string GetPHRPSeqToProteinMapFileName(PeptideHitResultTypes resultType, string datasetName)
 {
     return(ReaderFactory.GetPHRPSeqToProteinMapFileName(resultType, datasetName));
 }
Ejemplo n.º 10
0
 public static string GetPHRPSynopsisFileName(PeptideHitResultTypes resultType, string datasetName)
 {
     return(ReaderFactory.GetPHRPSynopsisFileName(resultType, datasetName));
 }
Ejemplo n.º 11
0
 public static string AutoDetermineDatasetName(string filePath, PeptideHitResultTypes resultType)
 {
     return(ReaderFactory.AutoDetermineDatasetName(filePath, resultType));
 }
Ejemplo n.º 12
0
 public static string AutoDetermineBestInputFile(string inputDirectoryPath, List <string> datasetNames,
                                                 out PeptideHitResultTypes matchedResultType)
 {
     return(ReaderFactory.AutoDetermineBestInputFile(inputDirectoryPath, datasetNames, out matchedResultType));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Constructor where the PeptideHit result type is explicitly set
 /// </summary>
 /// <param name="inputFilePath">Input file to read</param>
 /// <param name="resultType">Source file PeptideHit result type</param>
 /// <param name="loadModsAndSeqInfo">If True, looks for and auto-loads the modification definitions from the _ModSummary.txt file</param>
 /// <param name="loadMSGFResults">If True, looks for and auto-loads the MSGF results from the _msg.txt file</param>
 public clsPHRPReader(string inputFilePath, PeptideHitResultTypes resultType, bool loadModsAndSeqInfo, bool loadMSGFResults)
     : this(inputFilePath, resultType, loadModsAndSeqInfo, loadMSGFResults, loadScanStats : false)
 {
 }