Пример #1
0
        private List <PredictionCache> GetMergedPredictions(string path1, string path2)
        {
            var mergedPredictions = new List <PredictionCache>();

            using (var reader1 = new PredictionCacheReader(FileUtilities.GetReadStream(path1)))
                using (var reader2 = new PredictionCacheReader(FileUtilities.GetReadStream(path2)))
                {
                    _genomeAssembly = reader1.FileHeader.GenomeAssembly;
                    _numRefSeq      = reader1.FileHeader.Index.Size;

                    if (_genomeAssembly != reader2.FileHeader.GenomeAssembly)
                    {
                        throw  new UserErrorException($"Observed different genome assemblies: {reader1.FileHeader.GenomeAssembly}, {reader2.FileHeader.GenomeAssembly}");
                    }

                    for (ushort i = 0; i < _numRefSeq; i++)
                    {
                        var cache1 = reader1.Read(i);
                        var cache2 = reader2.Read(i);

                        if (cache1 == PredictionCache.Empty ^ cache2 == PredictionCache.Empty)
                        {
                            throw new DataMisalignedException("one of the cache ran out before the other");
                        }
                        mergedPredictions.Add(cache1.GetMergedCache(cache2));
                    }
                    //todo: take care of ref sequences unique to one cache
                }
            return(mergedPredictions);
        }
Пример #2
0
        public void Load(ushort refIndex)
        {
            if (refIndex == CurrentRefIndex)
            {
                return;
            }

            SequenceReader.GetCompressedSequence(Sequence.Renamer.EnsemblReferenceNames[refIndex]);
            SiftCache     = SiftReader.Read(refIndex);
            PolyPhenCache = PolyPhenReader.Read(refIndex);

            CurrentRefIndex = refIndex;
        }
 private void LoadPredictionCaches(ushort refIndex)
 {
     if (refIndex == _currentRefIndex)
     {
         return;
     }
     if (refIndex == ushort.MaxValue)
     {
         ClearCache();
         return;
     }
     _siftCache       = _siftReader.Read(refIndex);
     _polyphenCache   = _polyphenReader.Read(refIndex);
     _currentRefIndex = refIndex;
 }
Пример #4
0
        private Dictionary <ushort, int> GetPredictionMatrixCount(string path)
        {
            var countPerRefSeq = new Dictionary <ushort, int>();

            using (var reader1 = new PredictionCacheReader(FileUtilities.GetReadStream(path)))
            {
                _numRefSeq = reader1.FileHeader.Index.Size;
                for (ushort i = 0; i < _numRefSeq; i++)
                {
                    var cache1 = reader1.Read(i);

                    countPerRefSeq[i] = cache1.PredictionCount;
                }
            }
            return(countPerRefSeq);
        }