/// <summary>
 /// Codon change string (if it's not too long)
 /// </summary>
 /// <returns></returns>
 public string GetCodonChangeMax()
 {
     if (Variant.Length() > MAX_CODON_SEQUENCE_LEN)
     {
         return("");
     }                                                            // Cap length in order not to make VCF files grow too much
     if (CodonsRef == "" && CodonsAlt == "")
     {
         return("");
     }
     return(CodonsRef + "/" + CodonsAlt);
 }
示例#2
0
        /// <summary>
        /// We may have to calculate 'netCdsChange', which is the effect on the CDS.
        /// Note: A deletion or a MNP might affect several exons
        /// </summary>
        /// <returns></returns>
        protected override string NetCdsChange()
        {
            if (Variant.Length() > 1)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Exon exon in Transcript.ExonsSortedStrand)
                {
                    string seq = Variant.NetChange(exon);
                    sb.Append(exon.IsStrandPlus() ? seq : SequenceExtensions.ConvertToString(new Sequence(Alphabets.AmbiguousDNA, seq).GetReverseComplementedSequence()));
                }
                return(sb.ToString());
            }

            return(Variant.NetChange(Transcript.IsStrandPlus()));
        }
示例#3
0
        /// <summary>
        /// We may have to calculate 'netCdsChange', which is the effect on the CDS.
        /// Note: A deletion or a MNP might affect several exons
        /// </summary>
        /// <returns></returns>
        protected virtual string NetCdsChange()
        {
            if (!RequireNetCdsChange)
            {
                return("");
            }

            if (Variant.Length() > 1)
            {
                StringBuilder sb = new StringBuilder();
                foreach (Exon exon in Transcript.ExonsSortedStrand)
                {
                    sb.Append(Variant.NetChange(exon));
                }
                return(sb.ToString());
            }

            return(Variant.NetChange(Transcript.IsStrandMinus()));
        }
示例#4
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();
        }