Example #1
0
        private static void WriteGeneralAttributes(TextWriter writer, Transcript transcript)
        {
            var geneId = transcript.TranscriptSource == TranscriptDataSource.Ensembl
                ? transcript.Gene.EnsemblId.ToString()
                : transcript.Gene.EntrezGeneId.ToString();

            if (!string.IsNullOrEmpty(geneId))
            {
                writer.Write($"gene_id \"{geneId}\"; ");
            }
            if (!string.IsNullOrEmpty(transcript.Gene.Symbol))
            {
                writer.Write($"gene_name \"{transcript.Gene.Symbol}\"; ");
            }

            if (!transcript.Id.IsEmpty)
            {
                writer.Write($"transcript_id \"{FormatUtilities.CombineIdAndVersion(transcript.Id, transcript.Version)}\"; ");
            }
            writer.Write($"transcript_type \"{BioTypeUtilities.GetBiotypeDescription(transcript.BioType)}\"; ");

            if (transcript.IsCanonical)
            {
                writer.Write("tag \"canonical\"; ");
            }

            if (!string.IsNullOrEmpty(transcript.Translation?.ProteinId.ToString()))
            {
                writer.Write($"protein_id \"{FormatUtilities.CombineIdAndVersion(transcript.Translation.ProteinId, transcript.Translation.ProteinVersion)}\"; ");
            }
        }
Example #2
0
        public void CreateAnnotationObject(Transcript transcript, VariantAlternateAllele altAllele)
        {
            FindCorrespondingJsonVariant(altAllele);

            if (_currPianoAllele == null)
            {
                throw new GeneralException("Cannot find jsonVariant corresponding to alternate allele");
            }

            _currTranscript = new PianoAllele.Transcript
            {
                IsCanonical  = transcript.IsCanonical ? "true" : null,
                TranscriptID = transcript.Id.ToString(),
                BioType      = BioTypeUtilities.GetBiotypeDescription(transcript.BioType),
                Gene         = transcript.TranscriptSource == TranscriptDataSource.Ensembl ? transcript.Gene.EnsemblId.ToString() : transcript.Gene.EntrezGeneId.ToString(),
                Hgnc         = transcript.Gene.Symbol
            };
        }
Example #3
0
        public void AddFlankingTranscript(Transcript transcript, TranscriptAnnotation ta, string[] consequences)
        {
            _currTranscript = new JsonVariant.Transcript
            {
                IsCanonical  = transcript.IsCanonical ? TrueTag : null,
                Consequence  = consequences,
                ProteinID    = ta.HasValidCdnaCodingStart ? TranscriptUtilities.GetProteinId(transcript) : null,
                TranscriptID = TranscriptUtilities.GetTranscriptId(transcript),
                BioType      = BioTypeUtilities.GetBiotypeDescription(transcript.BioType),
                Gene         = transcript.TranscriptSource == TranscriptDataSource.Ensembl ? transcript.Gene.EnsemblId.ToString() : transcript.Gene.EntrezGeneId.ToString(),
                Hgnc         = transcript.Gene.Symbol
            };

            if (ta.HasValidCdnaStart && ta.HasValidCdnaEnd)
            {
                _currTranscript.ComplementaryDnaPosition = GetCdnaRangeString(ta);
            }

            _currJsonVariant.AddTranscript(_currTranscript, transcript.TranscriptSource);
        }
Example #4
0
        public void CreateAnnotationObject(Transcript transcript, VariantAlternateAllele altAllele)
        {
            // while annotating alternate allele, the first output function to be called is AddExonData.
            // So, we set the current json variant and transcript here.
            // they will subsequently be used in other output functions.
            FindCorrespondingJsonVariant(altAllele);

            if (_currJsonVariant == null)
            {
                throw new GeneralException("Cannot find jsonVariant corresponding to alternate allele");
            }

            _currTranscript = new JsonVariant.Transcript
            {
                IsCanonical  = transcript.IsCanonical ? TrueTag : null,
                TranscriptID = TranscriptUtilities.GetTranscriptId(transcript),
                BioType      = BioTypeUtilities.GetBiotypeDescription(transcript.BioType),
                Gene         = transcript.TranscriptSource == TranscriptDataSource.Ensembl ? transcript.Gene.EnsemblId.ToString() : transcript.Gene.EntrezGeneId.ToString(),
                Hgnc         = transcript.Gene.Symbol
            };
        }
Example #5
0
 private static void TranscriptDump(DataStructures.VEP.Transcript t)
 {
     Console.WriteLine("==================================");
     Console.WriteLine($"ReferenceIndex:     {t.ReferenceIndex}");
     Console.WriteLine($"Start:              {t.Start}");
     Console.WriteLine($"End:                {t.End}");
     Console.WriteLine($"BioType:            {BioTypeUtilities.GetBiotypeDescription(t.BioType)}");
     Console.WriteLine($"OnReverseStrand:    {t.OnReverseStrand}");
     Console.WriteLine($"IsCanonical:        {t.IsCanonical}");
     Console.WriteLine($"CompDnaCodingStart: {t.CompDnaCodingStart}");
     Console.WriteLine($"CompDnaCodingEnd:   {t.CompDnaCodingEnd}");
     Console.WriteLine($"Version:            {t.Version}");
     Console.WriteLine($"CcdsId:             {t.CcdsId}");
     Console.WriteLine($"DatabaseId:         {t.DatabaseId}");
     Console.WriteLine($"ProteinId:          {t.ProteinId}");
     Console.WriteLine($"RefSeqId:           {t.RefSeqId}");
     Console.WriteLine($"GeneStableId:       {t.GeneStableId}");
     Console.WriteLine($"StableId:           {t.StableId}");
     Console.WriteLine($"GeneSymbol:         {t.GeneSymbol}");
     Console.WriteLine($"GeneSymbolSource:   {t.GeneSymbolSource}");
     Console.WriteLine($"HgncId:             {t.HgncId}");
     Console.WriteLine("==================================");
 }
Example #6
0
 /// <summary>
 /// returns the biotype given the specialized string key/value type
 /// </summary>
 public static BioType GetBiotype(AbstractData ad)
 {
     return(BioTypeUtilities.GetBiotypeFromString(DumperUtilities.GetString(ad)));
 }