public override string GetGtfAttributes() { var attributes = GeneModel.SplitAttributes(FeatureMetadata.FreeText); List <Tuple <string, string> > attributeSubsections = new List <Tuple <string, string> >(); string exonIdLabel = "exon_id"; bool hasExonId = attributes.TryGetValue(exonIdLabel, out string exonId); if (hasExonId) { attributeSubsections.Add(new Tuple <string, string>(exonIdLabel, exonId)); } string exonVersionLabel = "exon_version"; bool hasExonVersion = attributes.TryGetValue(exonVersionLabel, out string exonVersion); if (hasExonVersion) { attributeSubsections.Add(new Tuple <string, string>(exonVersionLabel, exonVersion)); } string exonNumberLabel = "exon_number"; string exonNumber = (Parent as Transcript).Exons.Count(x => x.OneBasedStart <= OneBasedStart).ToString(); attributeSubsections.Add(new Tuple <string, string>(exonNumberLabel, exonNumber)); return(Parent.GetGtfAttributes() + " " + String.Join(" ", attributeSubsections.Select(x => x.Item1 + " \"" + x.Item2 + "\";"))); }
public override string GetGtfAttributes() { var attributes = GeneModel.SplitAttributes(FeatureMetadata.FreeText); List <Tuple <string, string> > attributeSubsections = new List <Tuple <string, string> >(); string tIdLabel = "transcript_id"; bool hasTranscriptId = attributes.TryGetValue(tIdLabel, out string transcriptId); if (hasTranscriptId) { attributeSubsections.Add(new Tuple <string, string>(tIdLabel, transcriptId)); } string tVersionLabel = "transcript_version"; bool hasTranscriptVersion = attributes.TryGetValue(tVersionLabel, out string transcriptVersion); if (hasTranscriptVersion) { attributeSubsections.Add(new Tuple <string, string>(tVersionLabel, transcriptVersion)); } string tBiotypeLabel = "transcript_biotype"; bool hasTranscriptBiotype = attributes.TryGetValue(tBiotypeLabel, out string transcriptBiotype); if (hasTranscriptVersion) { attributeSubsections.Add(new Tuple <string, string>(tBiotypeLabel, transcriptBiotype)); } // Cufflinks-related, but not using Cufflinks much because stringtie is better //bool hasNearestRef = attributes.TryGetValue("nearest_ref", out string nearestRef); //bool hasClassCode = attributes.TryGetValue("class_code", out string classCode); bool hasSource = FeatureMetadata.SubItems.TryGetValue("source", out List <string> sourceish); bool hasStrand = FeatureMetadata.SubItems.TryGetValue("strand", out List <string> strandish); bool hasFrame = FeatureMetadata.SubItems.TryGetValue("frame", out List <string> framey); return(Parent.GetGtfAttributes() + " " + String.Join(" ", attributeSubsections.Select(x => x.Item1 + " \"" + x.Item2 + "\";"))); }
public override string GetGtfAttributes() { var attributes = GeneModel.SplitAttributes(FeatureMetadata.FreeText); List <Tuple <string, string> > attributeSubsections = new List <Tuple <string, string> >(); string geneIdLabel = "gene_id"; bool hasGeneId = attributes.TryGetValue(geneIdLabel, out string geneId); if (hasGeneId) { attributeSubsections.Add(new Tuple <string, string>(geneIdLabel, geneId)); } string geneNameLabel = "gene_name"; bool hasGeneName = attributes.TryGetValue(geneNameLabel, out string geneName); if (hasGeneName) { attributeSubsections.Add(new Tuple <string, string>(geneNameLabel, geneName)); } string geneVersionLabel = "gene_version"; bool hasGeneVersion = attributes.TryGetValue(geneVersionLabel, out string geneVersion); if (hasGeneVersion) { attributeSubsections.Add(new Tuple <string, string>(geneVersionLabel, geneVersion)); } string geneBiotypeLabel = "gene_biotype"; bool hasGeneBiotype = attributes.TryGetValue(geneBiotypeLabel, out string geneBiotype); if (hasGeneBiotype) { attributeSubsections.Add(new Tuple <string, string>(geneBiotypeLabel, geneBiotype)); } return(String.Join(" ", attributeSubsections.Select(x => x.Item1 + " \"" + x.Item2 + "\";"))); }