Exemplo n.º 1
0
        public IndexedDatabase(FastaDatabase fastaDatabase)
        {
            FastaDatabase = fastaDatabase;
            var databaseFilePath = FastaDatabase.GetFastaFilePath();
            //var databaseFilePathNoExt = Path.Combine(Path.GetDirectoryName(databaseFilePath), Path.GetFileNameWithoutExtension(databaseFilePath));
            //_pLcpFilePath = databaseFilePathNoExt + PermutedLongestCommonPrefixFileExtension;
            _pLcpFilePath = Path.ChangeExtension(databaseFilePath, PermutedLongestCommonPrefixFileExtension);
            var lastWriteTimeHash = FastaDatabase.GetLastWriteTimeHash();

            if (!File.Exists(_pLcpFilePath) || !FastaDatabase.CheckHashCodeBinaryFile(_pLcpFilePath, lastWriteTimeHash))
            {
                Console.Write("Generating " + _pLcpFilePath + " ... ");
                CreatePermutedLongestCommonPrefixFile();
                Console.WriteLine("Done");
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor - build the index
        /// </summary>
        /// <param name="fastaDatabase"></param>
        public IndexedDatabase(FastaDatabase fastaDatabase)
        {
            FastaDatabase = fastaDatabase;
            var databaseFilePath = FastaDatabase.GetFastaFilePath();

            //var databaseFilePathNoExt = Path.Combine(Path.GetDirectoryName(databaseFilePath), Path.GetFileNameWithoutExtension(databaseFilePath));
            //_pLcpFilePath = databaseFilePathNoExt + PermutedLongestCommonPrefixFileExtension;
            _pLcpFilePath = Path.ChangeExtension(databaseFilePath, PermutedLongestCommonPrefixFileExtension);
            var lastWriteTimeHash = FastaDatabase.GetLastWriteTimeHash();

            if (!File.Exists(_pLcpFilePath) || !FastaDatabase.CheckHashCodeBinaryFile(_pLcpFilePath, lastWriteTimeHash))
            {
                Console.Write("Generating " + _pLcpFilePath + " ... ");
                CreatePermutedLongestCommonPrefixFile();
                Console.WriteLine("Done");
            }
        }