/// <summary>
        /// Show a string with overall effect
        /// </summary>
        /// <param name="shortFormat"></param>
        /// <param name="showAaChange"></param>
        /// <param name="showBioType"></param>
        /// <param name="useSeqOntology"></param>
        /// <param name="useFirstEffect"></param>
        /// <returns></returns>
        public string Effect(bool shortFormat, bool showAaChange, bool showBioType, bool useSeqOntology, bool useFirstEffect)
        {
            string effectString = "";
            string codonEffect  = CodonEffect(showAaChange, showBioType, useFirstEffect); // Codon effect

            if (codonEffect != "")
            {
                effectString = codonEffect;
            }
            else if (EffectTypeMethods.IsIntergenic(EffectTypes) || EffectTypeMethods.IsIntron(EffectTypes) || EffectTypeMethods.IsSpliceSite(EffectTypes))
            {
                effectString = EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes);
            }
            else if (Message != "")
            {
                effectString = EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes) + ": " + Message;
            }
            else if (Marker == null)
            {
                // There are cases when no marker is associated (e.g. "Out of chromosome", "No such chromosome", etc.)
                effectString = EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes);
            }
            else
            {
                effectString = EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes); // + ": " + marker.getId();
            }

            if (shortFormat)
            {
                effectString = effectString.Split(':')[0];
            }

            return(effectString);
        }
        public string GetGeneRegion()
        {
            EffectType eff = EffectTypeMethods.GetGeneRegion(GetEffectType());

            if (eff == EffectType.TRANSCRIPT && EffectTypeMethods.IsExon(Marker, EffectTypes))
            {
                eff = EffectType.EXON;
            }
            return(eff.ToString());
        }
示例#3
0
        public override string ToString()
        {
            StringBuilder sb = new StringBuilder();

            sb.Append("Transcript : " + Transcript.ID + "\n");
            sb.Append("Variant    : " + Variant + "\n");
            sb.Append("Codons     : " + CodonsReference + "/" + CodonsAlternate + "\tnum: " + CodonStartNumber + "\tidx: " + CodonStartIndex + "\n");
            sb.Append("Effects    :\n");
            foreach (VariantEffect veff in VariantEffects.Effects)
            {
                sb.Append(
                    "\t" + EffectTypeMethods.GetEffectTypeString(false, veff.EffectTypes) +
                    "\t" + veff.CodonsRef + "/" + veff.CodonsAlt +
                    "\t" + veff.ReferenceAA + "/" + veff.AlternateAA + "\n");
            }

            return(sb.ToString());
        }
        /// <summary>
        /// Create a string for codon effect
        /// @param showAaChange : If true, include codon change, biotype, etc.
        /// </summary>
        /// <param name="showAaChange"></param>
        /// <param name="showBioType"></param>
        /// <param name="useSeqOntology"></param>
        /// <param name="useFirstEffect"></param>
        /// <returns></returns>
        private string CodonEffect(bool showAaChange, bool showBioType, bool useFirstEffect)
        {
            if ((Marker == null) || (CodonNum < 0))
            {
                return("");
            }

            if (!showAaChange)
            {
                return(EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes));
            }

            StringBuilder sb = new StringBuilder();

            sb.Append(EffectTypeMethods.GetEffectTypeString(useFirstEffect, EffectTypes));
            sb.Append("(");
            sb.Append(GetAaChange());
            sb.Append(")");

            return(sb.ToString());
        }