/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="inputDirectoryPath">Input directory path</param>
        /// <param name="resultToSeqMapFilename">ResultToSeqMap filename</param>
        /// <param name="seqToProteinMapFilename"></param>
        /// <param name="seqInfoFilename">SeqInfo filename</param>
        public PHRPSeqMapReader(string inputDirectoryPath, string resultToSeqMapFilename, string seqToProteinMapFilename, string seqInfoFilename)
        {
            InputDirectoryPath = inputDirectoryPath;

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

            PeptideHitResultType = ReaderFactory.AutoDetermineResultType(resultToSeqMapFilename);
            if (PeptideHitResultType == PeptideHitResultTypes.Unknown)
            {
                ErrorMessage = "Unable to auto-determine the PeptideHit result type based on filename " + resultToSeqMapFilename;
                throw new Exception(ErrorMessage);
            }

            DatasetName = ReaderFactory.AutoDetermineDatasetName(resultToSeqMapFilename);
            if (string.IsNullOrEmpty(DatasetName))
            {
                ErrorMessage = "Unable to auto-determine the dataset name using filename '" + resultToSeqMapFilename + "'";
                throw new Exception(ErrorMessage);
            }

            ResultToSeqMapFilename  = resultToSeqMapFilename;
            SeqToProteinMapFilename = seqToProteinMapFilename;
            mSeqInfoFilename        = seqInfoFilename;

            MaxProteinsPerSeqID = 0;
        }
Esempio n. 2
0
 public static string AutoDetermineDatasetName(string filePath, PeptideHitResultTypes resultType)
 {
     return(ReaderFactory.AutoDetermineDatasetName(filePath, resultType));
 }