Beispiel #1
0
        public override bool CreateVariantEffect(Variant variant, VariantEffects variantEffects)
        {
            // Has the whole UTR been deleted?
            if (variant.Includes(this) && variant.VarType == Variant.VariantType.DEL)
            {
                variantEffects.AddEffect(variant, this, EffectType.UTR_5_DELETED, ""); // A UTR was removed entirely
                return(true);
            }

            // Add distance
            Transcript    tr            = (Transcript)FindParent(typeof(Transcript));
            long          distance      = utrDistance(variant, tr);
            VariantEffect variantEffect = new VariantEffect(variant);

            variantEffect.Set(this, IntervalType, EffectTypeMethods.EffectDictionary[IntervalType], distance >= 0 ? distance + " bases from TSS" : "");
            variantEffect.Distance = distance;
            variantEffects.AddEffect(variantEffect);

            // Start gained?
            string gained = startGained(variant);

            if (gained != "")
            {
                variantEffects.AddEffect(variant, this, EffectType.START_GAINED, gained);
            }

            return(true);
        }
Beispiel #2
0
        /// <summary>
        /// Add an effect
        /// </summary>
        /// <param name="marker"></param>
        /// <param name="effectType"></param>
        /// <param name="effectImpact"></param>
        /// <param name="codonsOld"></param>
        /// <param name="codonsNew"></param>
        /// <param name="codonNum"></param>
        /// <param name="codonIndex"></param>
        /// <param name="allowReplace"></param>
        /// <returns></returns>
        private VariantEffect Effect(Interval marker, EffectType effectType, EffectImpact effectImpact, string codonsOld, string codonsNew, int codonNum, int codonIndex, bool allowReplace)
        {
            // Create and add variant affect
            long          cDnaPos = Transcript.BaseNumber2MRnaPos(Variant.OneBasedStart);
            VariantEffect varEff  = new VariantEffect(Variant, marker, effectType, effectImpact, codonsOld, codonsNew, codonNum, codonIndex, cDnaPos);

            VariantEffects.AddEffect(varEff);

            // Are there any additional effects? Sometimes a new effect arises from setting codons (e.g. FRAME_SHIFT disrupts a STOP codon)
            EffectType addEffType = AdditionalEffect(codonsOld, codonsNew, codonNum, codonIndex);

            if (addEffType != EffectType.NONE && addEffType != effectType)
            {
                if (allowReplace && addEffType.CompareTo(effectType) < 0)
                {
                    // Replace main effect (using default impact)
                    varEff.SetEffect(addEffType);
                }
                else
                {
                    // Add effect to list (using default impact)
                    varEff.AddEffect(addEffType);
                }
            }

            return(varEff);
        }
Beispiel #3
0
        public override bool CreateVariantEffect(Variant variant, VariantEffects variantEffects)
        {
            if (!Intersects(variant))
            {
                return(false);
            }

            Transcript tr     = (Transcript)Parent;
            bool       coding = tr.IsProteinCoding();

            // Different analysis for coding or non-coding
            bool exonAnnotated = false;

            if (!coding || variant.isInterval() || !variant.isVariant())
            {
                // Non-coding or non-variant? Just annotate as 'exon'
                variantEffects.AddEffect(variant, this, EffectType.EXON, "");
                exonAnnotated = true;
            }
            else if (tr.IsCds(variant))
            {
                // Is it a coding transcript and the variant is within the CDS?
                // => We need codon analysis
                CodonChange codonChange = CodonChange.Factory(variant, tr, variantEffects);
                codonChange.ChangeCodon();
                exonAnnotated = true;
            }

            // Any splice site effect to add?
            //for (SpliceSite ss : spliceSites)
            //    if (ss.intersects(variant)) ss.variantEffect(variant, variantEffects);

            return(exonAnnotated);
        }
 /// <summary>
 /// Calculate the effect of this variant
 /// </summary>
 /// <param name="variant"></param>
 /// <param name="variantEffects"></param>
 /// <returns></returns>
 public virtual bool CreateVariantEffect(Variant variant, VariantEffects variantEffects)
 {
     if (!Intersects(variant))
     {
         return(false);
     }
     variantEffects.AddEffect(variant, this, IntervalType, "");
     return(true);
 }
Beispiel #5
0
        public override bool CreateVariantEffect(Variant variant, VariantEffects variantEffects)
        {
            if (!Intersects(variant))
            {
                return(false);
            }

            if (variant.Includes(this) && variant.VarType == Variant.VariantType.DEL)
            {
                variantEffects.AddEffectType(variant, this, EffectType.UTR_3_DELETED); // A UTR was removed entirely
                return(true);
            }

            Transcript tr       = (Transcript)FindParent(typeof(Transcript));
            long       distance = utrDistance(variant, tr);

            VariantEffect variantEffect = new VariantEffect(variant);

            variantEffect.Set(this, EffectType.UTR_3_PRIME, EffectTypeMethods.EffectDictionary[EffectType.UTR_3_PRIME], distance >= 0 ? distance + " bases from CDS" : "");
            variantEffect.Distance = distance;
            variantEffects.AddEffect(variantEffect);

            return(true);
        }