Пример #1
0
        internal static ProteinChange GetProteinChange(int start, string refAminoAcids, string altAminoAcids,
                                                       string peptideSeq, IVariantEffect variantEffect)
        {
            if (refAminoAcids == altAminoAcids ||
                variantEffect.IsStopRetained())
            {
                return(ProteinChange.None);
            }

            //insertion before the transcript
            if (refAminoAcids.Length == 0 && start == 1)
            {
                return(ProteinChange.None);
            }

            if (variantEffect.IsStartLost())
            {
                return(ProteinChange.StartLost);
            }

            // todo: add start gained
            // according to var nom, only if the Stop codon is effected, we call it an extension
            if (variantEffect.IsStopLost() && refAminoAcids.StartsWith(AminoAcids.StopCodon))
            {
                return(ProteinChange.Extension);
            }

            if (variantEffect.IsFrameshiftVariant())
            {
                return(ProteinChange.Frameshift);
            }


            if (altAminoAcids.Length > refAminoAcids.Length && HgvsUtilities.IsAminoAcidDuplicate(start, altAminoAcids, peptideSeq))
            {
                return(ProteinChange.Duplication);
            }

            if (refAminoAcids.Length == 0 && altAminoAcids.Length != 0)
            {
                return(ProteinChange.Insertion);
            }

            if (refAminoAcids.Length != 0 && altAminoAcids.Length == 0)
            {
                return(ProteinChange.Deletion);
            }

            if (refAminoAcids.Length == 1 && altAminoAcids.Length == 1)
            {
                return(ProteinChange.Substitution);
            }

            // the only remaining possibility is deletions/insertions
            return(ProteinChange.DelIns);
        }
        private static List <ConsequenceTag> GetConsequences(IInterval transcript, IVariant variant,
                                                             IVariantEffect variantEffect)
        {
            var featureEffect = new FeatureVariantEffects(transcript, variant.Type, variant,
                                                          variant.IsStructuralVariant);

            var consequence = new Consequences(variantEffect, featureEffect);

            consequence.DetermineSmallVariantEffects();
            return(consequence.GetConsequences());
        }
Пример #3
0
        private static List <ConsequenceTag> GetConsequences(IInterval transcript, bool onReverseStrand, IVariant variant,
                                                             IVariantEffect variantEffect)
        {
            OverlapType         overlapType         = Intervals.Utilities.GetOverlapType(transcript.Start, transcript.End, variant.Start, variant.End);
            EndpointOverlapType endpointOverlapType = Intervals.Utilities.GetEndpointOverlapType(transcript.Start, transcript.End, variant.Start, variant.End);
            var featureEffect = new FeatureVariantEffects(overlapType, endpointOverlapType, onReverseStrand, variant.Type, variant.IsStructuralVariant);

            var consequence = new Consequences(variant.Type, variantEffect, featureEffect);

            consequence.DetermineSmallVariantEffects();
            return(consequence.GetConsequences());
        }
Пример #4
0
 public Consequences(IVariantEffect variantEffect = null, IFeatureVariantEffects featureEffect = null)
 {
     _consequences  = new List <ConsequenceTag>();
     _variantEffect = variantEffect;
     _featureEffect = featureEffect;
 }