Пример #1
0
        public BufferedPositions Purge()
        {
            var copyOfBuffer = BufferedPositions;

            BufferedPositions = BufferedPositions.CreatEmptyBufferedPositions();
            return(copyOfBuffer);
        }
Пример #2
0
        }                                                         // used to find overlap genes for now

        public PositionBuffer(ICodonInfoProvider codonInfoProvider, IIntervalForest <IGene> geneIntervalForest)
        {
            CodonInfoProvider  = codonInfoProvider;
            GeneIntervalForest = geneIntervalForest;
            CurrentChromosome  = new EmptyChromosome(string.Empty);
            BufferedPositions  = BufferedPositions.CreatEmptyBufferedPositions();
        }
Пример #3
0
        private void ResetBuffer(ISimplePosition simplePosition, bool recomposable)
        {
            var functionBlockRanges = recomposable ? new List <int> {
                CodonInfoProvider.GetFunctionBlockRanges(simplePosition)
            } : new List <int>();

            BufferedPositions = new BufferedPositions(new List <ISimplePosition> {
                simplePosition
            }, new List <bool> {
                recomposable
            }, functionBlockRanges);
            CurrentChromosome = simplePosition.Chromosome;
        }
Пример #4
0
        public BufferedPositions AddPosition(ISimplePosition simplePosition)
        {
            bool recomposable          = IsRecomposable(simplePosition);
            bool isPositionWithinRange = !simplePosition.Chromosome.IsEmpty() && PositionWithinRange(simplePosition);

            if (isPositionWithinRange)
            {
                BufferedPositions.SimplePositions.Add(simplePosition);
                BufferedPositions.Recomposable.Add(recomposable);
                if (recomposable)
                {
                    UpdateFunctionBlockRanges(simplePosition);
                }
                return(BufferedPositions.CreatEmptyBufferedPositions());
            }
            var copyOfBuffer = BufferedPositions;

            ResetBuffer(simplePosition, recomposable);
            return(copyOfBuffer);
        }