///|
fn biotype_ref(
name : String,
family : String,
coding : Bool,
description : String,
) -> BiotypeReference {
{ name, family, coding, description }
}
///|
pub fn reference_biotypes() -> Array[BiotypeReference] {
[
biotype_ref(
"protein_coding", "coding", true, "Transcript or gene expected to encode a protein",
),
biotype_ref(
"nonsense_mediated_decay", "coding", true, "Coding transcript candidate targeted by NMD",
),
biotype_ref(
"non_stop_decay", "coding", true, "Coding transcript candidate targeted by non-stop decay",
),
biotype_ref(
"polymorphic_pseudogene", "coding", true, "Pseudogene with coding polymorphism evidence",
),
biotype_ref(
"IG_C_gene", "immune", true, "Immunoglobulin constant region gene",
),
biotype_ref(
"IG_D_gene", "immune", true, "Immunoglobulin diversity region gene",
),
biotype_ref(
"IG_J_gene", "immune", true, "Immunoglobulin joining region gene",
),
biotype_ref(
"IG_V_gene", "immune", true, "Immunoglobulin variable region gene",
),
biotype_ref(
"TR_C_gene", "immune", true, "T-cell receptor constant region gene",
),
biotype_ref(
"TR_D_gene", "immune", true, "T-cell receptor diversity region gene",
),
biotype_ref(
"TR_J_gene", "immune", true, "T-cell receptor joining region gene",
),
biotype_ref(
"TR_V_gene", "immune", true, "T-cell receptor variable region gene",
),
biotype_ref("lncRNA", "long_noncoding", false, "Long non-coding RNA"),
biotype_ref(
"lincRNA", "long_noncoding", false, "Long intergenic non-coding RNA",
),
biotype_ref(
"antisense", "long_noncoding", false, "Antisense long non-coding RNA",
),
biotype_ref(
"sense_intronic", "long_noncoding", false, "Sense intronic long non-coding RNA",
),
biotype_ref(
"sense_overlapping", "long_noncoding", false, "Sense overlapping long non-coding RNA",
),
biotype_ref(
"processed_transcript", "long_noncoding", false, "Processed transcript without CDS annotation",
),
biotype_ref(
"macro_lncRNA", "long_noncoding", false, "Large long non-coding RNA locus",
),
biotype_ref(
"bidirectional_promoter_lncRNA", "long_noncoding", false, "lncRNA near bidirectional promoter",
),
biotype_ref(
"3prime_overlapping_ncRNA", "long_noncoding", false, "Non-coding RNA overlapping 3 prime region",
),
biotype_ref("miRNA", "small_noncoding", false, "Micro RNA"),
biotype_ref("snoRNA", "small_noncoding", false, "Small nucleolar RNA"),
biotype_ref("snRNA", "small_noncoding", false, "Small nuclear RNA"),
biotype_ref(
"scaRNA", "small_noncoding", false, "Small Cajal body-specific RNA",
),
biotype_ref("rRNA", "structural_rna", false, "Ribosomal RNA"),
biotype_ref(
"rRNA_pseudogene", "pseudogene", false, "Ribosomal RNA pseudogene",
),
biotype_ref(
"Mt_rRNA", "structural_rna", false, "Mitochondrial ribosomal RNA",
),
biotype_ref("tRNA", "structural_rna", false, "Transfer RNA"),
biotype_ref(
"Mt_tRNA", "structural_rna", false, "Mitochondrial transfer RNA",
),
biotype_ref("misc_RNA", "small_noncoding", false, "Miscellaneous RNA"),
biotype_ref("vault_RNA", "small_noncoding", false, "Vault RNA"),
biotype_ref("Y_RNA", "small_noncoding", false, "Y RNA"),
biotype_ref("RNase_P_RNA", "small_noncoding", false, "RNase P RNA"),
biotype_ref("RNase_MRP_RNA", "small_noncoding", false, "RNase MRP RNA"),
biotype_ref("ribozyme", "small_noncoding", false, "Catalytic RNA"),
biotype_ref("sRNA", "small_noncoding", false, "Small RNA"),
biotype_ref("scRNA", "small_noncoding", false, "Small cytoplasmic RNA"),
biotype_ref("guide_RNA", "small_noncoding", false, "Guide RNA"),
biotype_ref("piRNA", "small_noncoding", false, "PIWI-interacting RNA"),
biotype_ref("siRNA", "small_noncoding", false, "Small interfering RNA"),
biotype_ref("TEC", "uncertain", false, "To be experimentally confirmed"),
biotype_ref(
"artifact", "uncertain", false, "Likely assembly or annotation artifact",
),
biotype_ref(
"ambiguous_orf", "uncertain", false, "Ambiguous open reading frame",
),
biotype_ref(
"retained_intron", "uncertain", false, "Transcript retaining intronic sequence",
),
biotype_ref("pseudogene", "pseudogene", false, "Generic pseudogene"),
biotype_ref(
"processed_pseudogene", "pseudogene", false, "Processed pseudogene",
),
biotype_ref(
"unprocessed_pseudogene", "pseudogene", false, "Unprocessed pseudogene",
),
biotype_ref("unitary_pseudogene", "pseudogene", false, "Unitary pseudogene"),
biotype_ref(
"transcribed_processed_pseudogene", "pseudogene", false, "Transcribed processed pseudogene",
),
biotype_ref(
"transcribed_unprocessed_pseudogene", "pseudogene", false, "Transcribed unprocessed pseudogene",
),
biotype_ref(
"translated_processed_pseudogene", "pseudogene", true, "Translated processed pseudogene",
),
biotype_ref(
"translated_unprocessed_pseudogene", "pseudogene", true, "Translated unprocessed pseudogene",
),
biotype_ref(
"IG_C_pseudogene", "immune_pseudogene", false, "Immunoglobulin constant pseudogene",
),
biotype_ref(
"IG_D_pseudogene", "immune_pseudogene", false, "Immunoglobulin diversity pseudogene",
),
biotype_ref(
"IG_J_pseudogene", "immune_pseudogene", false, "Immunoglobulin joining pseudogene",
),
biotype_ref(
"IG_V_pseudogene", "immune_pseudogene", false, "Immunoglobulin variable pseudogene",
),
biotype_ref(
"TR_C_pseudogene", "immune_pseudogene", false, "T-cell receptor constant pseudogene",
),
biotype_ref(
"TR_D_pseudogene", "immune_pseudogene", false, "T-cell receptor diversity pseudogene",
),
biotype_ref(
"TR_J_pseudogene", "immune_pseudogene", false, "T-cell receptor joining pseudogene",
),
biotype_ref(
"TR_V_pseudogene", "immune_pseudogene", false, "T-cell receptor variable pseudogene",
),
biotype_ref("promoter", "regulatory", false, "Promoter annotation"),
biotype_ref("enhancer", "regulatory", false, "Enhancer annotation"),
biotype_ref(
"CTCF_binding_site", "regulatory", false, "CTCF binding site annotation",
),
biotype_ref(
"TF_binding_site", "regulatory", false, "Transcription factor binding site annotation",
),
biotype_ref(
"open_chromatin_region", "regulatory", false, "Open chromatin annotation",
),
biotype_ref(
"histone_mark", "regulatory", false, "Histone modification signal interval",
),
biotype_ref(
"methylation_site", "regulatory", false, "DNA methylation annotation",
),
biotype_ref("repeat_region", "repeat", false, "Generic repeat region"),
biotype_ref("LINE", "repeat", false, "LINE repeat"),
biotype_ref("SINE", "repeat", false, "SINE repeat"),
biotype_ref("LTR", "repeat", false, "LTR repeat"),
biotype_ref("DNA_transposon", "repeat", false, "DNA transposon"),
biotype_ref("simple_repeat", "repeat", false, "Simple tandem repeat"),
biotype_ref("low_complexity", "repeat", false, "Low complexity sequence"),
biotype_ref("satellite", "repeat", false, "Satellite repeat"),
biotype_ref(
"segmental_duplication", "repeat", false, "Segmental duplication",
),
biotype_ref(
"copy_number_variant", "variant", false, "Copy-number variant region",
),
biotype_ref(
"structural_variant", "variant", false, "Structural variant region",
),
biotype_ref("sequence_variant", "variant", false, "Sequence variant"),
biotype_ref("SNV", "variant", false, "Single nucleotide variant"),
biotype_ref("indel", "variant", false, "Insertion/deletion variant"),
biotype_ref("inversion", "variant", false, "Inversion variant"),
biotype_ref("duplication", "variant", false, "Duplication variant"),
biotype_ref("deletion", "variant", false, "Deletion variant"),
biotype_ref("insertion", "variant", false, "Insertion variant"),
]
}
///|
pub fn find_reference_biotype(name : String) -> BiotypeReference {
for item in reference_biotypes() {
if item.name == name {
return item
}
}
biotype_ref(name, "custom", false, "Project-specific biotype")
}
///|
pub fn reference_biotypes_by_family(family : String) -> Array[BiotypeReference] {
let result : Array[BiotypeReference] = []
for item in reference_biotypes() {
if item.family == family {
result.push(item)
}
}
result
}
///|
pub fn coding_reference_biotypes() -> Array[BiotypeReference] {
let result : Array[BiotypeReference] = []
for item in reference_biotypes() {
if item.coding {
result.push(item)
}
}
result
}
///|
pub fn noncoding_reference_biotypes() -> Array[BiotypeReference] {
let result : Array[BiotypeReference] = []
for item in reference_biotypes() {
if !item.coding {
result.push(item)
}
}
result
}
///|
pub fn BiotypeReference::to_tsv_row(self : BiotypeReference) -> String {
[self.name, self.family, "\{self.coding}", self.description].join("\t")
}