Exemplo n.º 1
0
        /// <summary>
        /// Creates upstream and downstream intervals for this transcript
        /// </summary>
        /// <param name="chromosomeSequence"></param>
        public List <Interval> CreateUpDown(Chromosome chromosomeSequence)
        {
            long chrMin = 1;
            long chrMax = chromosomeSequence.Sequence.Count;

            // Create up/down stream intervals and add them to the list
            long beforeStart = Math.Max(chrMin - DEFAULT_UP_DOWN_LENGTH, chrMin);
            long beforeEnd   = Math.Max(chrMin - 1, chrMin);
            long afterStart  = Math.Min(OneBasedEnd + 1, chrMax);
            long afterEnd    = Math.Min(OneBasedEnd + DEFAULT_UP_DOWN_LENGTH, chrMax);

            if (IsStrandPlus())
            {
                if (beforeStart < beforeEnd)
                {
                    Upstream = new Upstream(this, chromosomeSequence.ChromosomeID, Source, Strand, beforeStart, beforeEnd);
                }
                if (afterStart < afterEnd)
                {
                    Downstream = new Downstream(this, chromosomeSequence.ChromosomeID, Source, Strand, afterStart, afterEnd);
                }
            }
            else
            {
                if (afterStart < afterEnd)
                {
                    Upstream = new Upstream(this, chromosomeSequence.ChromosomeID, Source, Strand, afterStart, afterEnd);
                }
                if (beforeStart < beforeEnd)
                {
                    Downstream = new Downstream(this, chromosomeSequence.ChromosomeID, Source, Strand, beforeStart, beforeEnd);
                }
            }

            return(new List <Interval> {
                Upstream, Downstream
            });
        }
Exemplo n.º 2
0
 public Upstream(Downstream downstream)
     : base(downstream)
 {
 }