예제 #1
0
        protected void ApplyDup(Variant variant, IntervalSequence markerSeq)
        {
            // Get sequence in positive strand direction
            ISequence seq = IsStrandPlus() ? Sequence : Sequence.GetReverseComplementedSequence();

            // Apply duplication to sequence
            String dupSeq = SequenceExtensions.ConvertToString(GetSequence(Intersect(variant)));
            long   idx    = variant.OneBasedStart - OneBasedStart - 1;

            if (idx >= 0)
            {
                seq = new Sequence(seq.Alphabet, SequenceExtensions.ConvertToString(seq, 0, idx + 1) + dupSeq + SequenceExtensions.ConvertToString(seq, idx + 1));
            }
            else
            {
                seq = new Sequence(seq.Alphabet, dupSeq + SequenceExtensions.ConvertToString(seq));
            }

            // Update sequence
            markerSeq.Sequence = IsStrandPlus() ? seq : seq.GetReverseComplementedSequence();
        }
예제 #2
0
        protected void ApplyIns(Variant variant, IntervalSequence markerSeq)
        {
            // Get sequence in positive strand direction
            ISequence seq = IsStrandPlus() ? Sequence : Sequence.GetReverseComplementedSequence();

            // Apply change to sequence
            String netChange = variant.NetChange(this);
            long   idx       = variant.OneBasedStart - OneBasedStart - 1;

            if (idx >= 0)
            {
                seq = new Sequence(seq.Alphabet, SequenceExtensions.ConvertToString(seq, 0, idx + 1) + netChange + SequenceExtensions.ConvertToString(seq, idx + 1));
            }
            else
            {
                seq = new Sequence(seq.Alphabet, netChange + SequenceExtensions.ConvertToString(seq));
            }

            // Update sequence
            markerSeq.Sequence = IsStrandPlus() ? seq : seq.GetReverseComplementedSequence();
        }
예제 #3
0
        protected void ApplyDel(Variant variant, IntervalSequence markerSeq)
        {
            // Get sequence in positive strand direction
            ISequence seq = IsStrandPlus() ? Sequence : Sequence.GetReverseComplementedSequence();

            // Apply change to sequence
            long idxStart = variant.OneBasedStart - OneBasedStart;
            long idxEnd   = idxStart + variant.Length();

            StringBuilder newSeq = new StringBuilder();

            if (idxStart >= 0)
            {
                newSeq.Append(SequenceExtensions.ConvertToString(seq, 0, idxStart));
            }
            if (idxEnd >= 0 && idxEnd < seq.Count)
            {
                newSeq.Append(SequenceExtensions.ConvertToString(seq));
            }

            // Update sequence
            seq = new Sequence(seq.Alphabet, newSeq.ToString());
            markerSeq.Sequence = IsStrandPlus() ? seq : seq.GetReverseComplementedSequence();
        }
예제 #4
0
        /// <summary>
        /// Apply a variant to this exon interval and sequence
        /// </summary>
        /// <param name="variant"></param>
        /// <returns></returns>
        public override Interval ApplyVariant(Variant variant)
        {
            IntervalSequence i = base.ApplyVariant(variant) as IntervalSequence;

            return(new Exon(i.Parent as Transcript, i.Sequence, i.Source, i.OneBasedStart, i.OneBasedEnd, i.ChromosomeID, i.Strand, i.Variants, FeatureMetadata));
        }