CREATE VIEW biological_region AS
  SELECT
    feature_id AS biological_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'sequence_secondary_structure' OR cvterm.name = 'linkage_group' OR cvterm.name = 'polypeptide' OR cvterm.name = 'deletion' OR cvterm.name = 'origin_of_replication' OR cvterm.name = 'recombination_feature' OR cvterm.name = 'CpG_island' OR cvterm.name = 'pseudogene' OR cvterm.name = 'binding_site' OR cvterm.name = 'pseudogenic_region' OR cvterm.name = 'cap' OR cvterm.name = 'intergenic_region' OR cvterm.name = 'oligo_U_tail' OR cvterm.name = 'polyA_sequence' OR cvterm.name = 'repeat_region' OR cvterm.name = 'insertion' OR cvterm.name = 'gene' OR cvterm.name = 'repeat_unit' OR cvterm.name = 'QTL' OR cvterm.name = 'chromosome_part' OR cvterm.name = 'gene_member_region' OR cvterm.name = 'transcript_region' OR cvterm.name = 'polypeptide_region' OR cvterm.name = 'gene_component_region' OR cvterm.name = 'mobile_genetic_element' OR cvterm.name = 'replicon' OR cvterm.name = 'base' OR cvterm.name = 'amino_acid' OR cvterm.name = 'genetic_marker' OR cvterm.name = 'sequence_motif' OR cvterm.name = 'restriction_enzyme_recognition_site' OR cvterm.name = 'restriction_enzyme_single_strand_overhang' OR cvterm.name = 'epigenetically_modified_region' OR cvterm.name = 'open_chromatin_region' OR cvterm.name = 'rearrangement_breakpoint' OR cvterm.name = 'gene_group' OR cvterm.name = 'substitution' OR cvterm.name = 'inversion' OR cvterm.name = 'retron' OR cvterm.name = 'G_quartet' OR cvterm.name = 'base_pair' OR cvterm.name = 'RNA_sequence_secondary_structure' OR cvterm.name = 'DNA_sequence_secondary_structure' OR cvterm.name = 'pseudoknot' OR cvterm.name = 'WC_base_pair' OR cvterm.name = 'sugar_edge_base_pair' OR cvterm.name = 'Hoogsteen_base_pair' OR cvterm.name = 'reverse_Hoogsteen_base_pair' OR cvterm.name = 'wobble_base_pair' OR cvterm.name = 'stem_loop' OR cvterm.name = 'tetraloop' OR cvterm.name = 'i_motif' OR cvterm.name = 'recoding_pseudoknot' OR cvterm.name = 'H_pseudoknot' OR cvterm.name = 'D_loop' OR cvterm.name = 'ARS' OR cvterm.name = 'oriT' OR cvterm.name = 'amplification_origin' OR cvterm.name = 'oriV' OR cvterm.name = 'oriC' OR cvterm.name = 'recombination_hotspot' OR cvterm.name = 'haplotype_block' OR cvterm.name = 'sequence_rearrangement_feature' OR cvterm.name = 'iDNA' OR cvterm.name = 'specific_recombination_site' OR cvterm.name = 'chromosome_breakage_sequence' OR cvterm.name = 'internal_eliminated_sequence' OR cvterm.name = 'macronucleus_destined_segment' OR cvterm.name = 'recombination_feature_of_rearranged_gene' OR cvterm.name = 'site_specific_recombination_target_region' OR cvterm.name = 'recombination_signal_sequence' OR cvterm.name = 'vertebrate_immune_system_gene_recombination_feature' OR cvterm.name = 'vertebrate_immunoglobulin_T_cell_receptor_segment' OR cvterm.name = 'vertebrate_immunoglobulin_T_cell_receptor_gene_cluster' OR cvterm.name = 'vertebrate_immune_system_gene_recombination_spacer' OR cvterm.name = 'vertebrate_immunoglobulin_T_cell_receptor_rearranged_segment' OR cvterm.name = 'vertebrate_immunoglobulin_T_cell_receptor_rearranged_gene_cluster' OR cvterm.name = 'vertebrate_immune_system_gene_recombination_signal_feature' OR cvterm.name = 'N_region' OR cvterm.name = 'S_region' OR cvterm.name = 'D_gene_segment' OR cvterm.name = 'V_gene_segment' OR cvterm.name = 'J_gene_segment' OR cvterm.name = 'C_gene_segment' OR cvterm.name = 'D_J_C_cluster' OR cvterm.name = 'J_C_cluster' OR cvterm.name = 'J_cluster' OR cvterm.name = 'V_cluster' OR cvterm.name = 'V_J_cluster' OR cvterm.name = 'V_J_C_cluster' OR cvterm.name = 'C_cluster' OR cvterm.name = 'D_cluster' OR cvterm.name = 'D_J_cluster' OR cvterm.name = 'three_prime_D_spacer' OR cvterm.name = 'five_prime_D_spacer' OR cvterm.name = 'J_spacer' OR cvterm.name = 'V_spacer' OR cvterm.name = 'VD_gene_segment' OR cvterm.name = 'DJ_gene_segment' OR cvterm.name = 'VDJ_gene_segment' OR cvterm.name = 'VJ_gene_segment' OR cvterm.name = 'DJ_J_cluster' OR cvterm.name = 'VDJ_J_C_cluster' OR cvterm.name = 'VDJ_J_cluster' OR cvterm.name = 'VJ_C_cluster' OR cvterm.name = 'VJ_J_C_cluster' OR cvterm.name = 'VJ_J_cluster' OR cvterm.name = 'D_DJ_C_cluster' OR cvterm.name = 'D_DJ_cluster' OR cvterm.name = 'D_DJ_J_C_cluster' OR cvterm.name = 'D_DJ_J_cluster' OR cvterm.name = 'V_DJ_cluster' OR cvterm.name = 'V_DJ_J_cluster' OR cvterm.name = 'V_VDJ_C_cluster' OR cvterm.name = 'V_VDJ_cluster' OR cvterm.name = 'V_VDJ_J_cluster' OR cvterm.name = 'V_VJ_C_cluster' OR cvterm.name = 'V_VJ_cluster' OR cvterm.name = 'V_VJ_J_cluster' OR cvterm.name = 'V_D_DJ_C_cluster' OR cvterm.name = 'V_D_DJ_cluster' OR cvterm.name = 'V_D_DJ_J_C_cluster' OR cvterm.name = 'V_D_DJ_J_cluster' OR cvterm.name = 'V_D_J_C_cluster' OR cvterm.name = 'V_D_J_cluster' OR cvterm.name = 'DJ_C_cluster' OR cvterm.name = 'DJ_J_C_cluster' OR cvterm.name = 'VDJ_C_cluster' OR cvterm.name = 'V_DJ_C_cluster' OR cvterm.name = 'V_DJ_J_C_cluster' OR cvterm.name = 'V_VDJ_J_C_cluster' OR cvterm.name = 'V_VJ_J_C_cluster' OR cvterm.name = 'J_gene_recombination_feature' OR cvterm.name = 'D_gene_recombination_feature' OR cvterm.name = 'V_gene_recombination_feature' OR cvterm.name = 'heptamer_of_recombination_feature_of_vertebrate_immune_system_gene' OR cvterm.name = 'nonamer_of_recombination_feature_of_vertebrate_immune_system_gene' OR cvterm.name = 'five_prime_D_recombination_signal_sequence' OR cvterm.name = 'three_prime_D_recombination_signal_sequence' OR cvterm.name = 'three_prime_D_heptamer' OR cvterm.name = 'five_prime_D_heptamer' OR cvterm.name = 'J_heptamer' OR cvterm.name = 'V_heptamer' OR cvterm.name = 'three_prime_D_nonamer' OR cvterm.name = 'five_prime_D_nonamer' OR cvterm.name = 'J_nonamer' OR cvterm.name = 'V_nonamer' OR cvterm.name = 'integration_excision_site' OR cvterm.name = 'resolution_site' OR cvterm.name = 'inversion_site' OR cvterm.name = 'inversion_site_part' OR cvterm.name = 'attI_site' OR cvterm.name = 'attP_site' OR cvterm.name = 'attB_site' OR cvterm.name = 'attL_site' OR cvterm.name = 'attR_site' OR cvterm.name = 'attC_site' OR cvterm.name = 'attCtn_site' OR cvterm.name = 'loxP_site' OR cvterm.name = 'dif_site' OR cvterm.name = 'FRT_site' OR cvterm.name = 'IRLinv_site' OR cvterm.name = 'IRRinv_site' OR cvterm.name = 'processed_pseudogene' OR cvterm.name = 'non_processed_pseudogene' OR cvterm.name = 'polymorphic_pseudogene' OR cvterm.name = 'transposable_element_pseudogene' OR cvterm.name = 'pseudogene_by_unequal_crossing_over' OR cvterm.name = 'nuclear_mt_pseudogene' OR cvterm.name = 'cassette_pseudogene' OR cvterm.name = 'duplicated_pseudogene' OR cvterm.name = 'unitary_pseudogene' OR cvterm.name = 'protein_binding_site' OR cvterm.name = 'epitope' OR cvterm.name = 'nucleotide_binding_site' OR cvterm.name = 'metal_binding_site' OR cvterm.name = 'ligand_binding_site' OR cvterm.name = 'protein_protein_contact' OR cvterm.name = 'nucleotide_to_protein_binding_site' OR cvterm.name = 'DDB_box' OR cvterm.name = 'PIP_box' OR cvterm.name = 'nuclease_binding_site' OR cvterm.name = 'TF_binding_site' OR cvterm.name = 'histone_binding_site' OR cvterm.name = 'insulator_binding_site' OR cvterm.name = 'enhancer_binding_site' OR cvterm.name = 'restriction_enzyme_binding_site' OR cvterm.name = 'nuclease_sensitive_site' OR cvterm.name = 'homing_endonuclease_binding_site' OR cvterm.name = 'nuclease_hypersensitive_site' OR cvterm.name = 'group_1_intron_homing_endonuclease_target_region' OR cvterm.name = 'DNAseI_hypersensitive_site' OR cvterm.name = 'miRNA_target_site' OR cvterm.name = 'DNA_binding_site' OR cvterm.name = 'primer_binding_site' OR cvterm.name = 'polypeptide_DNA_contact' OR cvterm.name = 'polypeptide_metal_contact' OR cvterm.name = 'polypeptide_calcium_ion_contact_site' OR cvterm.name = 'polypeptide_cobalt_ion_contact_site' OR cvterm.name = 'polypeptide_copper_ion_contact_site' OR cvterm.name = 'polypeptide_iron_ion_contact_site' OR cvterm.name = 'polypeptide_magnesium_ion_contact_site' OR cvterm.name = 'polypeptide_manganese_ion_contact_site' OR cvterm.name = 'polypeptide_molybdenum_ion_contact_site' OR cvterm.name = 'polypeptide_nickel_ion_contact_site' OR cvterm.name = 'polypeptide_tungsten_ion_contact_site' OR cvterm.name = 'polypeptide_zinc_ion_contact_site' OR cvterm.name = 'polypeptide_ligand_contact' OR cvterm.name = 'decayed_exon' OR cvterm.name = 'pseudogenic_exon' OR cvterm.name = 'pseudogenic_transcript' OR cvterm.name = 'pseudogenic_rRNA' OR cvterm.name = 'pseudogenic_tRNA' OR cvterm.name = 'long_terminal_repeat' OR cvterm.name = 'engineered_foreign_repetitive_element' OR cvterm.name = 'inverted_repeat' OR cvterm.name = 'direct_repeat' OR cvterm.name = 'non_LTR_retrotransposon_polymeric_tract' OR cvterm.name = 'dispersed_repeat' OR cvterm.name = 'tandem_repeat' OR cvterm.name = 'X_element_combinatorial_repeat' OR cvterm.name = 'Y_prime_element' OR cvterm.name = 'telomeric_repeat' OR cvterm.name = 'nested_repeat' OR cvterm.name = 'centromeric_repeat' OR cvterm.name = 'five_prime_LTR' OR cvterm.name = 'three_prime_LTR' OR cvterm.name = 'solo_LTR' OR cvterm.name = 'terminal_inverted_repeat' OR cvterm.name = 'five_prime_terminal_inverted_repeat' OR cvterm.name = 'three_prime_terminal_inverted_repeat' OR cvterm.name = 'target_site_duplication' OR cvterm.name = 'CRISPR' OR cvterm.name = 'satellite_DNA' OR cvterm.name = 'microsatellite' OR cvterm.name = 'minisatellite' OR cvterm.name = 'dinucleotide_repeat_microsatellite_feature' OR cvterm.name = 'trinucleotide_repeat_microsatellite_feature' OR cvterm.name = 'tetranucleotide_repeat_microsatellite_feature' OR cvterm.name = 'GT_dinucleotide_repeat' OR cvterm.name = 'GTT_trinucleotide_repeat' OR cvterm.name = 'nested_tandem_repeat' OR cvterm.name = 'regional_centromere_inner_repeat_region' OR cvterm.name = 'regional_centromere_outer_repeat_region' OR cvterm.name = 'dg_repeat' OR cvterm.name = 'dh_repeat' OR cvterm.name = 'transgenic_insertion' OR cvterm.name = 'mobile_element_insertion' OR cvterm.name = 'novel_sequence_insertion' OR cvterm.name = 'duplication' OR cvterm.name = 'distal_duplication' OR cvterm.name = 'tandem_duplication' OR cvterm.name = 'direct_tandem_duplication' OR cvterm.name = 'inverted_tandem_duplication' OR cvterm.name = 'nuclear_gene' OR cvterm.name = 'mt_gene' OR cvterm.name = 'plastid_gene' OR cvterm.name = 'nucleomorph_gene' OR cvterm.name = 'plasmid_gene' OR cvterm.name = 'proviral_gene' OR cvterm.name = 'transposable_element_gene' OR cvterm.name = 'silenced_gene' OR cvterm.name = 'engineered_gene' OR cvterm.name = 'foreign_gene' OR cvterm.name = 'fusion_gene' OR cvterm.name = 'recombinationally_rearranged_gene' OR cvterm.name = 'gene_with_trans_spliced_transcript' OR cvterm.name = 'gene_with_polycistronic_transcript' OR cvterm.name = 'rescue_gene' OR cvterm.name = 'post_translationally_regulated_gene' OR cvterm.name = 'negatively_autoregulated_gene' OR cvterm.name = 'positively_autoregulated_gene' OR cvterm.name = 'translationally_regulated_gene' OR cvterm.name = 'epigenetically_modified_gene' OR cvterm.name = 'transgene' OR cvterm.name = 'predicted_gene' OR cvterm.name = 'protein_coding_gene' OR cvterm.name = 'retrogene' OR cvterm.name = 'ncRNA_gene' OR cvterm.name = 'cryptic_gene' OR cvterm.name = 'gene_with_non_canonical_start_codon' OR cvterm.name = 'candidate_gene' OR cvterm.name = 'gene_cassette' OR cvterm.name = 'kinetoplast_gene' OR cvterm.name = 'maxicircle_gene' OR cvterm.name = 'minicircle_gene' OR cvterm.name = 'cryptogene' OR cvterm.name = 'apicoplast_gene' OR cvterm.name = 'ct_gene' OR cvterm.name = 'chromoplast_gene' OR cvterm.name = 'cyanelle_gene' OR cvterm.name = 'leucoplast_gene' OR cvterm.name = 'proplastid_gene' OR cvterm.name = 'endogenous_retroviral_gene' OR cvterm.name = 'engineered_foreign_transposable_element_gene' OR cvterm.name = 'gene_silenced_by_DNA_modification' OR cvterm.name = 'gene_silenced_by_RNA_interference' OR cvterm.name = 'gene_silenced_by_histone_modification' OR cvterm.name = 'gene_silenced_by_DNA_methylation' OR cvterm.name = 'gene_silenced_by_histone_methylation' OR cvterm.name = 'gene_silenced_by_histone_deacetylation' OR cvterm.name = 'engineered_foreign_gene' OR cvterm.name = 'engineered_fusion_gene' OR cvterm.name = 'engineered_foreign_transposable_element_gene' OR cvterm.name = 'engineered_foreign_gene' OR cvterm.name = 'engineered_foreign_transposable_element_gene' OR cvterm.name = 'engineered_fusion_gene' OR cvterm.name = 'recombinationally_inverted_gene' OR cvterm.name = 'recombinationally_rearranged_vertebrate_immune_system_gene' OR cvterm.name = 'gene_with_dicistronic_transcript' OR cvterm.name = 'gene_with_dicistronic_primary_transcript' OR cvterm.name = 'gene_with_dicistronic_mRNA' OR cvterm.name = 'wild_type_rescue_gene' OR cvterm.name = 'gene_rearranged_at_DNA_level' OR cvterm.name = 'maternally_imprinted_gene' OR cvterm.name = 'paternally_imprinted_gene' OR cvterm.name = 'allelically_excluded_gene' OR cvterm.name = 'floxed_gene' OR cvterm.name = 'gene_with_polyadenylated_mRNA' OR cvterm.name = 'gene_with_mRNA_with_frameshift' OR cvterm.name = 'gene_with_edited_transcript' OR cvterm.name = 'gene_with_recoded_mRNA' OR cvterm.name = 'gene_with_stop_codon_read_through' OR cvterm.name = 'gene_with_mRNA_recoded_by_translational_bypass' OR cvterm.name = 'gene_with_transcript_with_translational_frameshift' OR cvterm.name = 'gene_with_stop_codon_redefined_as_pyrrolysine' OR cvterm.name = 'gene_with_stop_codon_redefined_as_selenocysteine' OR cvterm.name = 'gRNA_gene' OR cvterm.name = 'miRNA_gene' OR cvterm.name = 'scRNA_gene' OR cvterm.name = 'snoRNA_gene' OR cvterm.name = 'snRNA_gene' OR cvterm.name = 'SRP_RNA_gene' OR cvterm.name = 'stRNA_gene' OR cvterm.name = 'tmRNA_gene' OR cvterm.name = 'tRNA_gene' OR cvterm.name = 'rRNA_gene' OR cvterm.name = 'piRNA_gene' OR cvterm.name = 'RNase_P_RNA_gene' OR cvterm.name = 'RNase_MRP_RNA_gene' OR cvterm.name = 'lincRNA_gene' OR cvterm.name = 'telomerase_RNA_gene' OR cvterm.name = 'cryptogene' OR cvterm.name = 'gene_with_start_codon_CUG' OR cvterm.name = 'positional_candidate_gene' OR cvterm.name = 'functional_candidate_gene' OR cvterm.name = 'chromosome_arm' OR cvterm.name = 'chromosome_band' OR cvterm.name = 'interband' OR cvterm.name = 'chromosomal_regulatory_element' OR cvterm.name = 'chromosomal_structural_element' OR cvterm.name = 'introgressed_chromosome_region' OR cvterm.name = 'matrix_attachment_site' OR cvterm.name = 'centromere' OR cvterm.name = 'telomere' OR cvterm.name = 'point_centromere' OR cvterm.name = 'regional_centromere' OR cvterm.name = 'transcript' OR cvterm.name = 'regulatory_region' OR cvterm.name = 'polycistronic_transcript' OR cvterm.name = 'transcript_with_translational_frameshift' OR cvterm.name = 'primary_transcript' OR cvterm.name = 'mature_transcript' OR cvterm.name = 'transcript_bound_by_nucleic_acid' OR cvterm.name = 'transcript_bound_by_protein' OR cvterm.name = 'enzymatic_RNA' OR cvterm.name = 'trans_spliced_transcript' OR cvterm.name = 'monocistronic_transcript' OR cvterm.name = 'aberrant_processed_transcript' OR cvterm.name = 'edited_transcript' OR cvterm.name = 'processed_transcript' OR cvterm.name = 'alternatively_spliced_transcript' OR cvterm.name = 'dicistronic_transcript' OR cvterm.name = 'polycistronic_primary_transcript' OR cvterm.name = 'polycistronic_mRNA' OR cvterm.name = 'dicistronic_mRNA' OR cvterm.name = 'dicistronic_primary_transcript' OR cvterm.name = 'dicistronic_primary_transcript' OR cvterm.name = 'dicistronic_mRNA' OR cvterm.name = 'protein_coding_primary_transcript' OR cvterm.name = 'nc_primary_transcript' OR cvterm.name = 'polycistronic_primary_transcript' OR cvterm.name = 'monocistronic_primary_transcript' OR cvterm.name = 'mini_exon_donor_RNA' OR cvterm.name = 'antisense_primary_transcript' OR cvterm.name = 'capped_primary_transcript' OR cvterm.name = 'regional_centromere_outer_repeat_transcript' OR cvterm.name = 'pre_edited_mRNA' OR cvterm.name = 'scRNA_primary_transcript' OR cvterm.name = 'rRNA_primary_transcript' OR cvterm.name = 'tRNA_primary_transcript' OR cvterm.name = 'snRNA_primary_transcript' OR cvterm.name = 'snoRNA_primary_transcript' OR cvterm.name = 'tmRNA_primary_transcript' OR cvterm.name = 'SRP_RNA_primary_transcript' OR cvterm.name = 'miRNA_primary_transcript' OR cvterm.name = 'tasiRNA_primary_transcript' OR cvterm.name = 'rRNA_small_subunit_primary_transcript' OR cvterm.name = 'rRNA_large_subunit_primary_transcript' OR cvterm.name = 'alanine_tRNA_primary_transcript' OR cvterm.name = 'arginine_tRNA_primary_transcript' OR cvterm.name = 'asparagine_tRNA_primary_transcript' OR cvterm.name = 'aspartic_acid_tRNA_primary_transcript' OR cvterm.name = 'cysteine_tRNA_primary_transcript' OR cvterm.name = 'glutamic_acid_tRNA_primary_transcript' OR cvterm.name = 'glutamine_tRNA_primary_transcript' OR cvterm.name = 'glycine_tRNA_primary_transcript' OR cvterm.name = 'histidine_tRNA_primary_transcript' OR cvterm.name = 'isoleucine_tRNA_primary_transcript' OR cvterm.name = 'leucine_tRNA_primary_transcript' OR cvterm.name = 'lysine_tRNA_primary_transcript' OR cvterm.name = 'methionine_tRNA_primary_transcript' OR cvterm.name = 'phenylalanine_tRNA_primary_transcript' OR cvterm.name = 'proline_tRNA_primary_transcript' OR cvterm.name = 'serine_tRNA_primary_transcript' OR cvterm.name = 'threonine_tRNA_primary_transcript' OR cvterm.name = 'tryptophan_tRNA_primary_transcript' OR cvterm.name = 'tyrosine_tRNA_primary_transcript' OR cvterm.name = 'valine_tRNA_primary_transcript' OR cvterm.name = 'pyrrolysine_tRNA_primary_transcript' OR cvterm.name = 'selenocysteine_tRNA_primary_transcript' OR cvterm.name = 'methylation_guide_snoRNA_primary_transcript' OR cvterm.name = 'rRNA_cleavage_snoRNA_primary_transcript' OR cvterm.name = 'C_D_box_snoRNA_primary_transcript' OR cvterm.name = 'H_ACA_box_snoRNA_primary_transcript' OR cvterm.name = 'U14_snoRNA_primary_transcript' OR cvterm.name = 'stRNA_primary_transcript' OR cvterm.name = 'dicistronic_primary_transcript' OR cvterm.name = 'mRNA' OR cvterm.name = 'ncRNA' OR cvterm.name = 'mRNA_with_frameshift' OR cvterm.name = 'monocistronic_mRNA' OR cvterm.name = 'polycistronic_mRNA' OR cvterm.name = 'exemplar_mRNA' OR cvterm.name = 'capped_mRNA' OR cvterm.name = 'polyadenylated_mRNA' OR cvterm.name = 'trans_spliced_mRNA' OR cvterm.name = 'edited_mRNA' OR cvterm.name = 'consensus_mRNA' OR cvterm.name = 'recoded_mRNA' OR cvterm.name = 'mRNA_with_minus_1_frameshift' OR cvterm.name = 'mRNA_with_plus_1_frameshift' OR cvterm.name = 'mRNA_with_plus_2_frameshift' OR cvterm.name = 'mRNA_with_minus_2_frameshift' OR cvterm.name = 'dicistronic_mRNA' OR cvterm.name = 'mRNA_recoded_by_translational_bypass' OR cvterm.name = 'mRNA_recoded_by_codon_redefinition' OR cvterm.name = 'scRNA' OR cvterm.name = 'rRNA' OR cvterm.name = 'tRNA' OR cvterm.name = 'snRNA' OR cvterm.name = 'snoRNA' OR cvterm.name = 'small_regulatory_ncRNA' OR cvterm.name = 'RNase_MRP_RNA' OR cvterm.name = 'RNase_P_RNA' OR cvterm.name = 'telomerase_RNA' OR cvterm.name = 'vault_RNA' OR cvterm.name = 'Y_RNA' OR cvterm.name = 'rasiRNA' OR cvterm.name = 'SRP_RNA' OR cvterm.name = 'guide_RNA' OR cvterm.name = 'antisense_RNA' OR cvterm.name = 'siRNA' OR cvterm.name = 'stRNA' OR cvterm.name = 'class_II_RNA' OR cvterm.name = 'class_I_RNA' OR cvterm.name = 'piRNA' OR cvterm.name = 'tasiRNA' OR cvterm.name = 'enhancerRNA' OR cvterm.name = 'lnc_RNA' OR cvterm.name = 'telomeric_transcript' OR cvterm.name = 'rRNA_cleavage_RNA' OR cvterm.name = 'small_subunit_rRNA' OR cvterm.name = 'large_subunit_rRNA' OR cvterm.name = 'rRNA_18S' OR cvterm.name = 'rRNA_16S' OR cvterm.name = 'rRNA_5_8S' OR cvterm.name = 'rRNA_5S' OR cvterm.name = 'rRNA_28S' OR cvterm.name = 'rRNA_23S' OR cvterm.name = 'rRNA_25S' OR cvterm.name = 'rRNA_21S' OR cvterm.name = 'alanyl_tRNA' OR cvterm.name = 'asparaginyl_tRNA' OR cvterm.name = 'aspartyl_tRNA' OR cvterm.name = 'cysteinyl_tRNA' OR cvterm.name = 'glutaminyl_tRNA' OR cvterm.name = 'glutamyl_tRNA' OR cvterm.name = 'glycyl_tRNA' OR cvterm.name = 'histidyl_tRNA' OR cvterm.name = 'isoleucyl_tRNA' OR cvterm.name = 'leucyl_tRNA' OR cvterm.name = 'lysyl_tRNA' OR cvterm.name = 'methionyl_tRNA' OR cvterm.name = 'phenylalanyl_tRNA' OR cvterm.name = 'prolyl_tRNA' OR cvterm.name = 'seryl_tRNA' OR cvterm.name = 'threonyl_tRNA' OR cvterm.name = 'tryptophanyl_tRNA' OR cvterm.name = 'tyrosyl_tRNA' OR cvterm.name = 'valyl_tRNA' OR cvterm.name = 'pyrrolysyl_tRNA' OR cvterm.name = 'arginyl_tRNA' OR cvterm.name = 'selenocysteinyl_tRNA' OR cvterm.name = 'U1_snRNA' OR cvterm.name = 'U2_snRNA' OR cvterm.name = 'U4_snRNA' OR cvterm.name = 'U4atac_snRNA' OR cvterm.name = 'U5_snRNA' OR cvterm.name = 'U6_snRNA' OR cvterm.name = 'U6atac_snRNA' OR cvterm.name = 'U11_snRNA' OR cvterm.name = 'U12_snRNA' OR cvterm.name = 'C_D_box_snoRNA' OR cvterm.name = 'H_ACA_box_snoRNA' OR cvterm.name = 'U14_snoRNA' OR cvterm.name = 'U3_snoRNA' OR cvterm.name = 'methylation_guide_snoRNA' OR cvterm.name = 'pseudouridylation_guide_snoRNA' OR cvterm.name = 'miRNA' OR cvterm.name = 'RNA_6S' OR cvterm.name = 'CsrB_RsmB_RNA' OR cvterm.name = 'DsrA_RNA' OR cvterm.name = 'OxyS_RNA' OR cvterm.name = 'RprA_RNA' OR cvterm.name = 'RRE_RNA' OR cvterm.name = 'spot_42_RNA' OR cvterm.name = 'tmRNA' OR cvterm.name = 'GcvB_RNA' OR cvterm.name = 'MicF_RNA' OR cvterm.name = 'lincRNA' OR cvterm.name = 'intronic_lncRNA' OR cvterm.name = 'antisense_lncRNA' OR cvterm.name = 'TERRA' OR cvterm.name = 'ARRET' OR cvterm.name = 'ARIA' OR cvterm.name = 'anti_ARRET' OR cvterm.name = 'ribozyme' OR cvterm.name = 'trans_spliced_mRNA' OR cvterm.name = 'monocistronic_primary_transcript' OR cvterm.name = 'monocistronic_mRNA' OR cvterm.name = 'edited_transcript_by_A_to_I_substitution' OR cvterm.name = 'edited_mRNA' OR cvterm.name = 'transcription_regulatory_region' OR cvterm.name = 'translation_regulatory_region' OR cvterm.name = 'recombination_regulatory_region' OR cvterm.name = 'replication_regulatory_region' OR cvterm.name = 'terminator' OR cvterm.name = 'TF_binding_site' OR cvterm.name = 'polyA_signal_sequence' OR cvterm.name = 'gene_group_regulatory_region' OR cvterm.name = 'transcriptional_cis_regulatory_region' OR cvterm.name = 'splicing_regulatory_region' OR cvterm.name = 'cis_regulatory_frameshift_element' OR cvterm.name = 'intronic_regulatory_region' OR cvterm.name = 'bacterial_terminator' OR cvterm.name = 'eukaryotic_terminator' OR cvterm.name = 'rho_dependent_bacterial_terminator' OR cvterm.name = 'rho_independent_bacterial_terminator' OR cvterm.name = 'terminator_of_type_2_RNApol_III_promoter' OR cvterm.name = 'operator' OR cvterm.name = 'bacterial_RNApol_promoter' OR cvterm.name = 'bacterial_terminator' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_70' OR cvterm.name = 'bacterial_RNApol_promoter_sigma54' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_ecf' OR cvterm.name = 'rho_dependent_bacterial_terminator' OR cvterm.name = 'rho_independent_bacterial_terminator' OR cvterm.name = 'promoter' OR cvterm.name = 'insulator' OR cvterm.name = 'CRM' OR cvterm.name = 'promoter_targeting_sequence' OR cvterm.name = 'ISRE' OR cvterm.name = 'bidirectional_promoter' OR cvterm.name = 'RNA_polymerase_promoter' OR cvterm.name = 'RNApol_I_promoter' OR cvterm.name = 'RNApol_II_promoter' OR cvterm.name = 'RNApol_III_promoter' OR cvterm.name = 'bacterial_RNApol_promoter' OR cvterm.name = 'Phage_RNA_Polymerase_Promoter' OR cvterm.name = 'RNApol_II_core_promoter' OR cvterm.name = 'RNApol_III_promoter_type_1' OR cvterm.name = 'RNApol_III_promoter_type_2' OR cvterm.name = 'RNApol_III_promoter_type_3' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_70' OR cvterm.name = 'bacterial_RNApol_promoter_sigma54' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_ecf' OR cvterm.name = 'SP6_RNA_Polymerase_Promoter' OR cvterm.name = 'T3_RNA_Polymerase_Promoter' OR cvterm.name = 'T7_RNA_Polymerase_Promoter' OR cvterm.name = 'locus_control_region' OR cvterm.name = 'enhancer' OR cvterm.name = 'silencer' OR cvterm.name = 'enhancer_bound_by_factor' OR cvterm.name = 'shadow_enhancer' OR cvterm.name = 'splice_enhancer' OR cvterm.name = 'intronic_splice_enhancer' OR cvterm.name = 'exonic_splice_enhancer' OR cvterm.name = 'attenuator' OR cvterm.name = 'exon' OR cvterm.name = 'edited_transcript_feature' OR cvterm.name = 'mature_transcript_region' OR cvterm.name = 'primary_transcript_region' OR cvterm.name = 'exon_region' OR cvterm.name = 'anchor_binding_site' OR cvterm.name = 'coding_exon' OR cvterm.name = 'noncoding_exon' OR cvterm.name = 'interior_exon' OR cvterm.name = 'exon_of_single_exon_gene' OR cvterm.name = 'interior_coding_exon' OR cvterm.name = 'five_prime_coding_exon' OR cvterm.name = 'three_prime_coding_exon' OR cvterm.name = 'three_prime_noncoding_exon' OR cvterm.name = 'five_prime_noncoding_exon' OR cvterm.name = 'pre_edited_region' OR cvterm.name = 'editing_block' OR cvterm.name = 'editing_domain' OR cvterm.name = 'unedited_region' OR cvterm.name = 'mRNA_region' OR cvterm.name = 'tmRNA_region' OR cvterm.name = 'guide_RNA_region' OR cvterm.name = 'tRNA_region' OR cvterm.name = 'riboswitch' OR cvterm.name = 'ribosome_entry_site' OR cvterm.name = 'UTR' OR cvterm.name = 'CDS' OR cvterm.name = 'five_prime_open_reading_frame' OR cvterm.name = 'UTR_region' OR cvterm.name = 'CDS_region' OR cvterm.name = 'translational_frameshift' OR cvterm.name = 'recoding_stimulatory_region' OR cvterm.name = 'internal_ribosome_entry_site' OR cvterm.name = 'Shine_Dalgarno_sequence' OR cvterm.name = 'kozak_sequence' OR cvterm.name = 'internal_Shine_Dalgarno_sequence' OR cvterm.name = 'five_prime_UTR' OR cvterm.name = 'three_prime_UTR' OR cvterm.name = 'internal_UTR' OR cvterm.name = 'untranslated_region_polycistronic_mRNA' OR cvterm.name = 'edited_CDS' OR cvterm.name = 'CDS_fragment' OR cvterm.name = 'transposable_element_CDS' OR cvterm.name = 'CDS_independently_known' OR cvterm.name = 'CDS_predicted' OR cvterm.name = 'orphan_CDS' OR cvterm.name = 'CDS_supported_by_sequence_similarity_data' OR cvterm.name = 'CDS_supported_by_domain_match_data' OR cvterm.name = 'CDS_supported_by_EST_or_cDNA_data' OR cvterm.name = 'upstream_AUG_codon' OR cvterm.name = 'AU_rich_element' OR cvterm.name = 'Bruno_response_element' OR cvterm.name = 'iron_responsive_element' OR cvterm.name = 'coding_start' OR cvterm.name = 'coding_end' OR cvterm.name = 'codon' OR cvterm.name = 'recoded_codon' OR cvterm.name = 'start_codon' OR cvterm.name = 'stop_codon' OR cvterm.name = 'stop_codon_read_through' OR cvterm.name = 'stop_codon_redefined_as_pyrrolysine' OR cvterm.name = 'stop_codon_redefined_as_selenocysteine' OR cvterm.name = 'non_canonical_start_codon' OR cvterm.name = 'four_bp_start_codon' OR cvterm.name = 'CTG_start_codon' OR cvterm.name = 'plus_1_translational_frameshift' OR cvterm.name = 'plus_2_translational_frameshift' OR cvterm.name = 'internal_Shine_Dalgarno_sequence' OR cvterm.name = 'SECIS_element' OR cvterm.name = 'three_prime_recoding_site' OR cvterm.name = 'five_prime_recoding_site' OR cvterm.name = 'stop_codon_signal' OR cvterm.name = 'three_prime_stem_loop_structure' OR cvterm.name = 'flanking_three_prime_quadruplet_recoding_signal' OR cvterm.name = 'three_prime_repeat_recoding_signal' OR cvterm.name = 'distant_three_prime_recoding_signal' OR cvterm.name = 'UAG_stop_codon_signal' OR cvterm.name = 'UAA_stop_codon_signal' OR cvterm.name = 'UGA_stop_codon_signal' OR cvterm.name = 'tmRNA_coding_piece' OR cvterm.name = 'tmRNA_acceptor_piece' OR cvterm.name = 'anchor_region' OR cvterm.name = 'template_region' OR cvterm.name = 'anticodon_loop' OR cvterm.name = 'anticodon' OR cvterm.name = 'CCA_tail' OR cvterm.name = 'DHU_loop' OR cvterm.name = 'T_loop' OR cvterm.name = 'splice_site' OR cvterm.name = 'intron' OR cvterm.name = 'clip' OR cvterm.name = 'TSS' OR cvterm.name = 'transcription_end_site' OR cvterm.name = 'spliced_leader_RNA' OR cvterm.name = 'rRNA_primary_transcript_region' OR cvterm.name = 'spliceosomal_intron_region' OR cvterm.name = 'intron_domain' OR cvterm.name = 'miRNA_primary_transcript_region' OR cvterm.name = 'outron' OR cvterm.name = 'splice_region' OR cvterm.name = 'cis_splice_site' OR cvterm.name = 'trans_splice_site' OR cvterm.name = 'cryptic_splice_site' OR cvterm.name = 'five_prime_cis_splice_site' OR cvterm.name = 'three_prime_cis_splice_site' OR cvterm.name = 'recursive_splice_site' OR cvterm.name = 'canonical_five_prime_splice_site' OR cvterm.name = 'non_canonical_five_prime_splice_site' OR cvterm.name = 'canonical_three_prime_splice_site' OR cvterm.name = 'non_canonical_three_prime_splice_site' OR cvterm.name = 'trans_splice_acceptor_site' OR cvterm.name = 'trans_splice_donor_site' OR cvterm.name = 'SL1_acceptor_site' OR cvterm.name = 'SL2_acceptor_site' OR cvterm.name = 'SL3_acceptor_site' OR cvterm.name = 'SL4_acceptor_site' OR cvterm.name = 'SL5_acceptor_site' OR cvterm.name = 'SL6_acceptor_site' OR cvterm.name = 'SL7_acceptor_site' OR cvterm.name = 'SL8_acceptor_site' OR cvterm.name = 'SL9_acceptor_site' OR cvterm.name = 'SL10_acceptor_site' OR cvterm.name = 'SL11_acceptor_site' OR cvterm.name = 'SL12_acceptor_site' OR cvterm.name = 'five_prime_intron' OR cvterm.name = 'interior_intron' OR cvterm.name = 'three_prime_intron' OR cvterm.name = 'twintron' OR cvterm.name = 'UTR_intron' OR cvterm.name = 'autocatalytically_spliced_intron' OR cvterm.name = 'spliceosomal_intron' OR cvterm.name = 'mobile_intron' OR cvterm.name = 'endonuclease_spliced_intron' OR cvterm.name = 'five_prime_UTR_intron' OR cvterm.name = 'three_prime_UTR_intron' OR cvterm.name = 'group_I_intron' OR cvterm.name = 'group_II_intron' OR cvterm.name = 'group_III_intron' OR cvterm.name = 'group_IIA_intron' OR cvterm.name = 'group_IIB_intron' OR cvterm.name = 'U2_intron' OR cvterm.name = 'U12_intron' OR cvterm.name = 'archaeal_intron' OR cvterm.name = 'tRNA_intron' OR cvterm.name = 'five_prime_clip' OR cvterm.name = 'three_prime_clip' OR cvterm.name = 'major_TSS' OR cvterm.name = 'minor_TSS' OR cvterm.name = 'transcribed_spacer_region' OR cvterm.name = 'internal_transcribed_spacer_region' OR cvterm.name = 'external_transcribed_spacer_region' OR cvterm.name = 'intronic_splice_enhancer' OR cvterm.name = 'branch_site' OR cvterm.name = 'polypyrimidine_tract' OR cvterm.name = 'internal_guide_sequence' OR cvterm.name = 'mirtron' OR cvterm.name = 'pre_miRNA' OR cvterm.name = 'miRNA_stem' OR cvterm.name = 'miRNA_loop' OR cvterm.name = 'miRNA_antiguide' OR cvterm.name = 'noncoding_region_of_exon' OR cvterm.name = 'coding_region_of_exon' OR cvterm.name = 'three_prime_coding_exon_noncoding_region' OR cvterm.name = 'five_prime_coding_exon_noncoding_region' OR cvterm.name = 'five_prime_coding_exon_coding_region' OR cvterm.name = 'three_prime_coding_exon_coding_region' OR cvterm.name = 'mature_protein_region' OR cvterm.name = 'immature_peptide_region' OR cvterm.name = 'compositionally_biased_region_of_peptide' OR cvterm.name = 'polypeptide_structural_region' OR cvterm.name = 'polypeptide_variation_site' OR cvterm.name = 'peptide_localization_signal' OR cvterm.name = 'immunoglobulin_region' OR cvterm.name = 'cleaved_peptide_region' OR cvterm.name = 'hydrophobic_region_of_peptide' OR cvterm.name = 'polypeptide_conserved_region' OR cvterm.name = 'active_peptide' OR cvterm.name = 'polypeptide_domain' OR cvterm.name = 'membrane_structure' OR cvterm.name = 'extramembrane_polypeptide_region' OR cvterm.name = 'intramembrane_polypeptide_region' OR cvterm.name = 'polypeptide_secondary_structure' OR cvterm.name = 'polypeptide_structural_motif' OR cvterm.name = 'intrinsically_unstructured_polypeptide_region' OR cvterm.name = 'cytoplasmic_polypeptide_region' OR cvterm.name = 'non_cytoplasmic_polypeptide_region' OR cvterm.name = 'membrane_peptide_loop' OR cvterm.name = 'transmembrane_polypeptide_region' OR cvterm.name = 'asx_motif' OR cvterm.name = 'beta_bulge' OR cvterm.name = 'beta_bulge_loop' OR cvterm.name = 'beta_strand' OR cvterm.name = 'peptide_helix' OR cvterm.name = 'polypeptide_nest_motif' OR cvterm.name = 'schellmann_loop' OR cvterm.name = 'serine_threonine_motif' OR cvterm.name = 'serine_threonine_staple_motif' OR cvterm.name = 'polypeptide_turn_motif' OR cvterm.name = 'catmat_left_handed_three' OR cvterm.name = 'catmat_left_handed_four' OR cvterm.name = 'catmat_right_handed_three' OR cvterm.name = 'catmat_right_handed_four' OR cvterm.name = 'alpha_beta_motif' OR cvterm.name = 'peptide_coil' OR cvterm.name = 'beta_bulge_loop_five' OR cvterm.name = 'beta_bulge_loop_six' OR cvterm.name = 'antiparallel_beta_strand' OR cvterm.name = 'parallel_beta_strand' OR cvterm.name = 'left_handed_peptide_helix' OR cvterm.name = 'right_handed_peptide_helix' OR cvterm.name = 'transmembrane_helix' OR cvterm.name = 'alpha_helix' OR cvterm.name = 'pi_helix' OR cvterm.name = 'three_ten_helix' OR cvterm.name = 'polypeptide_nest_left_right_motif' OR cvterm.name = 'polypeptide_nest_right_left_motif' OR cvterm.name = 'schellmann_loop_seven' OR cvterm.name = 'schellmann_loop_six' OR cvterm.name = 'asx_turn' OR cvterm.name = 'beta_turn' OR cvterm.name = 'gamma_turn' OR cvterm.name = 'serine_threonine_turn' OR cvterm.name = 'asx_turn_left_handed_type_one' OR cvterm.name = 'asx_turn_left_handed_type_two' OR cvterm.name = 'asx_turn_right_handed_type_two' OR cvterm.name = 'asx_turn_right_handed_type_one' OR cvterm.name = 'beta_turn_left_handed_type_one' OR cvterm.name = 'beta_turn_left_handed_type_two' OR cvterm.name = 'beta_turn_right_handed_type_one' OR cvterm.name = 'beta_turn_right_handed_type_two' OR cvterm.name = 'beta_turn_type_six' OR cvterm.name = 'beta_turn_type_eight' OR cvterm.name = 'beta_turn_type_six_a' OR cvterm.name = 'beta_turn_type_six_b' OR cvterm.name = 'beta_turn_type_six_a_one' OR cvterm.name = 'beta_turn_type_six_a_two' OR cvterm.name = 'gamma_turn_classic' OR cvterm.name = 'gamma_turn_inverse' OR cvterm.name = 'st_turn_left_handed_type_one' OR cvterm.name = 'st_turn_left_handed_type_two' OR cvterm.name = 'st_turn_right_handed_type_one' OR cvterm.name = 'st_turn_right_handed_type_two' OR cvterm.name = 'coiled_coil' OR cvterm.name = 'helix_turn_helix' OR cvterm.name = 'natural_variant_site' OR cvterm.name = 'mutated_variant_site' OR cvterm.name = 'alternate_sequence_site' OR cvterm.name = 'signal_peptide' OR cvterm.name = 'transit_peptide' OR cvterm.name = 'nuclear_localization_signal' OR cvterm.name = 'endosomal_localization_signal' OR cvterm.name = 'lysosomal_localization_signal' OR cvterm.name = 'nuclear_export_signal' OR cvterm.name = 'nuclear_rim_localization_signal' OR cvterm.name = 'ER_retention_signal' OR cvterm.name = 'mitochondrial_targeting_signal' OR cvterm.name = 'vacuolar_sorting_signal' OR cvterm.name = 'signal_anchor' OR cvterm.name = 'V_region' OR cvterm.name = 'C_region' OR cvterm.name = 'cleaved_initiator_methionine' OR cvterm.name = 'intein' OR cvterm.name = 'propeptide_cleavage_site' OR cvterm.name = 'propeptide' OR cvterm.name = 'cleaved_for_gpi_anchor_region' OR cvterm.name = 'lipoprotein_signal_peptide' OR cvterm.name = 'n_terminal_region' OR cvterm.name = 'c_terminal_region' OR cvterm.name = 'central_hydrophobic_region_of_signal_peptide' OR cvterm.name = 'polypeptide_domain' OR cvterm.name = 'polypeptide_motif' OR cvterm.name = 'polypeptide_repeat' OR cvterm.name = 'biochemical_region_of_peptide' OR cvterm.name = 'polypeptide_conserved_motif' OR cvterm.name = 'post_translationally_modified_region' OR cvterm.name = 'conformational_switch' OR cvterm.name = 'molecular_contact_region' OR cvterm.name = 'polypeptide_binding_motif' OR cvterm.name = 'polypeptide_catalytic_motif' OR cvterm.name = 'histone_modification' OR cvterm.name = 'phosphorylation_site' OR cvterm.name = 'histone_methylation_site' OR cvterm.name = 'histone_acetylation_site' OR cvterm.name = 'histone_ubiqitination_site' OR cvterm.name = 'histone_acylation_region' OR cvterm.name = 'H4K20_monomethylation_site' OR cvterm.name = 'H2BK5_monomethylation_site' OR cvterm.name = 'H3K27_methylation_site' OR cvterm.name = 'H3K36_methylation_site' OR cvterm.name = 'H3K4_methylation_site' OR cvterm.name = 'H3K79_methylation_site' OR cvterm.name = 'H3K9_methylation_site' OR cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'H3K9_acetylation_site' OR cvterm.name = 'H3K14_acetylation_site' OR cvterm.name = 'H3K18_acetylation_site' OR cvterm.name = 'H3K23_acylation_site' OR cvterm.name = 'H3K27_acylation_site' OR cvterm.name = 'H4K16_acylation_site' OR cvterm.name = 'H4K5_acylation_site' OR cvterm.name = 'H4K8_acylation_site' OR cvterm.name = 'H2B_ubiquitination_site' OR cvterm.name = 'H4K_acylation_region' OR cvterm.name = 'polypeptide_metal_contact' OR cvterm.name = 'protein_protein_contact' OR cvterm.name = 'polypeptide_ligand_contact' OR cvterm.name = 'polypeptide_DNA_contact' OR cvterm.name = 'polypeptide_calcium_ion_contact_site' OR cvterm.name = 'polypeptide_cobalt_ion_contact_site' OR cvterm.name = 'polypeptide_copper_ion_contact_site' OR cvterm.name = 'polypeptide_iron_ion_contact_site' OR cvterm.name = 'polypeptide_magnesium_ion_contact_site' OR cvterm.name = 'polypeptide_manganese_ion_contact_site' OR cvterm.name = 'polypeptide_molybdenum_ion_contact_site' OR cvterm.name = 'polypeptide_nickel_ion_contact_site' OR cvterm.name = 'polypeptide_tungsten_ion_contact_site' OR cvterm.name = 'polypeptide_zinc_ion_contact_site' OR cvterm.name = 'DDB_box' OR cvterm.name = 'PIP_box' OR cvterm.name = 'destruction_box' OR cvterm.name = 'KEN_box' OR cvterm.name = 'non_transcribed_region' OR cvterm.name = 'gene_fragment' OR cvterm.name = 'TSS_region' OR cvterm.name = 'gene_segment' OR cvterm.name = 'pseudogenic_gene_segment' OR cvterm.name = 'mobile_intron' OR cvterm.name = 'extrachromosomal_mobile_genetic_element' OR cvterm.name = 'integrated_mobile_genetic_element' OR cvterm.name = 'natural_transposable_element' OR cvterm.name = 'viral_sequence' OR cvterm.name = 'natural_plasmid' OR cvterm.name = 'phage_sequence' OR cvterm.name = 'ds_RNA_viral_sequence' OR cvterm.name = 'ds_DNA_viral_sequence' OR cvterm.name = 'ss_RNA_viral_sequence' OR cvterm.name = 'negative_sense_ssRNA_viral_sequence' OR cvterm.name = 'positive_sense_ssRNA_viral_sequence' OR cvterm.name = 'ambisense_ssRNA_viral_sequence' OR cvterm.name = 'transposable_element' OR cvterm.name = 'proviral_region' OR cvterm.name = 'integron' OR cvterm.name = 'genomic_island' OR cvterm.name = 'integrated_plasmid' OR cvterm.name = 'cointegrated_plasmid' OR cvterm.name = 'retrotransposon' OR cvterm.name = 'DNA_transposon' OR cvterm.name = 'foreign_transposable_element' OR cvterm.name = 'transgenic_transposable_element' OR cvterm.name = 'natural_transposable_element' OR cvterm.name = 'engineered_transposable_element' OR cvterm.name = 'nested_transposon' OR cvterm.name = 'LTR_retrotransposon' OR cvterm.name = 'non_LTR_retrotransposon' OR cvterm.name = 'LINE_element' OR cvterm.name = 'SINE_element' OR cvterm.name = 'terminal_inverted_repeat_element' OR cvterm.name = 'foldback_element' OR cvterm.name = 'conjugative_transposon' OR cvterm.name = 'helitron' OR cvterm.name = 'p_element' OR cvterm.name = 'MITE' OR cvterm.name = 'insertion_sequence' OR cvterm.name = 'polinton' OR cvterm.name = 'engineered_foreign_transposable_element' OR cvterm.name = 'engineered_foreign_transposable_element' OR cvterm.name = 'prophage' OR cvterm.name = 'pathogenic_island' OR cvterm.name = 'metabolic_island' OR cvterm.name = 'adaptive_island' OR cvterm.name = 'symbiosis_island' OR cvterm.name = 'cryptic_prophage' OR cvterm.name = 'defective_conjugative_transposon' OR cvterm.name = 'plasmid' OR cvterm.name = 'chromosome' OR cvterm.name = 'vector_replicon' OR cvterm.name = 'maxicircle' OR cvterm.name = 'minicircle' OR cvterm.name = 'viral_sequence' OR cvterm.name = 'engineered_plasmid' OR cvterm.name = 'episome' OR cvterm.name = 'natural_plasmid' OR cvterm.name = 'engineered_episome' OR cvterm.name = 'gene_trap_construct' OR cvterm.name = 'promoter_trap_construct' OR cvterm.name = 'enhancer_trap_construct' OR cvterm.name = 'engineered_episome' OR cvterm.name = 'mitochondrial_chromosome' OR cvterm.name = 'chloroplast_chromosome' OR cvterm.name = 'chromoplast_chromosome' OR cvterm.name = 'cyanelle_chromosome' OR cvterm.name = 'leucoplast_chromosome' OR cvterm.name = 'macronuclear_chromosome' OR cvterm.name = 'micronuclear_chromosome' OR cvterm.name = 'nuclear_chromosome' OR cvterm.name = 'nucleomorphic_chromosome' OR cvterm.name = 'DNA_chromosome' OR cvterm.name = 'RNA_chromosome' OR cvterm.name = 'apicoplast_chromosome' OR cvterm.name = 'double_stranded_DNA_chromosome' OR cvterm.name = 'single_stranded_DNA_chromosome' OR cvterm.name = 'linear_double_stranded_DNA_chromosome' OR cvterm.name = 'circular_double_stranded_DNA_chromosome' OR cvterm.name = 'linear_single_stranded_DNA_chromosome' OR cvterm.name = 'circular_single_stranded_DNA_chromosome' OR cvterm.name = 'single_stranded_RNA_chromosome' OR cvterm.name = 'double_stranded_RNA_chromosome' OR cvterm.name = 'linear_single_stranded_RNA_chromosome' OR cvterm.name = 'circular_single_stranded_RNA_chromosome' OR cvterm.name = 'linear_double_stranded_RNA_chromosome' OR cvterm.name = 'circular_double_stranded_RNA_chromosome' OR cvterm.name = 'YAC' OR cvterm.name = 'BAC' OR cvterm.name = 'PAC' OR cvterm.name = 'cosmid' OR cvterm.name = 'phagemid' OR cvterm.name = 'fosmid' OR cvterm.name = 'lambda_vector' OR cvterm.name = 'plasmid_vector' OR cvterm.name = 'targeting_vector' OR cvterm.name = 'phage_sequence' OR cvterm.name = 'ds_RNA_viral_sequence' OR cvterm.name = 'ds_DNA_viral_sequence' OR cvterm.name = 'ss_RNA_viral_sequence' OR cvterm.name = 'negative_sense_ssRNA_viral_sequence' OR cvterm.name = 'positive_sense_ssRNA_viral_sequence' OR cvterm.name = 'ambisense_ssRNA_viral_sequence' OR cvterm.name = 'modified_RNA_base_feature' OR cvterm.name = 'modified_DNA_base' OR cvterm.name = 'inosine' OR cvterm.name = 'seven_methylguanine' OR cvterm.name = 'ribothymidine' OR cvterm.name = 'modified_adenosine' OR cvterm.name = 'modified_cytidine' OR cvterm.name = 'modified_guanosine' OR cvterm.name = 'modified_uridine' OR cvterm.name = 'modified_inosine' OR cvterm.name = 'methylinosine' OR cvterm.name = 'one_methylinosine' OR cvterm.name = 'one_two_prime_O_dimethylinosine' OR cvterm.name = 'two_prime_O_methylinosine' OR cvterm.name = 'one_methyladenosine' OR cvterm.name = 'two_methyladenosine' OR cvterm.name = 'N6_methyladenosine' OR cvterm.name = 'two_prime_O_methyladenosine' OR cvterm.name = 'two_methylthio_N6_methyladenosine' OR cvterm.name = 'N6_isopentenyladenosine' OR cvterm.name = 'two_methylthio_N6_isopentenyladenosine' OR cvterm.name = 'N6_cis_hydroxyisopentenyl_adenosine' OR cvterm.name = 'two_methylthio_N6_cis_hydroxyisopentenyl_adenosine' OR cvterm.name = 'N6_glycinylcarbamoyladenosine' OR cvterm.name = 'N6_threonylcarbamoyladenosine' OR cvterm.name = 'two_methylthio_N6_threonyl_carbamoyladenosine' OR cvterm.name = 'N6_methyl_N6_threonylcarbamoyladenosine' OR cvterm.name = 'N6_hydroxynorvalylcarbamoyladenosine' OR cvterm.name = 'two_methylthio_N6_hydroxynorvalyl_carbamoyladenosine' OR cvterm.name = 'two_prime_O_ribosyladenosine_phosphate' OR cvterm.name = 'N6_N6_dimethyladenosine' OR cvterm.name = 'N6_2_prime_O_dimethyladenosine' OR cvterm.name = 'N6_N6_2_prime_O_trimethyladenosine' OR cvterm.name = 'one_two_prime_O_dimethyladenosine' OR cvterm.name = 'N6_acetyladenosine' OR cvterm.name = 'three_methylcytidine' OR cvterm.name = 'five_methylcytidine' OR cvterm.name = 'two_prime_O_methylcytidine' OR cvterm.name = 'two_thiocytidine' OR cvterm.name = 'N4_acetylcytidine' OR cvterm.name = 'five_formylcytidine' OR cvterm.name = 'five_two_prime_O_dimethylcytidine' OR cvterm.name = 'N4_acetyl_2_prime_O_methylcytidine' OR cvterm.name = 'lysidine' OR cvterm.name = 'N4_methylcytidine' OR cvterm.name = 'N4_2_prime_O_dimethylcytidine' OR cvterm.name = 'five_hydroxymethylcytidine' OR cvterm.name = 'five_formyl_two_prime_O_methylcytidine' OR cvterm.name = 'N4_N4_2_prime_O_trimethylcytidine' OR cvterm.name = 'seven_deazaguanosine' OR cvterm.name = 'one_methylguanosine' OR cvterm.name = 'N2_methylguanosine' OR cvterm.name = 'seven_methylguanosine' OR cvterm.name = 'two_prime_O_methylguanosine' OR cvterm.name = 'N2_N2_dimethylguanosine' OR cvterm.name = 'N2_2_prime_O_dimethylguanosine' OR cvterm.name = 'N2_N2_2_prime_O_trimethylguanosine' OR cvterm.name = 'two_prime_O_ribosylguanosine_phosphate' OR cvterm.name = 'wybutosine' OR cvterm.name = 'peroxywybutosine' OR cvterm.name = 'hydroxywybutosine' OR cvterm.name = 'undermodified_hydroxywybutosine' OR cvterm.name = 'wyosine' OR cvterm.name = 'methylwyosine' OR cvterm.name = 'N2_7_dimethylguanosine' OR cvterm.name = 'N2_N2_7_trimethylguanosine' OR cvterm.name = 'one_two_prime_O_dimethylguanosine' OR cvterm.name = 'four_demethylwyosine' OR cvterm.name = 'isowyosine' OR cvterm.name = 'N2_7_2prirme_O_trimethylguanosine' OR cvterm.name = 'queuosine' OR cvterm.name = 'epoxyqueuosine' OR cvterm.name = 'galactosyl_queuosine' OR cvterm.name = 'mannosyl_queuosine' OR cvterm.name = 'seven_cyano_seven_deazaguanosine' OR cvterm.name = 'seven_aminomethyl_seven_deazaguanosine' OR cvterm.name = 'archaeosine' OR cvterm.name = 'dihydrouridine' OR cvterm.name = 'pseudouridine' OR cvterm.name = 'five_methyluridine' OR cvterm.name = 'two_prime_O_methyluridine' OR cvterm.name = 'five_two_prime_O_dimethyluridine' OR cvterm.name = 'one_methylpseudouridine' OR cvterm.name = 'two_prime_O_methylpseudouridine' OR cvterm.name = 'two_thiouridine' OR cvterm.name = 'four_thiouridine' OR cvterm.name = 'five_methyl_2_thiouridine' OR cvterm.name = 'two_thio_two_prime_O_methyluridine' OR cvterm.name = 'three_three_amino_three_carboxypropyl_uridine' OR cvterm.name = 'five_hydroxyuridine' OR cvterm.name = 'five_methoxyuridine' OR cvterm.name = 'uridine_five_oxyacetic_acid' OR cvterm.name = 'uridine_five_oxyacetic_acid_methyl_ester' OR cvterm.name = 'five_carboxyhydroxymethyl_uridine' OR cvterm.name = 'five_carboxyhydroxymethyl_uridine_methyl_ester' OR cvterm.name = 'five_methoxycarbonylmethyluridine' OR cvterm.name = 'five_methoxycarbonylmethyl_two_prime_O_methyluridine' OR cvterm.name = 'five_methoxycarbonylmethyl_two_thiouridine' OR cvterm.name = 'five_aminomethyl_two_thiouridine' OR cvterm.name = 'five_methylaminomethyluridine' OR cvterm.name = 'five_methylaminomethyl_two_thiouridine' OR cvterm.name = 'five_methylaminomethyl_two_selenouridine' OR cvterm.name = 'five_carbamoylmethyluridine' OR cvterm.name = 'five_carbamoylmethyl_two_prime_O_methyluridine' OR cvterm.name = 'five_carboxymethylaminomethyluridine' OR cvterm.name = 'five_carboxymethylaminomethyl_two_prime_O_methyluridine' OR cvterm.name = 'five_carboxymethylaminomethyl_two_thiouridine' OR cvterm.name = 'three_methyluridine' OR cvterm.name = 'one_methyl_three_three_amino_three_carboxypropyl_pseudouridine' OR cvterm.name = 'five_carboxymethyluridine' OR cvterm.name = 'three_two_prime_O_dimethyluridine' OR cvterm.name = 'five_methyldihydrouridine' OR cvterm.name = 'three_methylpseudouridine' OR cvterm.name = 'five_taurinomethyluridine' OR cvterm.name = 'five_taurinomethyl_two_thiouridine' OR cvterm.name = 'five_isopentenylaminomethyl_uridine' OR cvterm.name = 'five_isopentenylaminomethyl_two_thiouridine' OR cvterm.name = 'five_isopentenylaminomethyl_two_prime_O_methyluridine' OR cvterm.name = 'methylated_DNA_base_feature' OR cvterm.name = 'methylated_cytosine' OR cvterm.name = 'methylated_adenine' OR cvterm.name = '5_methylcytosine' OR cvterm.name = 'N4_methylcytosine' OR cvterm.name = 'N6_methyladenine' OR cvterm.name = 'catalytic_residue' OR cvterm.name = 'modified_amino_acid_feature' OR cvterm.name = 'alanine' OR cvterm.name = 'valine' OR cvterm.name = 'leucine' OR cvterm.name = 'isoleucine' OR cvterm.name = 'proline' OR cvterm.name = 'tryptophan' OR cvterm.name = 'phenylalanine' OR cvterm.name = 'methionine' OR cvterm.name = 'glycine' OR cvterm.name = 'serine' OR cvterm.name = 'threonine' OR cvterm.name = 'tyrosine' OR cvterm.name = 'cysteine' OR cvterm.name = 'glutamine' OR cvterm.name = 'asparagine' OR cvterm.name = 'lysine' OR cvterm.name = 'arginine' OR cvterm.name = 'histidine' OR cvterm.name = 'aspartic_acid' OR cvterm.name = 'glutamic_acid' OR cvterm.name = 'selenocysteine' OR cvterm.name = 'pyrrolysine' OR cvterm.name = 'modified_glycine' OR cvterm.name = 'modified_L_alanine' OR cvterm.name = 'modified_L_asparagine' OR cvterm.name = 'modified_L_aspartic_acid' OR cvterm.name = 'modified_L_cysteine' OR cvterm.name = 'modified_L_glutamic_acid' OR cvterm.name = 'modified_L_threonine' OR cvterm.name = 'modified_L_tryptophan' OR cvterm.name = 'modified_L_glutamine' OR cvterm.name = 'modified_L_methionine' OR cvterm.name = 'modified_L_isoleucine' OR cvterm.name = 'modified_L_phenylalanine' OR cvterm.name = 'modified_L_histidine' OR cvterm.name = 'modified_L_serine' OR cvterm.name = 'modified_L_lysine' OR cvterm.name = 'modified_L_leucine' OR cvterm.name = 'modified_L_selenocysteine' OR cvterm.name = 'modified_L_valine' OR cvterm.name = 'modified_L_proline' OR cvterm.name = 'modified_L_tyrosine' OR cvterm.name = 'modified_L_arginine' OR cvterm.name = 'heritable_phenotypic_marker' OR cvterm.name = 'DArT_marker' OR cvterm.name = 'nucleotide_motif' OR cvterm.name = 'DNA_motif' OR cvterm.name = 'RNA_motif' OR cvterm.name = 'PSE_motif' OR cvterm.name = 'CAAT_signal' OR cvterm.name = 'minus_10_signal' OR cvterm.name = 'minus_35_signal' OR cvterm.name = 'DRE_motif' OR cvterm.name = 'E_box_motif' OR cvterm.name = 'INR1_motif' OR cvterm.name = 'GAGA_motif' OR cvterm.name = 'octamer_motif' OR cvterm.name = 'retinoic_acid_responsive_element' OR cvterm.name = 'promoter_element' OR cvterm.name = 'DCE_SI' OR cvterm.name = 'DCE_SII' OR cvterm.name = 'DCE_SIII' OR cvterm.name = 'minus_12_signal' OR cvterm.name = 'minus_24_signal' OR cvterm.name = 'androgen_response_element' OR cvterm.name = 'rDNA_intergenic_spacer_element' OR cvterm.name = 'Sap1_recognition_motif' OR cvterm.name = 'rDNA_replication_fork_barrier' OR cvterm.name = 'GC_rich_promoter_region' OR cvterm.name = 'DMv4_motif' OR cvterm.name = 'DMv5_motif' OR cvterm.name = 'DMv3_motif' OR cvterm.name = 'DMv2_motif' OR cvterm.name = 'DPE1_motif' OR cvterm.name = 'DMv1_motif' OR cvterm.name = 'NDM2_motif' OR cvterm.name = 'NDM3_motif' OR cvterm.name = 'core_promoter_element' OR cvterm.name = 'regulatory_promoter_element' OR cvterm.name = 'CSL_response_element' OR cvterm.name = 'AP_1_binding_site' OR cvterm.name = 'CRE' OR cvterm.name = 'CuRE' OR cvterm.name = 'DRE' OR cvterm.name = 'FLEX_element' OR cvterm.name = 'forkhead_motif' OR cvterm.name = 'homol_E_box' OR cvterm.name = 'HSE' OR cvterm.name = 'mating_type_M_box' OR cvterm.name = 'MCB' OR cvterm.name = 'CCAAT_motif' OR cvterm.name = 'Ace2_UAS' OR cvterm.name = 'TR_box' OR cvterm.name = 'STREP_motif' OR cvterm.name = 'sterol_regulatory_element' OR cvterm.name = 'CDRE_motif' OR cvterm.name = 'PCB' OR cvterm.name = 'm26_site' OR cvterm.name = 'INR_motif' OR cvterm.name = 'DPE_motif' OR cvterm.name = 'BREu_motif' OR cvterm.name = 'TATA_box' OR cvterm.name = 'A_box' OR cvterm.name = 'B_box' OR cvterm.name = 'C_box' OR cvterm.name = 'MTE' OR cvterm.name = 'BREd_motif' OR cvterm.name = 'DCE' OR cvterm.name = 'intermediate_element' OR cvterm.name = 'GATA_box' OR cvterm.name = 'homol_D_box' OR cvterm.name = 'AACCCT_box' OR cvterm.name = 'RNA_polymerase_II_TATA_box' OR cvterm.name = 'RNA_polymerase_III_TATA_box' OR cvterm.name = 'A_box_type_1' OR cvterm.name = 'A_box_type_2' OR cvterm.name = 'iron_repressed_GATA_element' OR cvterm.name = 'proximal_promoter_element' OR cvterm.name = 'distal_promoter_element' OR cvterm.name = 'RNA_internal_loop' OR cvterm.name = 'A_minor_RNA_motif' OR cvterm.name = 'RNA_junction_loop' OR cvterm.name = 'hammerhead_ribozyme' OR cvterm.name = 'asymmetric_RNA_internal_loop' OR cvterm.name = 'symmetric_RNA_internal_loop' OR cvterm.name = 'K_turn_RNA_motif' OR cvterm.name = 'sarcin_like_RNA_motif' OR cvterm.name = 'RNA_hook_turn' OR cvterm.name = 'blunt_end_restriction_enzyme_cleavage_site' OR cvterm.name = 'sticky_end_restriction_enzyme_cleavage_site' OR cvterm.name = 'modified_DNA_base' OR cvterm.name = 'epigenetically_modified_gene' OR cvterm.name = 'histone_modification' OR cvterm.name = 'methylated_DNA_base_feature' OR cvterm.name = 'methylated_cytosine' OR cvterm.name = 'methylated_adenine' OR cvterm.name = '5_methylcytosine' OR cvterm.name = 'N4_methylcytosine' OR cvterm.name = 'N6_methyladenine' OR cvterm.name = 'gene_rearranged_at_DNA_level' OR cvterm.name = 'maternally_imprinted_gene' OR cvterm.name = 'paternally_imprinted_gene' OR cvterm.name = 'allelically_excluded_gene' OR cvterm.name = 'histone_methylation_site' OR cvterm.name = 'histone_acetylation_site' OR cvterm.name = 'histone_ubiqitination_site' OR cvterm.name = 'histone_acylation_region' OR cvterm.name = 'H4K20_monomethylation_site' OR cvterm.name = 'H2BK5_monomethylation_site' OR cvterm.name = 'H3K27_methylation_site' OR cvterm.name = 'H3K36_methylation_site' OR cvterm.name = 'H3K4_methylation_site' OR cvterm.name = 'H3K79_methylation_site' OR cvterm.name = 'H3K9_methylation_site' OR cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'H3K9_acetylation_site' OR cvterm.name = 'H3K14_acetylation_site' OR cvterm.name = 'H3K18_acetylation_site' OR cvterm.name = 'H3K23_acylation_site' OR cvterm.name = 'H3K27_acylation_site' OR cvterm.name = 'H4K16_acylation_site' OR cvterm.name = 'H4K5_acylation_site' OR cvterm.name = 'H4K8_acylation_site' OR cvterm.name = 'H2B_ubiquitination_site' OR cvterm.name = 'H4K_acylation_region' OR cvterm.name = 'interchromosomal_breakpoint' OR cvterm.name = 'intrachromosomal_breakpoint' OR cvterm.name = 'operon' OR cvterm.name = 'mating_type_region' OR cvterm.name = 'gene_array' OR cvterm.name = 'gene_subarray' OR cvterm.name = 'gene_cassette_array' OR cvterm.name = 'regulon' OR cvterm.name = 'sequence_length_variation' OR cvterm.name = 'MNP' OR cvterm.name = 'SNV' OR cvterm.name = 'complex_substitution' OR cvterm.name = 'simple_sequence_length_variation' OR cvterm.name = 'SNP' OR cvterm.name = 'point_mutation' OR cvterm.name = 'transition' OR cvterm.name = 'transversion' OR cvterm.name = 'pyrimidine_transition' OR cvterm.name = 'purine_transition' OR cvterm.name = 'C_to_T_transition' OR cvterm.name = 'T_to_C_transition' OR cvterm.name = 'C_to_T_transition_at_pCpG_site' OR cvterm.name = 'A_to_G_transition' OR cvterm.name = 'G_to_A_transition' OR cvterm.name = 'pyrimidine_to_purine_transversion' OR cvterm.name = 'purine_to_pyrimidine_transversion' OR cvterm.name = 'C_to_A_transversion' OR cvterm.name = 'C_to_G_transversion' OR cvterm.name = 'T_to_A_transversion' OR cvterm.name = 'T_to_G_transversion' OR cvterm.name = 'A_to_C_transversion' OR cvterm.name = 'A_to_T_transversion' OR cvterm.name = 'G_to_C_transversion' OR cvterm.name = 'G_to_T_transversion' OR cvterm.name = 'biological_region';

--- ************************************************
--- *** relation: topologically_defined_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region that is defined according to it ***
--- *** s relations with other regions within th ***
--- *** e same sequence.                         ***
--- ************************************************
---

CREATE VIEW topologically_defined_region AS
  SELECT
    feature_id AS topologically_defined_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'flanking_region' OR cvterm.name = 'repeat_component' OR cvterm.name = 'transposable_element_flanking_region' OR cvterm.name = 'five_prime_flanking_region' OR cvterm.name = 'three_prime_flanking_region' OR cvterm.name = 'non_LTR_retrotransposon_polymeric_tract' OR cvterm.name = 'LTR_component' OR cvterm.name = 'repeat_fragment' OR cvterm.name = 'transposon_fragment' OR cvterm.name = 'U5_LTR_region' OR cvterm.name = 'R_LTR_region' OR cvterm.name = 'U3_LTR_region' OR cvterm.name = 'three_prime_LTR_component' OR cvterm.name = 'five_prime_LTR_component' OR cvterm.name = 'U5_five_prime_LTR_region' OR cvterm.name = 'R_five_prime_LTR_region' OR cvterm.name = 'U3_five_prime_LTR_region' OR cvterm.name = 'R_three_prime_LTR_region' OR cvterm.name = 'U3_three_prime_LTR_region' OR cvterm.name = 'U5_three_prime_LTR_region' OR cvterm.name = 'R_five_prime_LTR_region' OR cvterm.name = 'U5_five_prime_LTR_region' OR cvterm.name = 'U3_five_prime_LTR_region' OR cvterm.name = 'topologically_defined_region';

--- ************************************************
--- *** relation: translocation_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The point within a chromosome where a tr ***
--- *** anslocation begins or ends.              ***
--- ************************************************
---

CREATE VIEW translocation_breakpoint AS
  SELECT
    feature_id AS translocation_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'translocation_breakpoint';

--- ************************************************
--- *** relation: insertion_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The point within a chromosome where a in ***
--- *** sertion begins or ends.                  ***
--- ************************************************
---

CREATE VIEW insertion_breakpoint AS
  SELECT
    feature_id AS insertion_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'insertion_breakpoint';

--- ************************************************
--- *** relation: deletion_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The point within a chromosome where a de ***
--- *** letion begins or ends.                   ***
--- ************************************************
---

CREATE VIEW deletion_breakpoint AS
  SELECT
    feature_id AS deletion_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'deletion_breakpoint';

--- ************************************************
--- *** relation: five_prime_flanking_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A flanking region located five prime of  ***
--- *** a specific region.                       ***
--- ************************************************
---

CREATE VIEW five_prime_flanking_region AS
  SELECT
    feature_id AS five_prime_flanking_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_flanking_region';

--- ************************************************
--- *** relation: three_prime_flanking_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A flanking region located three prime of ***
--- ***  a specific region.                      ***
--- ************************************************
---

CREATE VIEW three_prime_flanking_region AS
  SELECT
    feature_id AS three_prime_flanking_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_flanking_region';

--- ************************************************
--- *** relation: transcribed_fragment ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An experimental region, defined by a til ***
--- *** ing array experiment to be transcribed a ***
--- *** t some level.                            ***
--- ************************************************
---

CREATE VIEW transcribed_fragment AS
  SELECT
    feature_id AS transcribed_fragment_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'transcribed_fragment';

--- ************************************************
--- *** relation: cis_splice_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Intronic 2 bp region bordering exon. A s ***
--- *** plice_site that adjacent_to exon and ove ***
--- *** rlaps intron.                            ***
--- ************************************************
---

CREATE VIEW cis_splice_site AS
  SELECT
    feature_id AS cis_splice_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_cis_splice_site' OR cvterm.name = 'three_prime_cis_splice_site' OR cvterm.name = 'recursive_splice_site' OR cvterm.name = 'canonical_five_prime_splice_site' OR cvterm.name = 'non_canonical_five_prime_splice_site' OR cvterm.name = 'canonical_three_prime_splice_site' OR cvterm.name = 'non_canonical_three_prime_splice_site' OR cvterm.name = 'cis_splice_site';

--- ************************************************
--- *** relation: trans_splice_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Primary transcript region bordering tran ***
--- *** s-splice junction.                       ***
--- ************************************************
---

CREATE VIEW trans_splice_site AS
  SELECT
    feature_id AS trans_splice_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'trans_splice_acceptor_site' OR cvterm.name = 'trans_splice_donor_site' OR cvterm.name = 'SL1_acceptor_site' OR cvterm.name = 'SL2_acceptor_site' OR cvterm.name = 'SL3_acceptor_site' OR cvterm.name = 'SL4_acceptor_site' OR cvterm.name = 'SL5_acceptor_site' OR cvterm.name = 'SL6_acceptor_site' OR cvterm.name = 'SL7_acceptor_site' OR cvterm.name = 'SL8_acceptor_site' OR cvterm.name = 'SL9_acceptor_site' OR cvterm.name = 'SL10_acceptor_site' OR cvterm.name = 'SL11_acceptor_site' OR cvterm.name = 'SL12_acceptor_site' OR cvterm.name = 'trans_splice_site';

--- ************************************************
--- *** relation: splice_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The boundary between an intron and an ex ***
--- *** on.                                      ***
--- ************************************************
---

CREATE VIEW splice_junction AS
  SELECT
    feature_id AS splice_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_junction';

--- ************************************************
--- *** relation: conformational_switch ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of a polypeptide, involved in t ***
--- *** he transition from one conformational st ***
--- *** ate to another.                          ***
--- ************************************************
---

CREATE VIEW conformational_switch AS
  SELECT
    feature_id AS conformational_switch_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conformational_switch';

--- ************************************************
--- *** relation: dye_terminator_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A read produced by the dye terminator me ***
--- *** thod of sequencing.                      ***
--- ************************************************
---

CREATE VIEW dye_terminator_read AS
  SELECT
    feature_id AS dye_terminator_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'dye_terminator_read';

--- ************************************************
--- *** relation: pyrosequenced_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A read produced by pyrosequencing techno ***
--- *** logy.                                    ***
--- ************************************************
---

CREATE VIEW pyrosequenced_read AS
  SELECT
    feature_id AS pyrosequenced_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pyrosequenced_read';

--- ************************************************
--- *** relation: ligation_based_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A read produced by ligation based sequen ***
--- *** cing technologies.                       ***
--- ************************************************
---

CREATE VIEW ligation_based_read AS
  SELECT
    feature_id AS ligation_based_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ligation_based_read';

--- ************************************************
--- *** relation: polymerase_synthesis_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A read produced by the polymerase based  ***
--- *** sequence by synthesis method.            ***
--- ************************************************
---

CREATE VIEW polymerase_synthesis_read AS
  SELECT
    feature_id AS polymerase_synthesis_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polymerase_synthesis_read';

--- ************************************************
--- *** relation: cis_regulatory_frameshift_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A structural region in an RNA molecule w ***
--- *** hich promotes ribosomal frameshifting of ***
--- ***  cis coding sequence.                    ***
--- ************************************************
---

CREATE VIEW cis_regulatory_frameshift_element AS
  SELECT
    feature_id AS cis_regulatory_frameshift_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cis_regulatory_frameshift_element';

--- ************************************************
--- *** relation: expressed_sequence_assembly ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence assembly derived from express ***
--- *** ed sequences.                            ***
--- ************************************************
---

CREATE VIEW expressed_sequence_assembly AS
  SELECT
    feature_id AS expressed_sequence_assembly_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'expressed_sequence_assembly';

--- ************************************************
--- *** relation: dna_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the molecule, in ***
--- *** teracts selectively and non-covalently w ***
--- *** ith DNA.                                 ***
--- ************************************************
---

CREATE VIEW dna_binding_site AS
  SELECT
    feature_id AS dna_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_DNA_contact' OR cvterm.name = 'DNA_binding_site';

--- ************************************************
--- *** relation: cryptic_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that is not transcribed under nor ***
--- *** mal conditions and is not critical to no ***
--- *** rmal cellular functioning.               ***
--- ************************************************
---

CREATE VIEW cryptic_gene AS
  SELECT
    feature_id AS cryptic_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptogene' OR cvterm.name = 'cryptic_gene';

--- ************************************************
--- *** relation: three_prime_race_clone ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A three prime RACE (Rapid Amplification  ***
--- *** of cDNA Ends) clone is a cDNA clone copi ***
--- *** ed from the 3' end of an mRNA (using a p ***
--- *** oly-dT primer to capture the polyA tail  ***
--- *** and a gene-specific or randomly primed 5 ***
--- *** ' primer), and spliced into a vector for ***
--- ***  propagation in a suitable host.         ***
--- ************************************************
---

CREATE VIEW three_prime_race_clone AS
  SELECT
    feature_id AS three_prime_race_clone_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_RACE_clone';

--- ************************************************
--- *** relation: cassette_pseudogene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A cassette pseudogene is a kind of gene  ***
--- *** in an inactive form which may recombine  ***
--- *** at a telomeric locus to form a functiona ***
--- *** l copy.                                  ***
--- ************************************************
---

CREATE VIEW cassette_pseudogene AS
  SELECT
    feature_id AS cassette_pseudogene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cassette_pseudogene';

--- ************************************************
--- *** relation: alanine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW alanine AS
  SELECT
    feature_id AS alanine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'alanine';

--- ************************************************
--- *** relation: valine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW valine AS
  SELECT
    feature_id AS valine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'valine';

--- ************************************************
--- *** relation: leucine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW leucine AS
  SELECT
    feature_id AS leucine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'leucine';

--- ************************************************
--- *** relation: isoleucine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW isoleucine AS
  SELECT
    feature_id AS isoleucine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'isoleucine';

--- ************************************************
--- *** relation: proline ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW proline AS
  SELECT
    feature_id AS proline_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'proline';

--- ************************************************
--- *** relation: tryptophan ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW tryptophan AS
  SELECT
    feature_id AS tryptophan_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tryptophan';

--- ************************************************
--- *** relation: phenylalanine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW phenylalanine AS
  SELECT
    feature_id AS phenylalanine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'phenylalanine';

--- ************************************************
--- *** relation: methionine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW methionine AS
  SELECT
    feature_id AS methionine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'methionine';

--- ************************************************
--- *** relation: glycine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW glycine AS
  SELECT
    feature_id AS glycine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'glycine';

--- ************************************************
--- *** relation: serine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW serine AS
  SELECT
    feature_id AS serine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'serine';

--- ************************************************
--- *** relation: threonine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW threonine AS
  SELECT
    feature_id AS threonine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'threonine';

--- ************************************************
--- *** relation: tyrosine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW tyrosine AS
  SELECT
    feature_id AS tyrosine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tyrosine';

--- ************************************************
--- *** relation: cysteine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW cysteine AS
  SELECT
    feature_id AS cysteine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cysteine';

--- ************************************************
--- *** relation: glutamine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW glutamine AS
  SELECT
    feature_id AS glutamine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'glutamine';

--- ************************************************
--- *** relation: asparagine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW asparagine AS
  SELECT
    feature_id AS asparagine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'asparagine';

--- ************************************************
--- *** relation: lysine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW lysine AS
  SELECT
    feature_id AS lysine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'lysine';

--- ************************************************
--- *** relation: arginine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW arginine AS
  SELECT
    feature_id AS arginine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'arginine';

--- ************************************************
--- *** relation: histidine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW histidine AS
  SELECT
    feature_id AS histidine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'histidine';

--- ************************************************
--- *** relation: aspartic_acid ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW aspartic_acid AS
  SELECT
    feature_id AS aspartic_acid_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'aspartic_acid';

--- ************************************************
--- *** relation: glutamic_acid ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW glutamic_acid AS
  SELECT
    feature_id AS glutamic_acid_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'glutamic_acid';

--- ************************************************
--- *** relation: selenocysteine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW selenocysteine AS
  SELECT
    feature_id AS selenocysteine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'selenocysteine';

--- ************************************************
--- *** relation: pyrrolysine ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW pyrrolysine AS
  SELECT
    feature_id AS pyrrolysine_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pyrrolysine';

--- ************************************************
--- *** relation: transcribed_cluster ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region defined by a set of transcribed ***
--- ***  sequences from the same gene or express ***
--- *** ed pseudogene.                           ***
--- ************************************************
---

CREATE VIEW transcribed_cluster AS
  SELECT
    feature_id AS transcribed_cluster_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'unigene_cluster' OR cvterm.name = 'transcribed_cluster';

--- ************************************************
--- *** relation: unigene_cluster ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of transcribed_cluster defined by ***
--- ***  a set of transcribed sequences from the ***
--- ***  a unique gene.                          ***
--- ************************************************
---

CREATE VIEW unigene_cluster AS
  SELECT
    feature_id AS unigene_cluster_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'unigene_cluster';

--- ************************************************
--- *** relation: crispr ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Clustered Palindromic Repeats interspers ***
--- *** ed with bacteriophage derived spacer seq ***
--- *** uences.                                  ***
--- ************************************************
---

CREATE VIEW crispr AS
  SELECT
    feature_id AS crispr_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CRISPR';

--- ************************************************
--- *** relation: insulator_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in an insulator reg ***
--- *** ion of a nucleotide molecule, interacts  ***
--- *** selectively and non-covalently with poly ***
--- *** peptide residues.                        ***
--- ************************************************
---

CREATE VIEW insulator_binding_site AS
  SELECT
    feature_id AS insulator_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'insulator_binding_site';

--- ************************************************
--- *** relation: enhancer_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the enhancer reg ***
--- *** ion of a nucleotide molecule, interacts  ***
--- *** selectively and non-covalently with poly ***
--- *** peptide residues.                        ***
--- ************************************************
---

CREATE VIEW enhancer_binding_site AS
  SELECT
    feature_id AS enhancer_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'enhancer_binding_site';

--- ************************************************
--- *** relation: contig_collection ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A collection of contigs.                 ***
--- ************************************************
---

CREATE VIEW contig_collection AS
  SELECT
    feature_id AS contig_collection_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'contig_collection';

--- ************************************************
--- *** relation: lincrna ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A multiexonic non-coding RNA transcribed ***
--- ***  by RNA polymerase II.                   ***
--- ************************************************
---

CREATE VIEW lincrna AS
  SELECT
    feature_id AS lincrna_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'lincRNA';

--- ************************************************
--- *** relation: ust ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An EST spanning part or all of the untra ***
--- *** nslated regions of a protein-coding tran ***
--- *** script.                                  ***
--- ************************************************
---

CREATE VIEW ust AS
  SELECT
    feature_id AS ust_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_UST' OR cvterm.name = 'five_prime_UST' OR cvterm.name = 'UST';

--- ************************************************
--- *** relation: three_prime_ust ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A UST located in the 3'UTR of a protein- ***
--- *** coding transcript.                       ***
--- ************************************************
---

CREATE VIEW three_prime_ust AS
  SELECT
    feature_id AS three_prime_ust_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_UST';

--- ************************************************
--- *** relation: five_prime_ust ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An UST located in the 5'UTR of a protein ***
--- *** -coding transcript.                      ***
--- ************************************************
---

CREATE VIEW five_prime_ust AS
  SELECT
    feature_id AS five_prime_ust_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_UST';

--- ************************************************
--- *** relation: rst ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A tag produced from a single sequencing  ***
--- *** read from a RACE product; typically a fe ***
--- *** w hundred base pairs long.               ***
--- ************************************************
---

CREATE VIEW rst AS
  SELECT
    feature_id AS rst_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_RST' OR cvterm.name = 'five_prime_RST' OR cvterm.name = 'RST';

--- ************************************************
--- *** relation: three_prime_rst ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A tag produced from a single sequencing  ***
--- *** read from a 3'-RACE product; typically a ***
--- ***  few hundred base pairs long.            ***
--- ************************************************
---

CREATE VIEW three_prime_rst AS
  SELECT
    feature_id AS three_prime_rst_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_RST';

--- ************************************************
--- *** relation: five_prime_rst ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A tag produced from a single sequencing  ***
--- *** read from a 5'-RACE product; typically a ***
--- ***  few hundred base pairs long.            ***
--- ************************************************
---

CREATE VIEW five_prime_rst AS
  SELECT
    feature_id AS five_prime_rst_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_RST';

--- ************************************************
--- *** relation: ust_match ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A match against an UST sequence.         ***
--- ************************************************
---

CREATE VIEW ust_match AS
  SELECT
    feature_id AS ust_match_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'UST_match';

--- ************************************************
--- *** relation: rst_match ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A match against an RST sequence.         ***
--- ************************************************
---

CREATE VIEW rst_match AS
  SELECT
    feature_id AS rst_match_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RST_match';

--- ************************************************
--- *** relation: primer_match ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A nucleotide match to a primer sequence. ***
--- ************************************************
---

CREATE VIEW primer_match AS
  SELECT
    feature_id AS primer_match_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'primer_match';

--- ************************************************
--- *** relation: mirna_antiguide ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of the pri miRNA that basepairs ***
--- ***  with the guide to form the hairpin.     ***
--- ************************************************
---

CREATE VIEW mirna_antiguide AS
  SELECT
    feature_id AS mirna_antiguide_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'miRNA_antiguide';

--- ************************************************
--- *** relation: trans_splice_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The boundary between the spliced leader  ***
--- *** and the first exon of the mRNA.          ***
--- ************************************************
---

CREATE VIEW trans_splice_junction AS
  SELECT
    feature_id AS trans_splice_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'trans_splice_junction';

--- ************************************************
--- *** relation: outron ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of a primary transcript, that i ***
--- *** s removed via trans splicing.            ***
--- ************************************************
---

CREATE VIEW outron AS
  SELECT
    feature_id AS outron_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'outron';

--- ************************************************
--- *** relation: natural_plasmid ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A plasmid that occurs naturally.         ***
--- ************************************************
---

CREATE VIEW natural_plasmid AS
  SELECT
    feature_id AS natural_plasmid_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'natural_plasmid';

--- ************************************************
--- *** relation: gene_trap_construct ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene trap construct is a type of engin ***
--- *** eered plasmid which is designed to integ ***
--- *** rate into a genome and produce a fusion  ***
--- *** transcript between exons of the gene int ***
--- *** o which it inserts and a reporter elemen ***
--- *** t in the construct. Gene traps contain a ***
--- ***  splice acceptor, do not contain promote ***
--- *** r elements for the reporter, and are mut ***
--- *** agenic. Gene traps may be bicistronic wi ***
--- *** th the second cassette containing a prom ***
--- *** oter driving an a selectable marker.     ***
--- ************************************************
---

CREATE VIEW gene_trap_construct AS
  SELECT
    feature_id AS gene_trap_construct_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'gene_trap_construct';

--- ************************************************
--- *** relation: promoter_trap_construct ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter trap construct is a type of e ***
--- *** ngineered plasmid which is designed to i ***
--- *** ntegrate into a genome and express a rep ***
--- *** orter when inserted in close proximity t ***
--- *** o a promoter element. Promoter traps typ ***
--- *** ically do not contain promoter elements  ***
--- *** and are mutagenic.                       ***
--- ************************************************
---

CREATE VIEW promoter_trap_construct AS
  SELECT
    feature_id AS promoter_trap_construct_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'promoter_trap_construct';

--- ************************************************
--- *** relation: enhancer_trap_construct ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An enhancer trap construct is a type of  ***
--- *** engineered plasmid which is designed to  ***
--- *** integrate into a genome and express a re ***
--- *** porter when the expression from a basic  ***
--- *** minimal promoter is enhanced by genomic  ***
--- *** enhancer elements. Enhancer traps contai ***
--- *** n promoter elements and are not usually  ***
--- *** mutagenic.                               ***
--- ************************************************
---

CREATE VIEW enhancer_trap_construct AS
  SELECT
    feature_id AS enhancer_trap_construct_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'enhancer_trap_construct';

--- ************************************************
--- *** relation: pac_end ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of sequence from the end of a P ***
--- *** AC clone that may provide a highly speci ***
--- *** fic marker.                              ***
--- ************************************************
---

CREATE VIEW pac_end AS
  SELECT
    feature_id AS pac_end_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'PAC_end';

--- ************************************************
--- *** relation: rapd ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** RAPD is a 'PCR product' where a sequence ***
--- ***  variant is identified through the use o ***
--- *** f PCR with random primers.               ***
--- ************************************************
---

CREATE VIEW rapd AS
  SELECT
    feature_id AS rapd_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RAPD';

--- ************************************************
--- *** relation: shadow_enhancer ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW shadow_enhancer AS
  SELECT
    feature_id AS shadow_enhancer_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'shadow_enhancer';

--- ************************************************
--- *** relation: snv ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** SNVs are single nucleotide positions in  ***
--- *** genomic DNA at which different sequence  ***
--- *** alternatives exist.                      ***
--- ************************************************
---

CREATE VIEW snv AS
  SELECT
    feature_id AS snv_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SNP' OR cvterm.name = 'point_mutation' OR cvterm.name = 'transition' OR cvterm.name = 'transversion' OR cvterm.name = 'pyrimidine_transition' OR cvterm.name = 'purine_transition' OR cvterm.name = 'C_to_T_transition' OR cvterm.name = 'T_to_C_transition' OR cvterm.name = 'C_to_T_transition_at_pCpG_site' OR cvterm.name = 'A_to_G_transition' OR cvterm.name = 'G_to_A_transition' OR cvterm.name = 'pyrimidine_to_purine_transversion' OR cvterm.name = 'purine_to_pyrimidine_transversion' OR cvterm.name = 'C_to_A_transversion' OR cvterm.name = 'C_to_G_transversion' OR cvterm.name = 'T_to_A_transversion' OR cvterm.name = 'T_to_G_transversion' OR cvterm.name = 'A_to_C_transversion' OR cvterm.name = 'A_to_T_transversion' OR cvterm.name = 'G_to_C_transversion' OR cvterm.name = 'G_to_T_transversion' OR cvterm.name = 'SNV';

--- ************************************************
--- *** relation: x_element_combinatorial_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An X element combinatorial repeat is a r ***
--- *** epeat region located between the X eleme ***
--- *** nt and the telomere or adjacent Y' eleme ***
--- *** nt.                                      ***
--- ************************************************
---

CREATE VIEW x_element_combinatorial_repeat AS
  SELECT
    feature_id AS x_element_combinatorial_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'X_element_combinatorial_repeat';

--- ************************************************
--- *** relation: y_prime_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A Y' element is a repeat region (SO:0000 ***
--- *** 657) located adjacent to telomeric repea ***
--- *** ts or X element combinatorial repeats, e ***
--- *** ither as a single copy or tandem repeat  ***
--- *** of two to four copies.                   ***
--- ************************************************
---

CREATE VIEW y_prime_element AS
  SELECT
    feature_id AS y_prime_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'Y_prime_element';

--- ************************************************
--- *** relation: standard_draft ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence, w ***
--- *** here the data is minimally filtered or u ***
--- *** n-filtered, from any number of sequencin ***
--- *** g platforms, and is assembled into conti ***
--- *** gs. Genome sequence of this quality may  ***
--- *** harbour regions of poor quality and can  ***
--- *** be relatively incomplete.                ***
--- ************************************************
---

CREATE VIEW standard_draft AS
  SELECT
    feature_id AS standard_draft_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'standard_draft';

--- ************************************************
--- *** relation: high_quality_draft ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence, w ***
--- *** here overall coverage represents at leas ***
--- *** t 90 percent of the genome.              ***
--- ************************************************
---

CREATE VIEW high_quality_draft AS
  SELECT
    feature_id AS high_quality_draft_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'high_quality_draft';

--- ************************************************
--- *** relation: improved_high_quality_draft ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence, w ***
--- *** here additional work has been performed, ***
--- ***  using either manual or automated method ***
--- *** s, such as gap resolution.               ***
--- ************************************************
---

CREATE VIEW improved_high_quality_draft AS
  SELECT
    feature_id AS improved_high_quality_draft_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'improved_high_quality_draft';

--- ************************************************
--- *** relation: annotation_directed_improved_draft ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence,wh ***
--- *** ere annotation, and verification of codi ***
--- *** ng regions has occurred.                 ***
--- ************************************************
---

CREATE VIEW annotation_directed_improved_draft AS
  SELECT
    feature_id AS annotation_directed_improved_draft_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'annotation_directed_improved_draft';

--- ************************************************
--- *** relation: noncontiguous_finished ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence, w ***
--- *** here the assembly is high quality, closu ***
--- *** re approaches have been successful for m ***
--- *** ost gaps, misassemblies and low quality  ***
--- *** regions.                                 ***
--- ************************************************
---

CREATE VIEW noncontiguous_finished AS
  SELECT
    feature_id AS noncontiguous_finished_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'noncontiguous_finished';

--- ************************************************
--- *** relation: finished_genome ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of a whole genome sequence, w ***
--- *** ith less than 1 error per 100,000 base p ***
--- *** airs.                                    ***
--- ************************************************
---

CREATE VIEW finished_genome AS
  SELECT
    feature_id AS finished_genome_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'finished_genome';

--- ************************************************
--- *** relation: intronic_regulatory_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regulatory region that is part of an i ***
--- *** ntron.                                   ***
--- ************************************************
---

CREATE VIEW intronic_regulatory_region AS
  SELECT
    feature_id AS intronic_regulatory_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intronic_regulatory_region';

--- ************************************************
--- *** relation: centromere_dna_element_i ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A centromere DNA Element I (CDEI) is a c ***
--- *** onserved region, part of the centromere, ***
--- ***  consisting of a consensus region compos ***
--- *** ed of 8-11bp which enables binding by th ***
--- *** e centromere binding factor 1(Cbf1p).    ***
--- ************************************************
---

CREATE VIEW centromere_dna_element_i AS
  SELECT
    feature_id AS centromere_dna_element_i_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'centromere_DNA_Element_I';

--- ************************************************
--- *** relation: centromere_dna_element_ii ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A centromere DNA Element II (CDEII) is p ***
--- *** art a conserved region of the centromere ***
--- *** , consisting of a consensus region that  ***
--- *** is AT-rich and ~ 75-100 bp in length.    ***
--- ************************************************
---

CREATE VIEW centromere_dna_element_ii AS
  SELECT
    feature_id AS centromere_dna_element_ii_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'centromere_DNA_Element_II';

--- ************************************************
--- *** relation: centromere_dna_element_iii ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A centromere DNA Element I (CDEI) is a c ***
--- *** onserved region, part of the centromere, ***
--- ***  consisting of a consensus region that c ***
--- *** onsists of a 25-bp which enables binding ***
--- ***  by the centromere DNA binding factor 3  ***
--- *** (CBF3) complex.                          ***
--- ************************************************
---

CREATE VIEW centromere_dna_element_iii AS
  SELECT
    feature_id AS centromere_dna_element_iii_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'centromere_DNA_Element_III';

--- ************************************************
--- *** relation: telomeric_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The telomeric repeat is a repeat region, ***
--- ***  part of the chromosome, which in yeast, ***
--- ***  is a G-rich terminal sequence of the fo ***
--- *** rm (TG(1-3))n or more precisely ((TG)(1- ***
--- *** 6)TG(2-3))n.                             ***
--- ************************************************
---

CREATE VIEW telomeric_repeat AS
  SELECT
    feature_id AS telomeric_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'telomeric_repeat';

--- ************************************************
--- *** relation: x_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The X element is a conserved region, of  ***
--- *** the telomere, of ~475 bp that contains a ***
--- *** n ARS sequence and in most cases an Abf1 ***
--- *** p binding site.                          ***
--- ************************************************
---

CREATE VIEW x_element AS
  SELECT
    feature_id AS x_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'X_element';

--- ************************************************
--- *** relation: yac_end ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of sequence from the end of a Y ***
--- *** AC clone that may provide a highly speci ***
--- *** fic marker.                              ***
--- ************************************************
---

CREATE VIEW yac_end AS
  SELECT
    feature_id AS yac_end_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'YAC_end';

--- ************************************************
--- *** relation: whole_genome_sequence_status ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The status of whole genome sequence.     ***
--- ************************************************
---

CREATE VIEW whole_genome_sequence_status AS
  SELECT
    feature_id AS whole_genome_sequence_status_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'standard_draft' OR cvterm.name = 'high_quality_draft' OR cvterm.name = 'improved_high_quality_draft' OR cvterm.name = 'annotation_directed_improved_draft' OR cvterm.name = 'noncontiguous_finished' OR cvterm.name = 'finished_genome' OR cvterm.name = 'whole_genome_sequence_status';

--- ************************************************
--- *** relation: heritable_phenotypic_marker ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A biological_region characterized as a s ***
--- *** ingle heritable trait in a phenotype scr ***
--- *** een. The heritable phenotype may be mapp ***
--- *** ed to a chromosome but generally has not ***
--- ***  been characterized to a specific gene l ***
--- *** ocus.                                    ***
--- ************************************************
---

CREATE VIEW heritable_phenotypic_marker AS
  SELECT
    feature_id AS heritable_phenotypic_marker_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'heritable_phenotypic_marker';

--- ************************************************
--- *** relation: peptide_collection ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A collection of peptide sequences.       ***
--- ************************************************
---

CREATE VIEW peptide_collection AS
  SELECT
    feature_id AS peptide_collection_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'peptide_collection';

--- ************************************************
--- *** relation: high_identity_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An experimental feature with high sequen ***
--- *** ce identity to another sequence.         ***
--- ************************************************
---

CREATE VIEW high_identity_region AS
  SELECT
    feature_id AS high_identity_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'high_identity_region';

--- ************************************************
--- *** relation: processed_transcript ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript for which no open reading f ***
--- *** rame has been identified and for which n ***
--- *** o other function has been determined.    ***
--- ************************************************
---

CREATE VIEW processed_transcript AS
  SELECT
    feature_id AS processed_transcript_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'processed_transcript';

--- ************************************************
--- *** relation: assortment_derived_variation ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A chromosome variation derived from an e ***
--- *** vent during meiosis.                     ***
--- ************************************************
---

CREATE VIEW assortment_derived_variation AS
  SELECT
    feature_id AS assortment_derived_variation_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'assortment_derived_duplication' OR cvterm.name = 'assortment_derived_deficiency_plus_duplication' OR cvterm.name = 'assortment_derived_deficiency' OR cvterm.name = 'assortment_derived_aneuploid' OR cvterm.name = 'assortment_derived_variation';

--- ************************************************
--- *** relation: reference_genome ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A collection of sequences (often chromos ***
--- *** omes) taken as the standard for a given  ***
--- *** organism and genome assembly.            ***
--- ************************************************
---

CREATE VIEW reference_genome AS
  SELECT
    feature_id AS reference_genome_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'reference_genome';

--- ************************************************
--- *** relation: variant_genome ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A collection of sequences (often chromos ***
--- *** omes) of an individual.                  ***
--- ************************************************
---

CREATE VIEW variant_genome AS
  SELECT
    feature_id AS variant_genome_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'chromosomally_aberrant_genome' OR cvterm.name = 'variant_genome';

--- ************************************************
--- *** relation: variant_collection ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A collection of one or more sequences of ***
--- ***  an individual.                          ***
--- ************************************************
---

CREATE VIEW variant_collection AS
  SELECT
    feature_id AS variant_collection_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'chromosome_variation' OR cvterm.name = 'allele' OR cvterm.name = 'haplotype' OR cvterm.name = 'genotype' OR cvterm.name = 'diplotype' OR cvterm.name = 'assortment_derived_variation' OR cvterm.name = 'chromosome_number_variation' OR cvterm.name = 'chromosome_structure_variation' OR cvterm.name = 'assortment_derived_duplication' OR cvterm.name = 'assortment_derived_deficiency_plus_duplication' OR cvterm.name = 'assortment_derived_deficiency' OR cvterm.name = 'assortment_derived_aneuploid' OR cvterm.name = 'aneuploid' OR cvterm.name = 'polyploid' OR cvterm.name = 'hyperploid' OR cvterm.name = 'hypoploid' OR cvterm.name = 'autopolyploid' OR cvterm.name = 'allopolyploid' OR cvterm.name = 'free_chromosome_arm' OR cvterm.name = 'chromosomal_transposition' OR cvterm.name = 'aneuploid_chromosome' OR cvterm.name = 'intrachromosomal_mutation' OR cvterm.name = 'interchromosomal_mutation' OR cvterm.name = 'chromosomal_duplication' OR cvterm.name = 'compound_chromosome' OR cvterm.name = 'autosynaptic_chromosome' OR cvterm.name = 'complex_chromosomal_mutation' OR cvterm.name = 'uncharacterised_chromosomal_mutation' OR cvterm.name = 'intrachromosomal_transposition' OR cvterm.name = 'interchromosomal_transposition' OR cvterm.name = 'deficient_intrachromosomal_transposition' OR cvterm.name = 'inverted_intrachromosomal_transposition' OR cvterm.name = 'uninverted_intrachromosomal_transposition' OR cvterm.name = 'unoriented_intrachromosomal_transposition' OR cvterm.name = 'deficient_interchromosomal_transposition' OR cvterm.name = 'inverted_interchromosomal_transposition' OR cvterm.name = 'uninverted_interchromosomal_transposition' OR cvterm.name = 'unoriented_interchromosomal_transposition' OR cvterm.name = 'inversion_derived_aneuploid_chromosome' OR cvterm.name = 'chromosomal_deletion' OR cvterm.name = 'chromosomal_inversion' OR cvterm.name = 'intrachromosomal_duplication' OR cvterm.name = 'ring_chromosome' OR cvterm.name = 'chromosome_fission' OR cvterm.name = 'deficient_intrachromosomal_transposition' OR cvterm.name = 'inversion_derived_bipartite_deficiency' OR cvterm.name = 'inversion_derived_deficiency_plus_duplication' OR cvterm.name = 'inversion_derived_deficiency_plus_aneuploid' OR cvterm.name = 'deficient_translocation' OR cvterm.name = 'deficient_inversion' OR cvterm.name = 'inverted_ring_chromosome' OR cvterm.name = 'pericentric_inversion' OR cvterm.name = 'paracentric_inversion' OR cvterm.name = 'inversion_cum_translocation' OR cvterm.name = 'bipartite_inversion' OR cvterm.name = 'deficient_inversion' OR cvterm.name = 'inverted_intrachromosomal_transposition' OR cvterm.name = 'inversion_derived_deficiency_plus_duplication' OR cvterm.name = 'inversion_derived_bipartite_duplication' OR cvterm.name = 'inversion_derived_duplication_plus_aneuploid' OR cvterm.name = 'intrachromosomal_transposition' OR cvterm.name = 'bipartite_duplication' OR cvterm.name = 'deficient_intrachromosomal_transposition' OR cvterm.name = 'inverted_intrachromosomal_transposition' OR cvterm.name = 'uninverted_intrachromosomal_transposition' OR cvterm.name = 'unoriented_intrachromosomal_transposition' OR cvterm.name = 'inverted_ring_chromosome' OR cvterm.name = 'free_ring_duplication' OR cvterm.name = 'chromosomal_translocation' OR cvterm.name = 'bipartite_duplication' OR cvterm.name = 'interchromosomal_transposition' OR cvterm.name = 'translocation_element' OR cvterm.name = 'Robertsonian_fusion' OR cvterm.name = 'reciprocal_chromosomal_translocation' OR cvterm.name = 'deficient_translocation' OR cvterm.name = 'inversion_cum_translocation' OR cvterm.name = 'cyclic_translocation' OR cvterm.name = 'inverted_intrachromosomal_transposition' OR cvterm.name = 'deficient_interchromosomal_transposition' OR cvterm.name = 'inverted_interchromosomal_transposition' OR cvterm.name = 'uninverted_interchromosomal_transposition' OR cvterm.name = 'unoriented_interchromosomal_transposition' OR cvterm.name = 'interchromosomal_duplication' OR cvterm.name = 'intrachromosomal_duplication' OR cvterm.name = 'free_duplication' OR cvterm.name = 'insertional_duplication' OR cvterm.name = 'inversion_derived_deficiency_plus_duplication' OR cvterm.name = 'inversion_derived_bipartite_duplication' OR cvterm.name = 'inversion_derived_duplication_plus_aneuploid' OR cvterm.name = 'intrachromosomal_transposition' OR cvterm.name = 'bipartite_duplication' OR cvterm.name = 'deficient_intrachromosomal_transposition' OR cvterm.name = 'inverted_intrachromosomal_transposition' OR cvterm.name = 'uninverted_intrachromosomal_transposition' OR cvterm.name = 'unoriented_intrachromosomal_transposition' OR cvterm.name = 'free_ring_duplication' OR cvterm.name = 'uninverted_insertional_duplication' OR cvterm.name = 'inverted_insertional_duplication' OR cvterm.name = 'unoriented_insertional_duplication' OR cvterm.name = 'compound_chromosome_arm' OR cvterm.name = 'homo_compound_chromosome' OR cvterm.name = 'hetero_compound_chromosome' OR cvterm.name = 'dexstrosynaptic_chromosome' OR cvterm.name = 'laevosynaptic_chromosome' OR cvterm.name = 'partially_characterised_chromosomal_mutation' OR cvterm.name = 'polymorphic_sequence_variant' OR cvterm.name = 'variant_collection';

--- ************************************************
--- *** relation: alteration_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW alteration_attribute AS
  SELECT
    feature_id AS alteration_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'chromosomal_variation_attribute' OR cvterm.name = 'insertion_attribute' OR cvterm.name = 'inversion_attribute' OR cvterm.name = 'translocaton_attribute' OR cvterm.name = 'duplication_attribute' OR cvterm.name = 'intrachromosomal' OR cvterm.name = 'interchromosomal' OR cvterm.name = 'tandem' OR cvterm.name = 'direct' OR cvterm.name = 'inverted' OR cvterm.name = 'pericentric' OR cvterm.name = 'paracentric' OR cvterm.name = 'reciprocal' OR cvterm.name = 'insertional' OR cvterm.name = 'free' OR cvterm.name = 'alteration_attribute';

--- ************************************************
--- *** relation: chromosomal_variation_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW chromosomal_variation_attribute AS
  SELECT
    feature_id AS chromosomal_variation_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intrachromosomal' OR cvterm.name = 'interchromosomal' OR cvterm.name = 'chromosomal_variation_attribute';

--- ************************************************
--- *** relation: intrachromosomal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW intrachromosomal AS
  SELECT
    feature_id AS intrachromosomal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intrachromosomal';

--- ************************************************
--- *** relation: interchromosomal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW interchromosomal AS
  SELECT
    feature_id AS interchromosomal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'interchromosomal';

--- ************************************************
--- *** relation: insertion_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A quality of a chromosomal insertion,.   ***
--- ************************************************
---

CREATE VIEW insertion_attribute AS
  SELECT
    feature_id AS insertion_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tandem' OR cvterm.name = 'direct' OR cvterm.name = 'inverted' OR cvterm.name = 'insertion_attribute';

--- ************************************************
--- *** relation: tandem ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW tandem AS
  SELECT
    feature_id AS tandem_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tandem';

--- ************************************************
--- *** relation: direct ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A quality of an insertion where the inse ***
--- *** rt is not in a cytologically inverted or ***
--- *** ientation.                               ***
--- ************************************************
---

CREATE VIEW direct AS
  SELECT
    feature_id AS direct_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'direct';

--- ************************************************
--- *** relation: inverted ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A quality of an insertion where the inse ***
--- *** rt is in a cytologically inverted orient ***
--- *** ation.                                   ***
--- ************************************************
---

CREATE VIEW inverted AS
  SELECT
    feature_id AS inverted_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inverted';

--- ************************************************
--- *** relation: free ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The quality of a duplication where the n ***
--- *** ew region exists independently of the or ***
--- *** iginal.                                  ***
--- ************************************************
---

CREATE VIEW free AS
  SELECT
    feature_id AS free_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'free';

--- ************************************************
--- *** relation: inversion_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW inversion_attribute AS
  SELECT
    feature_id AS inversion_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pericentric' OR cvterm.name = 'paracentric' OR cvterm.name = 'inversion_attribute';

--- ************************************************
--- *** relation: pericentric ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW pericentric AS
  SELECT
    feature_id AS pericentric_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pericentric';

--- ************************************************
--- *** relation: paracentric ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW paracentric AS
  SELECT
    feature_id AS paracentric_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'paracentric';

--- ************************************************
--- *** relation: translocaton_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW translocaton_attribute AS
  SELECT
    feature_id AS translocaton_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'reciprocal' OR cvterm.name = 'insertional' OR cvterm.name = 'translocaton_attribute';

--- ************************************************
--- *** relation: reciprocal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW reciprocal AS
  SELECT
    feature_id AS reciprocal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'reciprocal';

--- ************************************************
--- *** relation: insertional ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW insertional AS
  SELECT
    feature_id AS insertional_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'insertional';

--- ************************************************
--- *** relation: duplication_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW duplication_attribute AS
  SELECT
    feature_id AS duplication_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'free' OR cvterm.name = 'duplication_attribute';

--- ************************************************
--- *** relation: chromosomally_aberrant_genome ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW chromosomally_aberrant_genome AS
  SELECT
    feature_id AS chromosomally_aberrant_genome_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'chromosomally_aberrant_genome';

--- ************************************************
--- *** relation: assembly_error_correction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of sequence where the final nuc ***
--- *** leotide assignment differs from the orig ***
--- *** inal assembly due to an improvement that ***
--- ***  replaces a mistake.                     ***
--- ************************************************
---

CREATE VIEW assembly_error_correction AS
  SELECT
    feature_id AS assembly_error_correction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'assembly_error_correction';

--- ************************************************
--- *** relation: base_call_error_correction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of sequence where the final nuc ***
--- *** leotide assignment is different from tha ***
--- *** t given by the base caller due to an imp ***
--- *** rovement that replaces a mistake.        ***
--- ************************************************
---

CREATE VIEW base_call_error_correction AS
  SELECT
    feature_id AS base_call_error_correction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'base_call_error_correction';

--- ************************************************
--- *** relation: peptide_localization_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of peptide sequence used to tar ***
--- *** get the polypeptide molecule to a specif ***
--- *** ic organelle.                            ***
--- ************************************************
---

CREATE VIEW peptide_localization_signal AS
  SELECT
    feature_id AS peptide_localization_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'signal_peptide' OR cvterm.name = 'transit_peptide' OR cvterm.name = 'nuclear_localization_signal' OR cvterm.name = 'endosomal_localization_signal' OR cvterm.name = 'lysosomal_localization_signal' OR cvterm.name = 'nuclear_export_signal' OR cvterm.name = 'nuclear_rim_localization_signal' OR cvterm.name = 'ER_retention_signal' OR cvterm.name = 'mitochondrial_targeting_signal' OR cvterm.name = 'vacuolar_sorting_signal' OR cvterm.name = 'signal_anchor' OR cvterm.name = 'peptide_localization_signal';

--- ************************************************
--- *** relation: nuclear_localization_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the nucleus.                  ***
--- ************************************************
---

CREATE VIEW nuclear_localization_signal AS
  SELECT
    feature_id AS nuclear_localization_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nuclear_localization_signal';

--- ************************************************
--- *** relation: endosomal_localization_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the endosome.                 ***
--- ************************************************
---

CREATE VIEW endosomal_localization_signal AS
  SELECT
    feature_id AS endosomal_localization_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'endosomal_localization_signal';

--- ************************************************
--- *** relation: lysosomal_localization_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the lysosome.                 ***
--- ************************************************
---

CREATE VIEW lysosomal_localization_signal AS
  SELECT
    feature_id AS lysosomal_localization_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'lysosomal_localization_signal';

--- ************************************************
--- *** relation: nuclear_export_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to he cytoplasm.                 ***
--- ************************************************
---

CREATE VIEW nuclear_export_signal AS
  SELECT
    feature_id AS nuclear_export_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nuclear_export_signal';

--- ************************************************
--- *** relation: recombination_signal_sequence ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region recognized by a recombinase.    ***
--- ************************************************
---

CREATE VIEW recombination_signal_sequence AS
  SELECT
    feature_id AS recombination_signal_sequence_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'recombination_signal_sequence';

--- ************************************************
--- *** relation: cryptic_splice_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A splice site that is in part of the tra ***
--- *** nscript not normally spliced. They occur ***
--- ***  via mutation or transcriptional error.  ***
--- ************************************************
---

CREATE VIEW cryptic_splice_site AS
  SELECT
    feature_id AS cryptic_splice_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptic_splice_site';

--- ************************************************
--- *** relation: nuclear_rim_localization_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the nuclear rim.              ***
--- ************************************************
---

CREATE VIEW nuclear_rim_localization_signal AS
  SELECT
    feature_id AS nuclear_rim_localization_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nuclear_rim_localization_signal';

--- ************************************************
--- *** relation: p_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A P_element is a DNA transposon responsi ***
--- *** ble for hybrid dysgenesis.               ***
--- ************************************************
---

CREATE VIEW p_element AS
  SELECT
    feature_id AS p_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'p_element';

--- ************************************************
--- *** relation: functional_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant in which the function ***
--- ***  of a gene product is altered with respe ***
--- *** ct to a reference.                       ***
--- ************************************************
---

CREATE VIEW functional_variant AS
  SELECT
    feature_id AS functional_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'transcript_function_variant' OR cvterm.name = 'translational_product_function_variant' OR cvterm.name = 'loss_of_heterozygosity' OR cvterm.name = 'level_of_transcript_variant' OR cvterm.name = 'transcript_processing_variant' OR cvterm.name = 'transcript_stability_variant' OR cvterm.name = 'transcription_variant' OR cvterm.name = 'decreased_transcript_level_variant' OR cvterm.name = 'increased_transcript_level_variant' OR cvterm.name = 'editing_variant' OR cvterm.name = 'polyadenylation_variant' OR cvterm.name = 'increased_polyadenylation_variant' OR cvterm.name = 'decreased_polyadenylation_variant' OR cvterm.name = 'decreased_transcript_stability_variant' OR cvterm.name = 'increased_transcript_stability_variant' OR cvterm.name = 'rate_of_transcription_variant' OR cvterm.name = 'increased_transcription_rate_variant' OR cvterm.name = 'decreased_transcription_rate_variant' OR cvterm.name = 'translational_product_level_variant' OR cvterm.name = 'polypeptide_function_variant' OR cvterm.name = 'decreased_translational_product_level' OR cvterm.name = 'increased_translational_product_level' OR cvterm.name = 'polypeptide_gain_of_function_variant' OR cvterm.name = 'polypeptide_localization_variant' OR cvterm.name = 'polypeptide_loss_of_function_variant' OR cvterm.name = 'polypeptide_post_translational_processing_variant' OR cvterm.name = 'inactive_ligand_binding_site' OR cvterm.name = 'polypeptide_partial_loss_of_function' OR cvterm.name = 'inactive_catalytic_site' OR cvterm.name = 'functional_variant';

--- ************************************************
--- *** relation: structural_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes one or m ***
--- *** ore sequence features.                   ***
--- ************************************************
---

CREATE VIEW structural_variant AS
  SELECT
    feature_id AS structural_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'copy_number_change' OR cvterm.name = 'feature_variant' OR cvterm.name = 'feature_ablation' OR cvterm.name = 'feature_amplification' OR cvterm.name = 'feature_translocation' OR cvterm.name = 'feature_fusion' OR cvterm.name = 'copy_number_increase' OR cvterm.name = 'copy_number_decrease' OR cvterm.name = 'silent_mutation' OR cvterm.name = 'gene_variant' OR cvterm.name = 'regulatory_region_variant' OR cvterm.name = 'intergenic_variant' OR cvterm.name = 'upstream_gene_variant' OR cvterm.name = 'downstream_gene_variant' OR cvterm.name = 'feature_truncation' OR cvterm.name = 'feature_elongation' OR cvterm.name = 'gene_fusion' OR cvterm.name = 'splicing_variant' OR cvterm.name = 'transcript_variant' OR cvterm.name = 'translational_product_structure_variant' OR cvterm.name = 'cryptic_splice_site_variant' OR cvterm.name = 'exon_loss' OR cvterm.name = 'intron_gain' OR cvterm.name = 'splice_region_variant' OR cvterm.name = 'cryptic_splice_acceptor' OR cvterm.name = 'cryptic_splice_donor' OR cvterm.name = 'complex_transcript_variant' OR cvterm.name = 'transcript_secondary_structure_variant' OR cvterm.name = 'nc_transcript_variant' OR cvterm.name = 'NMD_transcript_variant' OR cvterm.name = 'UTR_variant' OR cvterm.name = 'intron_variant' OR cvterm.name = 'exon_variant' OR cvterm.name = 'compensatory_transcript_secondary_structure_variant' OR cvterm.name = 'mature_miRNA_variant' OR cvterm.name = '5_prime_UTR_variant' OR cvterm.name = '3_prime_UTR_variant' OR cvterm.name = 'splice_site_variant' OR cvterm.name = 'splice_acceptor_variant' OR cvterm.name = 'splice_donor_variant' OR cvterm.name = 'splice_donor_5th_base_variant' OR cvterm.name = 'coding_sequence_variant' OR cvterm.name = 'non_coding_exon_variant' OR cvterm.name = 'terminator_codon_variant' OR cvterm.name = 'protein_altering_variant' OR cvterm.name = 'synonymous_variant' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = '3D_polypeptide_structure_variant' OR cvterm.name = 'complex_change_of_translational_product_variant' OR cvterm.name = 'polypeptide_sequence_variant' OR cvterm.name = 'complex_3D_structural_variant' OR cvterm.name = 'conformational_change_variant' OR cvterm.name = 'amino_acid_deletion' OR cvterm.name = 'amino_acid_insertion' OR cvterm.name = 'amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide' OR cvterm.name = 'polypeptide_fusion' OR cvterm.name = 'polypeptide_truncation' OR cvterm.name = 'conservative_amino_acid_substitution' OR cvterm.name = 'non_conservative_amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'TF_binding_site_variant' OR cvterm.name = '5KB_upstream_variant' OR cvterm.name = '2KB_upstream_variant' OR cvterm.name = '5KB_downstream_variant' OR cvterm.name = '500B_downstream_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_lost' OR cvterm.name = 'internal_feature_elongation' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'transcript_ablation' OR cvterm.name = 'regulatory_region_ablation' OR cvterm.name = 'TFBS_ablation' OR cvterm.name = 'transcript_amplification' OR cvterm.name = 'regulatory_region_amplification' OR cvterm.name = 'TFBS_amplification' OR cvterm.name = 'transcript_translocation' OR cvterm.name = 'regulatory_region_translocation' OR cvterm.name = 'TFBS_translocation' OR cvterm.name = 'transcript_fusion' OR cvterm.name = 'regulatory_region_fusion' OR cvterm.name = 'transcript_regulatory_region_fusion' OR cvterm.name = 'TFBS_fusion' OR cvterm.name = 'structural_variant';

--- ************************************************
--- *** relation: transcript_function_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which alters the func ***
--- *** tioning of a transcript with respect to  ***
--- *** a reference sequence.                    ***
--- ************************************************
---

CREATE VIEW transcript_function_variant AS
  SELECT
    feature_id AS transcript_function_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'level_of_transcript_variant' OR cvterm.name = 'transcript_processing_variant' OR cvterm.name = 'transcript_stability_variant' OR cvterm.name = 'transcription_variant' OR cvterm.name = 'decreased_transcript_level_variant' OR cvterm.name = 'increased_transcript_level_variant' OR cvterm.name = 'editing_variant' OR cvterm.name = 'polyadenylation_variant' OR cvterm.name = 'increased_polyadenylation_variant' OR cvterm.name = 'decreased_polyadenylation_variant' OR cvterm.name = 'decreased_transcript_stability_variant' OR cvterm.name = 'increased_transcript_stability_variant' OR cvterm.name = 'rate_of_transcription_variant' OR cvterm.name = 'increased_transcription_rate_variant' OR cvterm.name = 'decreased_transcription_rate_variant' OR cvterm.name = 'transcript_function_variant';

--- ************************************************
--- *** relation: translational_product_function_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that affects the func ***
--- *** tioning of a translational product with  ***
--- *** respect to a reference sequence.         ***
--- ************************************************
---

CREATE VIEW translational_product_function_variant AS
  SELECT
    feature_id AS translational_product_function_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'translational_product_level_variant' OR cvterm.name = 'polypeptide_function_variant' OR cvterm.name = 'decreased_translational_product_level' OR cvterm.name = 'increased_translational_product_level' OR cvterm.name = 'polypeptide_gain_of_function_variant' OR cvterm.name = 'polypeptide_localization_variant' OR cvterm.name = 'polypeptide_loss_of_function_variant' OR cvterm.name = 'polypeptide_post_translational_processing_variant' OR cvterm.name = 'inactive_ligand_binding_site' OR cvterm.name = 'polypeptide_partial_loss_of_function' OR cvterm.name = 'inactive_catalytic_site' OR cvterm.name = 'translational_product_function_variant';

--- ************************************************
--- *** relation: level_of_transcript_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which alters the leve ***
--- *** l of a transcript.                       ***
--- ************************************************
---

CREATE VIEW level_of_transcript_variant AS
  SELECT
    feature_id AS level_of_transcript_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_transcript_level_variant' OR cvterm.name = 'increased_transcript_level_variant' OR cvterm.name = 'level_of_transcript_variant';

--- ************************************************
--- *** relation: decreased_transcript_level_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that increases the le ***
--- *** vel of mature, spliced and processed RNA ***
--- ***  with respect to a reference sequence.   ***
--- ************************************************
---

CREATE VIEW decreased_transcript_level_variant AS
  SELECT
    feature_id AS decreased_transcript_level_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_transcript_level_variant';

--- ************************************************
--- *** relation: increased_transcript_level_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that increases the le ***
--- *** vel of mature, spliced and processed RNA ***
--- ***  with respect to a reference sequence.   ***
--- ************************************************
---

CREATE VIEW increased_transcript_level_variant AS
  SELECT
    feature_id AS increased_transcript_level_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_transcript_level_variant';

--- ************************************************
--- *** relation: transcript_processing_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that affects the post ***
--- ***  transcriptional processing of a transcr ***
--- *** ipt with respect to a reference sequence ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW transcript_processing_variant AS
  SELECT
    feature_id AS transcript_processing_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'editing_variant' OR cvterm.name = 'polyadenylation_variant' OR cvterm.name = 'increased_polyadenylation_variant' OR cvterm.name = 'decreased_polyadenylation_variant' OR cvterm.name = 'transcript_processing_variant';

--- ************************************************
--- *** relation: editing_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript processing variant whereby  ***
--- *** the process of editing is disrupted with ***
--- ***  respect to the reference.               ***
--- ************************************************
---

CREATE VIEW editing_variant AS
  SELECT
    feature_id AS editing_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'editing_variant';

--- ************************************************
--- *** relation: polyadenylation_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes polyaden ***
--- *** ylation with respect to a reference sequ ***
--- *** ence.                                    ***
--- ************************************************
---

CREATE VIEW polyadenylation_variant AS
  SELECT
    feature_id AS polyadenylation_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_polyadenylation_variant' OR cvterm.name = 'decreased_polyadenylation_variant' OR cvterm.name = 'polyadenylation_variant';

--- ************************************************
--- *** relation: transcript_stability_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A variant that changes the stability of  ***
--- *** a transcript with respect to a reference ***
--- ***  sequence.                               ***
--- ************************************************
---

CREATE VIEW transcript_stability_variant AS
  SELECT
    feature_id AS transcript_stability_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_transcript_stability_variant' OR cvterm.name = 'increased_transcript_stability_variant' OR cvterm.name = 'transcript_stability_variant';

--- ************************************************
--- *** relation: decreased_transcript_stability_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that decreases transc ***
--- *** ript stability with respect to a referen ***
--- *** ce sequence.                             ***
--- ************************************************
---

CREATE VIEW decreased_transcript_stability_variant AS
  SELECT
    feature_id AS decreased_transcript_stability_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_transcript_stability_variant';

--- ************************************************
--- *** relation: increased_transcript_stability_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that increases transc ***
--- *** ript stability with respect to a referen ***
--- *** ce sequence.                             ***
--- ************************************************
---

CREATE VIEW increased_transcript_stability_variant AS
  SELECT
    feature_id AS increased_transcript_stability_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_transcript_stability_variant';

--- ************************************************
--- *** relation: transcription_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A variant that changes alters the transc ***
--- *** ription of a transcript with respect to  ***
--- *** a reference sequence.                    ***
--- ************************************************
---

CREATE VIEW transcription_variant AS
  SELECT
    feature_id AS transcription_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'rate_of_transcription_variant' OR cvterm.name = 'increased_transcription_rate_variant' OR cvterm.name = 'decreased_transcription_rate_variant' OR cvterm.name = 'transcription_variant';

--- ************************************************
--- *** relation: rate_of_transcription_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the rate ***
--- ***  of transcription with respect to a refe ***
--- *** rence sequence.                          ***
--- ************************************************
---

CREATE VIEW rate_of_transcription_variant AS
  SELECT
    feature_id AS rate_of_transcription_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_transcription_rate_variant' OR cvterm.name = 'decreased_transcription_rate_variant' OR cvterm.name = 'rate_of_transcription_variant';

--- ************************************************
--- *** relation: increased_transcription_rate_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that increases the ra ***
--- *** te of transcription with respect to a re ***
--- *** ference sequence.                        ***
--- ************************************************
---

CREATE VIEW increased_transcription_rate_variant AS
  SELECT
    feature_id AS increased_transcription_rate_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_transcription_rate_variant';

--- ************************************************
--- *** relation: decreased_transcription_rate_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that decreases the ra ***
--- *** te of transcription with respect to a re ***
--- *** ference sequence.                        ***
--- ************************************************
---

CREATE VIEW decreased_transcription_rate_variant AS
  SELECT
    feature_id AS decreased_transcription_rate_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_transcription_rate_variant';

--- ************************************************
--- *** relation: translational_product_level_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A functional variant that changes the tr ***
--- *** anslational product level with respect t ***
--- *** o a reference sequence.                  ***
--- ************************************************
---

CREATE VIEW translational_product_level_variant AS
  SELECT
    feature_id AS translational_product_level_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_translational_product_level' OR cvterm.name = 'increased_translational_product_level' OR cvterm.name = 'translational_product_level_variant';

--- ************************************************
--- *** relation: polypeptide_function_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which changes polypep ***
--- *** tide functioning with respect to a refer ***
--- *** ence sequence.                           ***
--- ************************************************
---

CREATE VIEW polypeptide_function_variant AS
  SELECT
    feature_id AS polypeptide_function_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_gain_of_function_variant' OR cvterm.name = 'polypeptide_localization_variant' OR cvterm.name = 'polypeptide_loss_of_function_variant' OR cvterm.name = 'polypeptide_post_translational_processing_variant' OR cvterm.name = 'inactive_ligand_binding_site' OR cvterm.name = 'polypeptide_partial_loss_of_function' OR cvterm.name = 'inactive_catalytic_site' OR cvterm.name = 'polypeptide_function_variant';

--- ************************************************
--- *** relation: decreased_translational_product_level ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which decreases the t ***
--- *** ranslational product level with respect  ***
--- *** to a reference sequence.                 ***
--- ************************************************
---

CREATE VIEW decreased_translational_product_level AS
  SELECT
    feature_id AS decreased_translational_product_level_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_translational_product_level';

--- ************************************************
--- *** relation: increased_translational_product_level ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which increases the t ***
--- *** ranslational product level with respect  ***
--- *** to a reference sequence.                 ***
--- ************************************************
---

CREATE VIEW increased_translational_product_level AS
  SELECT
    feature_id AS increased_translational_product_level_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_translational_product_level';

--- ************************************************
--- *** relation: polypeptide_gain_of_function_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which causes gain of  ***
--- *** polypeptide function with respect to a r ***
--- *** eference sequence.                       ***
--- ************************************************
---

CREATE VIEW polypeptide_gain_of_function_variant AS
  SELECT
    feature_id AS polypeptide_gain_of_function_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_gain_of_function_variant';

--- ************************************************
--- *** relation: polypeptide_localization_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which changes the loc ***
--- *** alization of a polypeptide with respect  ***
--- *** to a reference sequence.                 ***
--- ************************************************
---

CREATE VIEW polypeptide_localization_variant AS
  SELECT
    feature_id AS polypeptide_localization_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_localization_variant';

--- ************************************************
--- *** relation: polypeptide_loss_of_function_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes the loss  ***
--- *** of a polypeptide function with respect t ***
--- *** o a reference sequence.                  ***
--- ************************************************
---

CREATE VIEW polypeptide_loss_of_function_variant AS
  SELECT
    feature_id AS polypeptide_loss_of_function_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inactive_ligand_binding_site' OR cvterm.name = 'polypeptide_partial_loss_of_function' OR cvterm.name = 'inactive_catalytic_site' OR cvterm.name = 'polypeptide_loss_of_function_variant';

--- ************************************************
--- *** relation: inactive_ligand_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes the inact ***
--- *** ivation of a ligand binding site with re ***
--- *** spect to a reference sequence.           ***
--- ************************************************
---

CREATE VIEW inactive_ligand_binding_site AS
  SELECT
    feature_id AS inactive_ligand_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inactive_catalytic_site' OR cvterm.name = 'inactive_ligand_binding_site';

--- ************************************************
--- *** relation: polypeptide_partial_loss_of_function ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes some but  ***
--- *** not all loss of polypeptide function wit ***
--- *** h respect to a reference sequence.       ***
--- ************************************************
---

CREATE VIEW polypeptide_partial_loss_of_function AS
  SELECT
    feature_id AS polypeptide_partial_loss_of_function_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_partial_loss_of_function';

--- ************************************************
--- *** relation: polypeptide_post_translational_processing_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes a change  ***
--- *** in post translational processing of the  ***
--- *** peptide with respect to a reference sequ ***
--- *** ence.                                    ***
--- ************************************************
---

CREATE VIEW polypeptide_post_translational_processing_variant AS
  SELECT
    feature_id AS polypeptide_post_translational_processing_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_post_translational_processing_variant';

--- ************************************************
--- *** relation: copy_number_change ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where copies of a fea ***
--- *** ture (CNV) are either increased or decre ***
--- *** ased.                                    ***
--- ************************************************
---

CREATE VIEW copy_number_change AS
  SELECT
    feature_id AS copy_number_change_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'copy_number_increase' OR cvterm.name = 'copy_number_decrease' OR cvterm.name = 'copy_number_change';

--- ************************************************
--- *** relation: gene_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where the structure o ***
--- *** f the gene is changed.                   ***
--- ************************************************
---

CREATE VIEW gene_variant AS
  SELECT
    feature_id AS gene_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'gene_fusion' OR cvterm.name = 'splicing_variant' OR cvterm.name = 'transcript_variant' OR cvterm.name = 'translational_product_structure_variant' OR cvterm.name = 'cryptic_splice_site_variant' OR cvterm.name = 'exon_loss' OR cvterm.name = 'intron_gain' OR cvterm.name = 'splice_region_variant' OR cvterm.name = 'cryptic_splice_acceptor' OR cvterm.name = 'cryptic_splice_donor' OR cvterm.name = 'complex_transcript_variant' OR cvterm.name = 'transcript_secondary_structure_variant' OR cvterm.name = 'nc_transcript_variant' OR cvterm.name = 'NMD_transcript_variant' OR cvterm.name = 'UTR_variant' OR cvterm.name = 'intron_variant' OR cvterm.name = 'exon_variant' OR cvterm.name = 'compensatory_transcript_secondary_structure_variant' OR cvterm.name = 'mature_miRNA_variant' OR cvterm.name = '5_prime_UTR_variant' OR cvterm.name = '3_prime_UTR_variant' OR cvterm.name = 'splice_site_variant' OR cvterm.name = 'splice_acceptor_variant' OR cvterm.name = 'splice_donor_variant' OR cvterm.name = 'splice_donor_5th_base_variant' OR cvterm.name = 'coding_sequence_variant' OR cvterm.name = 'non_coding_exon_variant' OR cvterm.name = 'terminator_codon_variant' OR cvterm.name = 'protein_altering_variant' OR cvterm.name = 'synonymous_variant' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = '3D_polypeptide_structure_variant' OR cvterm.name = 'complex_change_of_translational_product_variant' OR cvterm.name = 'polypeptide_sequence_variant' OR cvterm.name = 'complex_3D_structural_variant' OR cvterm.name = 'conformational_change_variant' OR cvterm.name = 'amino_acid_deletion' OR cvterm.name = 'amino_acid_insertion' OR cvterm.name = 'amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide' OR cvterm.name = 'polypeptide_fusion' OR cvterm.name = 'polypeptide_truncation' OR cvterm.name = 'conservative_amino_acid_substitution' OR cvterm.name = 'non_conservative_amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'gene_variant';

--- ************************************************
--- *** relation: gene_fusion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby a two genes h ***
--- *** ave become joined.                       ***
--- ************************************************
---

CREATE VIEW gene_fusion AS
  SELECT
    feature_id AS gene_fusion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'gene_fusion';

--- ************************************************
--- *** relation: regulatory_region_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within a regu ***
--- *** latory region.                           ***
--- ************************************************
---

CREATE VIEW regulatory_region_variant AS
  SELECT
    feature_id AS regulatory_region_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'TF_binding_site_variant' OR cvterm.name = 'regulatory_region_variant';

--- ************************************************
--- *** relation: stop_retained_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where at least one ba ***
--- *** se in the terminator codon is changed, b ***
--- *** ut the terminator remains.               ***
--- ************************************************
---

CREATE VIEW stop_retained_variant AS
  SELECT
    feature_id AS stop_retained_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_retained_variant';

--- ************************************************
--- *** relation: splicing_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the proc ***
--- *** ess of splicing.                         ***
--- ************************************************
---

CREATE VIEW splicing_variant AS
  SELECT
    feature_id AS splicing_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptic_splice_site_variant' OR cvterm.name = 'exon_loss' OR cvterm.name = 'intron_gain' OR cvterm.name = 'splice_region_variant' OR cvterm.name = 'cryptic_splice_acceptor' OR cvterm.name = 'cryptic_splice_donor' OR cvterm.name = 'splicing_variant';

--- ************************************************
--- *** relation: cryptic_splice_site_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant causing a new (functi ***
--- *** onal) splice site.                       ***
--- ************************************************
---

CREATE VIEW cryptic_splice_site_variant AS
  SELECT
    feature_id AS cryptic_splice_site_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptic_splice_acceptor' OR cvterm.name = 'cryptic_splice_donor' OR cvterm.name = 'cryptic_splice_site_variant';

--- ************************************************
--- *** relation: cryptic_splice_acceptor ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby a new splice  ***
--- *** site is created due to the activation of ***
--- ***  a new acceptor.                         ***
--- ************************************************
---

CREATE VIEW cryptic_splice_acceptor AS
  SELECT
    feature_id AS cryptic_splice_acceptor_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptic_splice_acceptor';

--- ************************************************
--- *** relation: cryptic_splice_donor ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby a new splice  ***
--- *** site is created due to the activation of ***
--- ***  a new donor.                            ***
--- ************************************************
---

CREATE VIEW cryptic_splice_donor AS
  SELECT
    feature_id AS cryptic_splice_donor_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'cryptic_splice_donor';

--- ************************************************
--- *** relation: exon_loss ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby an exon is lo ***
--- *** st from the transcript.                  ***
--- ************************************************
---

CREATE VIEW exon_loss AS
  SELECT
    feature_id AS exon_loss_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'exon_loss';

--- ************************************************
--- *** relation: intron_gain ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby an intron is  ***
--- *** gained by the processed transcript; usua ***
--- *** lly a result of an alteration of the don ***
--- *** or or acceptor.                          ***
--- ************************************************
---

CREATE VIEW intron_gain AS
  SELECT
    feature_id AS intron_gain_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intron_gain';

--- ************************************************
--- *** relation: splice_acceptor_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A splice variant that changes the 2 base ***
--- ***  region at the 3' end of an intron.      ***
--- ************************************************
---

CREATE VIEW splice_acceptor_variant AS
  SELECT
    feature_id AS splice_acceptor_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_acceptor_variant';

--- ************************************************
--- *** relation: splice_donor_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A splice variant that changes the2 base  ***
--- *** region at the 5' end of an intron.       ***
--- ************************************************
---

CREATE VIEW splice_donor_variant AS
  SELECT
    feature_id AS splice_donor_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_donor_variant';

--- ************************************************
--- *** relation: transcript_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the stru ***
--- *** cture of the transcript.                 ***
--- ************************************************
---

CREATE VIEW transcript_variant AS
  SELECT
    feature_id AS transcript_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_transcript_variant' OR cvterm.name = 'transcript_secondary_structure_variant' OR cvterm.name = 'nc_transcript_variant' OR cvterm.name = 'NMD_transcript_variant' OR cvterm.name = 'UTR_variant' OR cvterm.name = 'intron_variant' OR cvterm.name = 'exon_variant' OR cvterm.name = 'compensatory_transcript_secondary_structure_variant' OR cvterm.name = 'mature_miRNA_variant' OR cvterm.name = '5_prime_UTR_variant' OR cvterm.name = '3_prime_UTR_variant' OR cvterm.name = 'splice_site_variant' OR cvterm.name = 'splice_acceptor_variant' OR cvterm.name = 'splice_donor_variant' OR cvterm.name = 'splice_donor_5th_base_variant' OR cvterm.name = 'coding_sequence_variant' OR cvterm.name = 'non_coding_exon_variant' OR cvterm.name = 'terminator_codon_variant' OR cvterm.name = 'protein_altering_variant' OR cvterm.name = 'synonymous_variant' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'transcript_variant';

--- ************************************************
--- *** relation: complex_transcript_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript variant with a complex INDE ***
--- *** L- Insertion or deletion that spans an e ***
--- *** xon/intron border or a coding sequence/U ***
--- *** TR border.                               ***
--- ************************************************
---

CREATE VIEW complex_transcript_variant AS
  SELECT
    feature_id AS complex_transcript_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_transcript_variant';

--- ************************************************
--- *** relation: stop_lost ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where at least one ba ***
--- *** se of the terminator codon (stop) is cha ***
--- *** nged, resulting in an elongated transcri ***
--- *** pt.                                      ***
--- ************************************************
---

CREATE VIEW stop_lost AS
  SELECT
    feature_id AS stop_lost_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_lost';

--- ************************************************
--- *** relation: coding_sequence_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the codi ***
--- *** ng sequence.                             ***
--- ************************************************
---

CREATE VIEW coding_sequence_variant AS
  SELECT
    feature_id AS coding_sequence_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'terminator_codon_variant' OR cvterm.name = 'protein_altering_variant' OR cvterm.name = 'synonymous_variant' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'coding_sequence_variant';

--- ************************************************
--- *** relation: initiator_codon_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A codon variant that changes at least on ***
--- *** e base of the first codon of a transcrip ***
--- *** t.                                       ***
--- ************************************************
---

CREATE VIEW initiator_codon_variant AS
  SELECT
    feature_id AS initiator_codon_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'initiator_codon_variant';

--- ************************************************
--- *** relation: missense_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant, that changes one or  ***
--- *** more bases, resulting in a different ami ***
--- *** no acid sequence but where the length is ***
--- ***  preserved.                              ***
--- ************************************************
---

CREATE VIEW missense_variant AS
  SELECT
    feature_id AS missense_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'missense_variant';

--- ************************************************
--- *** relation: conservative_missense_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby at least one  ***
--- *** base of a codon is changed resulting in  ***
--- *** a codon that encodes for a different but ***
--- ***  similar amino acid. These variants may  ***
--- *** or may not be deleterious.               ***
--- ************************************************
---

CREATE VIEW conservative_missense_variant AS
  SELECT
    feature_id AS conservative_missense_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_missense_variant';

--- ************************************************
--- *** relation: non_conservative_missense_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby at least one  ***
--- *** base of a codon is changed resulting in  ***
--- *** a codon that encodes for an amino acid w ***
--- *** ith different biochemical properties.    ***
--- ************************************************
---

CREATE VIEW non_conservative_missense_variant AS
  SELECT
    feature_id AS non_conservative_missense_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'non_conservative_missense_variant';

--- ************************************************
--- *** relation: stop_gained ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby at least one  ***
--- *** base of a codon is changed, resulting in ***
--- ***  a premature stop codon, leading to a sh ***
--- *** ortened transcript.                      ***
--- ************************************************
---

CREATE VIEW stop_gained AS
  SELECT
    feature_id AS stop_gained_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_gained';

--- ************************************************
--- *** relation: frameshift_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which causes a disrup ***
--- *** tion of the translational reading frame, ***
--- ***  because the number of nucleotides inser ***
--- *** ted or deleted is not a multiple of thre ***
--- *** e.                                       ***
--- ************************************************
---

CREATE VIEW frameshift_variant AS
  SELECT
    feature_id AS frameshift_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'frameshift_variant';

--- ************************************************
--- *** relation: terminator_codon_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant whereby at least one  ***
--- *** of the bases in the terminator codon is  ***
--- *** changed.                                 ***
--- ************************************************
---

CREATE VIEW terminator_codon_variant AS
  SELECT
    feature_id AS terminator_codon_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'terminator_codon_variant';

--- ************************************************
--- *** relation: frame_restoring_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that reverts the sequ ***
--- *** ence of a previous frameshift mutation b ***
--- *** ack to the initial frame.                ***
--- ************************************************
---

CREATE VIEW frame_restoring_variant AS
  SELECT
    feature_id AS frame_restoring_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'frame_restoring_variant';

--- ************************************************
--- *** relation: minus_1_frameshift_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which causes a disrup ***
--- *** tion of the translational reading frame, ***
--- ***  by shifting one base ahead.             ***
--- ************************************************
---

CREATE VIEW minus_1_frameshift_variant AS
  SELECT
    feature_id AS minus_1_frameshift_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'minus_1_frameshift_variant';

--- ************************************************
--- *** relation: minus_2_frameshift_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW minus_2_frameshift_variant AS
  SELECT
    feature_id AS minus_2_frameshift_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'minus_2_frameshift_variant';

--- ************************************************
--- *** relation: plus_1_frameshift_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which causes a disrup ***
--- *** tion of the translational reading frame, ***
--- ***  by shifting one base backward.          ***
--- ************************************************
---

CREATE VIEW plus_1_frameshift_variant AS
  SELECT
    feature_id AS plus_1_frameshift_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'plus_1_frameshift_variant';

--- ************************************************
--- *** relation: plus_2_frameshift_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW plus_2_frameshift_variant AS
  SELECT
    feature_id AS plus_2_frameshift_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'plus_2_frameshift_variant';

--- ************************************************
--- *** relation: transcript_secondary_structure_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant within a transcript t ***
--- *** hat changes the secondary structure of t ***
--- *** he RNA product.                          ***
--- ************************************************
---

CREATE VIEW transcript_secondary_structure_variant AS
  SELECT
    feature_id AS transcript_secondary_structure_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'compensatory_transcript_secondary_structure_variant' OR cvterm.name = 'transcript_secondary_structure_variant';

--- ************************************************
--- *** relation: compensatory_transcript_secondary_structure_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A secondary structure variant that compe ***
--- *** nsate for the change made by a previous  ***
--- *** variant.                                 ***
--- ************************************************
---

CREATE VIEW compensatory_transcript_secondary_structure_variant AS
  SELECT
    feature_id AS compensatory_transcript_secondary_structure_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'compensatory_transcript_secondary_structure_variant';

--- ************************************************
--- *** relation: translational_product_structure_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant within the transcript ***
--- ***  that changes the structure of the trans ***
--- *** lational product.                        ***
--- ************************************************
---

CREATE VIEW translational_product_structure_variant AS
  SELECT
    feature_id AS translational_product_structure_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '3D_polypeptide_structure_variant' OR cvterm.name = 'complex_change_of_translational_product_variant' OR cvterm.name = 'polypeptide_sequence_variant' OR cvterm.name = 'complex_3D_structural_variant' OR cvterm.name = 'conformational_change_variant' OR cvterm.name = 'amino_acid_deletion' OR cvterm.name = 'amino_acid_insertion' OR cvterm.name = 'amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide' OR cvterm.name = 'polypeptide_fusion' OR cvterm.name = 'polypeptide_truncation' OR cvterm.name = 'conservative_amino_acid_substitution' OR cvterm.name = 'non_conservative_amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'translational_product_structure_variant';

--- ************************************************
--- *** relation: threed_polypeptide_structure_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the resu ***
--- *** lting polypeptide structure.             ***
--- ************************************************
---

CREATE VIEW threed_polypeptide_structure_variant AS
  SELECT
    feature_id AS threed_polypeptide_structure_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_3D_structural_variant' OR cvterm.name = 'conformational_change_variant' OR cvterm.name = '3D_polypeptide_structure_variant';

--- ************************************************
--- *** relation: complex_3d_structural_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the resu ***
--- *** lting polypeptide structure.             ***
--- ************************************************
---

CREATE VIEW complex_3d_structural_variant AS
  SELECT
    feature_id AS complex_3d_structural_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_3D_structural_variant';

--- ************************************************
--- *** relation: conformational_change_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant in the CDS region tha ***
--- *** t causes a conformational change in the  ***
--- *** resulting polypeptide sequence.          ***
--- ************************************************
---

CREATE VIEW conformational_change_variant AS
  SELECT
    feature_id AS conformational_change_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conformational_change_variant';

--- ************************************************
--- *** relation: complex_change_of_translational_product_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW complex_change_of_translational_product_variant AS
  SELECT
    feature_id AS complex_change_of_translational_product_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_change_of_translational_product_variant';

--- ************************************************
--- *** relation: polypeptide_sequence_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes a change in the resulting polypep ***
--- *** tide sequence.                           ***
--- ************************************************
---

CREATE VIEW polypeptide_sequence_variant AS
  SELECT
    feature_id AS polypeptide_sequence_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'amino_acid_deletion' OR cvterm.name = 'amino_acid_insertion' OR cvterm.name = 'amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide' OR cvterm.name = 'polypeptide_fusion' OR cvterm.name = 'polypeptide_truncation' OR cvterm.name = 'conservative_amino_acid_substitution' OR cvterm.name = 'non_conservative_amino_acid_substitution' OR cvterm.name = 'elongated_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'polypeptide_sequence_variant';

--- ************************************************
--- *** relation: amino_acid_deletion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant within a CDS resultin ***
--- *** g in the loss of an amino acid from the  ***
--- *** resulting polypeptide.                   ***
--- ************************************************
---

CREATE VIEW amino_acid_deletion AS
  SELECT
    feature_id AS amino_acid_deletion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'amino_acid_deletion';

--- ************************************************
--- *** relation: amino_acid_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant within a CDS resultin ***
--- *** g in the gain of an amino acid to the re ***
--- *** sulting polypeptide.                     ***
--- ************************************************
---

CREATE VIEW amino_acid_insertion AS
  SELECT
    feature_id AS amino_acid_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'amino_acid_insertion';

--- ************************************************
--- *** relation: amino_acid_substitution ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant of a codon resulting  ***
--- *** in the substitution of one amino acid fo ***
--- *** r another in the resulting polypeptide.  ***
--- ************************************************
---

CREATE VIEW amino_acid_substitution AS
  SELECT
    feature_id AS amino_acid_substitution_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_amino_acid_substitution' OR cvterm.name = 'non_conservative_amino_acid_substitution' OR cvterm.name = 'amino_acid_substitution';

--- ************************************************
--- *** relation: conservative_amino_acid_substitution ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant of a codon causing th ***
--- *** e substitution of a similar amino acid f ***
--- *** or another in the resulting polypeptide. ***
--- ************************************************
---

CREATE VIEW conservative_amino_acid_substitution AS
  SELECT
    feature_id AS conservative_amino_acid_substitution_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_amino_acid_substitution';

--- ************************************************
--- *** relation: non_conservative_amino_acid_substitution ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant of a codon causing th ***
--- *** e substitution of a non conservative ami ***
--- *** no acid for another in the resulting pol ***
--- *** ypeptide.                                ***
--- ************************************************
---

CREATE VIEW non_conservative_amino_acid_substitution AS
  SELECT
    feature_id AS non_conservative_amino_acid_substitution_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'non_conservative_amino_acid_substitution';

--- ************************************************
--- *** relation: elongated_polypeptide ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes elongation of the resulting polyp ***
--- *** eptide sequence.                         ***
--- ************************************************
---

CREATE VIEW elongated_polypeptide AS
  SELECT
    feature_id AS elongated_polypeptide_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'elongated_polypeptide';

--- ************************************************
--- *** relation: elongated_polypeptide_c_terminal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes elongation of the resulting polyp ***
--- *** eptide sequence at the C terminus.       ***
--- ************************************************
---

CREATE VIEW elongated_polypeptide_c_terminal AS
  SELECT
    feature_id AS elongated_polypeptide_c_terminal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_in_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal' OR cvterm.name = 'elongated_polypeptide_C_terminal';

--- ************************************************
--- *** relation: elongated_polypeptide_n_terminal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes elongation of the resulting polyp ***
--- *** eptide sequence at the N terminus.       ***
--- ************************************************
---

CREATE VIEW elongated_polypeptide_n_terminal AS
  SELECT
    feature_id AS elongated_polypeptide_n_terminal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation' OR cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal' OR cvterm.name = 'elongated_polypeptide_N_terminal';

--- ************************************************
--- *** relation: elongated_in_frame_polypeptide_c_terminal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes in frame elongation of the result ***
--- *** ing polypeptide sequence at the C termin ***
--- *** us.                                      ***
--- ************************************************
---

CREATE VIEW elongated_in_frame_polypeptide_c_terminal AS
  SELECT
    feature_id AS elongated_in_frame_polypeptide_c_terminal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_in_frame_polypeptide_C_terminal';

--- ************************************************
--- *** relation: elongated_out_of_frame_polypeptide_c_terminal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes out of frame elongation of the re ***
--- *** sulting polypeptide sequence at the C te ***
--- *** rminus.                                  ***
--- ************************************************
---

CREATE VIEW elongated_out_of_frame_polypeptide_c_terminal AS
  SELECT
    feature_id AS elongated_out_of_frame_polypeptide_c_terminal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_out_of_frame_polypeptide_C_terminal';

--- ************************************************
--- *** relation: elongated_in_frame_polypeptide_n_terminal_elongation ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes in frame elongation of the result ***
--- *** ing polypeptide sequence at the N termin ***
--- *** us.                                      ***
--- ************************************************
---

CREATE VIEW elongated_in_frame_polypeptide_n_terminal_elongation AS
  SELECT
    feature_id AS elongated_in_frame_polypeptide_n_terminal_elongation_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_in_frame_polypeptide_N_terminal_elongation';

--- ************************************************
--- *** relation: elongated_out_of_frame_polypeptide_n_terminal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant with in the CDS that  ***
--- *** causes out of frame elongation of the re ***
--- *** sulting polypeptide sequence at the N te ***
--- *** rminus.                                  ***
--- ************************************************
---

CREATE VIEW elongated_out_of_frame_polypeptide_n_terminal AS
  SELECT
    feature_id AS elongated_out_of_frame_polypeptide_n_terminal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'elongated_out_of_frame_polypeptide_N_terminal';

--- ************************************************
--- *** relation: polypeptide_fusion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes a fusion  ***
--- *** of two polypeptide sequences.            ***
--- ************************************************
---

CREATE VIEW polypeptide_fusion AS
  SELECT
    feature_id AS polypeptide_fusion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_fusion';

--- ************************************************
--- *** relation: polypeptide_truncation ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant of the CD that causes ***
--- ***  a truncation of the resulting polypepti ***
--- *** de.                                      ***
--- ************************************************
---

CREATE VIEW polypeptide_truncation AS
  SELECT
    feature_id AS polypeptide_truncation_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_truncation';

--- ************************************************
--- *** relation: inactive_catalytic_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes the inact ***
--- *** ivation of a catalytic site with respect ***
--- ***  to a reference sequence.                ***
--- ************************************************
---

CREATE VIEW inactive_catalytic_site AS
  SELECT
    feature_id AS inactive_catalytic_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inactive_catalytic_site';

--- ************************************************
--- *** relation: nc_transcript_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript variant of a non coding RNA ***
--- ***  gene.                                   ***
--- ************************************************
---

CREATE VIEW nc_transcript_variant AS
  SELECT
    feature_id AS nc_transcript_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mature_miRNA_variant' OR cvterm.name = 'nc_transcript_variant';

--- ************************************************
--- *** relation: mature_mirna_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript variant located with the se ***
--- *** quence of the mature miRNA.              ***
--- ************************************************
---

CREATE VIEW mature_mirna_variant AS
  SELECT
    feature_id AS mature_mirna_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mature_miRNA_variant';

--- ************************************************
--- *** relation: nmd_transcript_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A variant in a transcript that is the ta ***
--- *** rget of NMD.                             ***
--- ************************************************
---

CREATE VIEW nmd_transcript_variant AS
  SELECT
    feature_id AS nmd_transcript_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'NMD_transcript_variant';

--- ************************************************
--- *** relation: utr_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript variant that is located wit ***
--- *** hin the UTR.                             ***
--- ************************************************
---

CREATE VIEW utr_variant AS
  SELECT
    feature_id AS utr_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '5_prime_UTR_variant' OR cvterm.name = '3_prime_UTR_variant' OR cvterm.name = 'UTR_variant';

--- ************************************************
--- *** relation: five_prime_utr_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A UTR variant of the 5' UTR.             ***
--- ************************************************
---

CREATE VIEW five_prime_utr_variant AS
  SELECT
    feature_id AS five_prime_utr_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '5_prime_UTR_variant';

--- ************************************************
--- *** relation: three_prime_utr_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A UTR variant of the 3' UTR.             ***
--- ************************************************
---

CREATE VIEW three_prime_utr_variant AS
  SELECT
    feature_id AS three_prime_utr_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '3_prime_UTR_variant';

--- ************************************************
--- *** relation: incomplete_terminal_codon_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where at least one ba ***
--- *** se of the final codon of an incompletely ***
--- ***  annotated transcript is changed.        ***
--- ************************************************
---

CREATE VIEW incomplete_terminal_codon_variant AS
  SELECT
    feature_id AS incomplete_terminal_codon_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'incomplete_terminal_codon_variant';

--- ************************************************
--- *** relation: intron_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript variant occurring within an ***
--- ***  intron.                                 ***
--- ************************************************
---

CREATE VIEW intron_variant AS
  SELECT
    feature_id AS intron_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_site_variant' OR cvterm.name = 'splice_acceptor_variant' OR cvterm.name = 'splice_donor_variant' OR cvterm.name = 'splice_donor_5th_base_variant' OR cvterm.name = 'intron_variant';

--- ************************************************
--- *** relation: intergenic_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located in the interg ***
--- *** enic region, between genes.              ***
--- ************************************************
---

CREATE VIEW intergenic_variant AS
  SELECT
    feature_id AS intergenic_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intergenic_variant';

--- ************************************************
--- *** relation: splice_site_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes the firs ***
--- *** t two or last two bases of an intron, or ***
--- ***  the 5th base from the start of the intr ***
--- *** on in the orientation of the transcript. ***
--- ************************************************
---

CREATE VIEW splice_site_variant AS
  SELECT
    feature_id AS splice_site_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_acceptor_variant' OR cvterm.name = 'splice_donor_variant' OR cvterm.name = 'splice_donor_5th_base_variant' OR cvterm.name = 'splice_site_variant';

--- ************************************************
--- *** relation: splice_region_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant in which a change has ***
--- ***  occurred within the region of the splic ***
--- *** e site, either within 1-3 bases of the e ***
--- *** xon or 3-8 bases of the intron.          ***
--- ************************************************
---

CREATE VIEW splice_region_variant AS
  SELECT
    feature_id AS splice_region_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_region_variant';

--- ************************************************
--- *** relation: upstream_gene_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located 5' of a gene. ***
--- ************************************************
---

CREATE VIEW upstream_gene_variant AS
  SELECT
    feature_id AS upstream_gene_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '5KB_upstream_variant' OR cvterm.name = '2KB_upstream_variant' OR cvterm.name = 'upstream_gene_variant';

--- ************************************************
--- *** relation: downstream_gene_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located 3' of a gene. ***
--- ************************************************
---

CREATE VIEW downstream_gene_variant AS
  SELECT
    feature_id AS downstream_gene_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '5KB_downstream_variant' OR cvterm.name = '500B_downstream_variant' OR cvterm.name = 'downstream_gene_variant';

--- ************************************************
--- *** relation: fivekb_downstream_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within 5 KB o ***
--- *** f the end of a gene.                     ***
--- ************************************************
---

CREATE VIEW fivekb_downstream_variant AS
  SELECT
    feature_id AS fivekb_downstream_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '500B_downstream_variant' OR cvterm.name = '5KB_downstream_variant';

--- ************************************************
--- *** relation: fivehundred_b_downstream_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within a half ***
--- ***  KB of the end of a gene.                ***
--- ************************************************
---

CREATE VIEW fivehundred_b_downstream_variant AS
  SELECT
    feature_id AS fivehundred_b_downstream_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '500B_downstream_variant';

--- ************************************************
--- *** relation: fivekb_upstream_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within 5KB 5' ***
--- ***  of a gene.                              ***
--- ************************************************
---

CREATE VIEW fivekb_upstream_variant AS
  SELECT
    feature_id AS fivekb_upstream_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '2KB_upstream_variant' OR cvterm.name = '5KB_upstream_variant';

--- ************************************************
--- *** relation: twokb_upstream_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within 2KB 5' ***
--- ***  of a gene.                              ***
--- ************************************************
---

CREATE VIEW twokb_upstream_variant AS
  SELECT
    feature_id AS twokb_upstream_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = '2KB_upstream_variant';

--- ************************************************
--- *** relation: rrna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that encodes for ribosomal RNA.   ***
--- ************************************************
---

CREATE VIEW rrna_gene AS
  SELECT
    feature_id AS rrna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'rRNA_gene';

--- ************************************************
--- *** relation: pirna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that encodes for an piwi associat ***
--- *** ed RNA.                                  ***
--- ************************************************
---

CREATE VIEW pirna_gene AS
  SELECT
    feature_id AS pirna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'piRNA_gene';

--- ************************************************
--- *** relation: rnase_p_rna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that encodes an RNase P RNA.      ***
--- ************************************************
---

CREATE VIEW rnase_p_rna_gene AS
  SELECT
    feature_id AS rnase_p_rna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RNase_P_RNA_gene';

--- ************************************************
--- *** relation: rnase_mrp_rna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that encodes a RNase_MRP_RNA.     ***
--- ************************************************
---

CREATE VIEW rnase_mrp_rna_gene AS
  SELECT
    feature_id AS rnase_mrp_rna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RNase_MRP_RNA_gene';

--- ************************************************
--- *** relation: lincrna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene that encodes large intervening no ***
--- *** n-coding RNA.                            ***
--- ************************************************
---

CREATE VIEW lincrna_gene AS
  SELECT
    feature_id AS lincrna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'lincRNA_gene';

--- ************************************************
--- *** relation: mathematically_defined_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A mathematically defined repeat (MDR) is ***
--- ***  a experimental feature that is determin ***
--- *** ed by querying overlapping oligomers of  ***
--- *** length k against a database of shotgun s ***
--- *** equence data and identifying regions in  ***
--- *** the query sequence that exceed a statist ***
--- *** ically determined threshold of repetitiv ***
--- *** eness.                                   ***
--- ************************************************
---

CREATE VIEW mathematically_defined_repeat AS
  SELECT
    feature_id AS mathematically_defined_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mathematically_defined_repeat';

--- ************************************************
--- *** relation: telomerase_rna_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A telomerase RNA gene is a non coding RN ***
--- *** A gene the RNA product of which is a com ***
--- *** ponent of telomerase.                    ***
--- ************************************************
---

CREATE VIEW telomerase_rna_gene AS
  SELECT
    feature_id AS telomerase_rna_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'telomerase_RNA_gene';

--- ************************************************
--- *** relation: targeting_vector ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An engineered vector that is able to tak ***
--- *** e part in homologous recombination in a  ***
--- *** host with the intent of introducing site ***
--- ***  specific genomic modifications.         ***
--- ************************************************
---

CREATE VIEW targeting_vector AS
  SELECT
    feature_id AS targeting_vector_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'targeting_vector';

--- ************************************************
--- *** relation: genetic_marker ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A measurable sequence feature that varie ***
--- *** s within a population.                   ***
--- ************************************************
---

CREATE VIEW genetic_marker AS
  SELECT
    feature_id AS genetic_marker_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'heritable_phenotypic_marker' OR cvterm.name = 'DArT_marker' OR cvterm.name = 'genetic_marker';

--- ************************************************
--- *** relation: dart_marker ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A genetic marker, discovered using Diver ***
--- *** sity Arrays Technology (DArT) technology ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW dart_marker AS
  SELECT
    feature_id AS dart_marker_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DArT_marker';

--- ************************************************
--- *** relation: kozak_sequence ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of ribosome entry site, specific  ***
--- *** to Eukaryotic organisms that overlaps pa ***
--- *** rt of both 5' UTR and CDS sequence.      ***
--- ************************************************
---

CREATE VIEW kozak_sequence AS
  SELECT
    feature_id AS kozak_sequence_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'kozak_sequence';

--- ************************************************
--- *** relation: nested_transposon ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transposon that is disrupted by the in ***
--- *** sertion of another element.              ***
--- ************************************************
---

CREATE VIEW nested_transposon AS
  SELECT
    feature_id AS nested_transposon_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nested_transposon';

--- ************************************************
--- *** relation: nested_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A repeat that is disrupted by the insert ***
--- *** ion of another element.                  ***
--- ************************************************
---

CREATE VIEW nested_repeat AS
  SELECT
    feature_id AS nested_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nested_tandem_repeat' OR cvterm.name = 'nested_repeat';

--- ************************************************
--- *** relation: inframe_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant which does not cause  ***
--- *** a disruption of the translational readin ***
--- *** g frame.                                 ***
--- ************************************************
---

CREATE VIEW inframe_variant AS
  SELECT
    feature_id AS inframe_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'inframe_variant';

--- ************************************************
--- *** relation: retinoic_acid_responsive_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcription factor binding site of v ***
--- *** ariable direct repeats of the sequence P ***
--- *** uGGTCA spaced by five nucleotides (DR5)  ***
--- *** found in the promoters of retinoic acid- ***
--- *** responsive genes, to which retinoic acid ***
--- ***  receptors bind.                         ***
--- ************************************************
---

CREATE VIEW retinoic_acid_responsive_element AS
  SELECT
    feature_id AS retinoic_acid_responsive_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'retinoic_acid_responsive_element';

--- ************************************************
--- *** relation: nucleotide_to_protein_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the nucleotide m ***
--- *** olecule, interacts selectively and non-c ***
--- *** ovalently with polypeptide residues.     ***
--- ************************************************
---

CREATE VIEW nucleotide_to_protein_binding_site AS
  SELECT
    feature_id AS nucleotide_to_protein_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nuclease_binding_site' OR cvterm.name = 'TF_binding_site' OR cvterm.name = 'histone_binding_site' OR cvterm.name = 'insulator_binding_site' OR cvterm.name = 'enhancer_binding_site' OR cvterm.name = 'restriction_enzyme_binding_site' OR cvterm.name = 'nuclease_sensitive_site' OR cvterm.name = 'homing_endonuclease_binding_site' OR cvterm.name = 'nuclease_hypersensitive_site' OR cvterm.name = 'group_1_intron_homing_endonuclease_target_region' OR cvterm.name = 'DNAseI_hypersensitive_site' OR cvterm.name = 'nucleotide_to_protein_binding_site';

--- ************************************************
--- *** relation: nucleotide_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the molecule, in ***
--- *** teracts selectively and non-covalently w ***
--- *** ith nucleotide residues.                 ***
--- ************************************************
---

CREATE VIEW nucleotide_binding_site AS
  SELECT
    feature_id AS nucleotide_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'miRNA_target_site' OR cvterm.name = 'DNA_binding_site' OR cvterm.name = 'primer_binding_site' OR cvterm.name = 'polypeptide_DNA_contact' OR cvterm.name = 'nucleotide_binding_site';

--- ************************************************
--- *** relation: metal_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the molecule, in ***
--- *** teracts selectively and non-covalently w ***
--- *** ith metal ions.                          ***
--- ************************************************
---

CREATE VIEW metal_binding_site AS
  SELECT
    feature_id AS metal_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_metal_contact' OR cvterm.name = 'polypeptide_calcium_ion_contact_site' OR cvterm.name = 'polypeptide_cobalt_ion_contact_site' OR cvterm.name = 'polypeptide_copper_ion_contact_site' OR cvterm.name = 'polypeptide_iron_ion_contact_site' OR cvterm.name = 'polypeptide_magnesium_ion_contact_site' OR cvterm.name = 'polypeptide_manganese_ion_contact_site' OR cvterm.name = 'polypeptide_molybdenum_ion_contact_site' OR cvterm.name = 'polypeptide_nickel_ion_contact_site' OR cvterm.name = 'polypeptide_tungsten_ion_contact_site' OR cvterm.name = 'polypeptide_zinc_ion_contact_site' OR cvterm.name = 'metal_binding_site';

--- ************************************************
--- *** relation: ligand_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A binding site that, in the molecule, in ***
--- *** teracts selectively and non-covalently w ***
--- *** ith a small molecule such as a drug, or  ***
--- *** hormone.                                 ***
--- ************************************************
---

CREATE VIEW ligand_binding_site AS
  SELECT
    feature_id AS ligand_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polypeptide_ligand_contact' OR cvterm.name = 'ligand_binding_site';

--- ************************************************
--- *** relation: nested_tandem_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An NTR is a nested repeat of two distinc ***
--- *** t tandem motifs interspersed with each o ***
--- *** ther.                                    ***
--- ************************************************
---

CREATE VIEW nested_tandem_repeat AS
  SELECT
    feature_id AS nested_tandem_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nested_tandem_repeat';

--- ************************************************
--- *** relation: promoter_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW promoter_element AS
  SELECT
    feature_id AS promoter_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'GC_rich_promoter_region' OR cvterm.name = 'DMv4_motif' OR cvterm.name = 'DMv5_motif' OR cvterm.name = 'DMv3_motif' OR cvterm.name = 'DMv2_motif' OR cvterm.name = 'DPE1_motif' OR cvterm.name = 'DMv1_motif' OR cvterm.name = 'NDM2_motif' OR cvterm.name = 'NDM3_motif' OR cvterm.name = 'core_promoter_element' OR cvterm.name = 'regulatory_promoter_element' OR cvterm.name = 'CSL_response_element' OR cvterm.name = 'AP_1_binding_site' OR cvterm.name = 'CRE' OR cvterm.name = 'CuRE' OR cvterm.name = 'DRE' OR cvterm.name = 'FLEX_element' OR cvterm.name = 'forkhead_motif' OR cvterm.name = 'homol_E_box' OR cvterm.name = 'HSE' OR cvterm.name = 'mating_type_M_box' OR cvterm.name = 'MCB' OR cvterm.name = 'CCAAT_motif' OR cvterm.name = 'Ace2_UAS' OR cvterm.name = 'TR_box' OR cvterm.name = 'STREP_motif' OR cvterm.name = 'sterol_regulatory_element' OR cvterm.name = 'CDRE_motif' OR cvterm.name = 'PCB' OR cvterm.name = 'm26_site' OR cvterm.name = 'INR_motif' OR cvterm.name = 'DPE_motif' OR cvterm.name = 'BREu_motif' OR cvterm.name = 'TATA_box' OR cvterm.name = 'A_box' OR cvterm.name = 'B_box' OR cvterm.name = 'C_box' OR cvterm.name = 'MTE' OR cvterm.name = 'BREd_motif' OR cvterm.name = 'DCE' OR cvterm.name = 'intermediate_element' OR cvterm.name = 'GATA_box' OR cvterm.name = 'homol_D_box' OR cvterm.name = 'AACCCT_box' OR cvterm.name = 'RNA_polymerase_II_TATA_box' OR cvterm.name = 'RNA_polymerase_III_TATA_box' OR cvterm.name = 'A_box_type_1' OR cvterm.name = 'A_box_type_2' OR cvterm.name = 'iron_repressed_GATA_element' OR cvterm.name = 'proximal_promoter_element' OR cvterm.name = 'distal_promoter_element' OR cvterm.name = 'promoter_element';

--- ************************************************
--- *** relation: core_promoter_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW core_promoter_element AS
  SELECT
    feature_id AS core_promoter_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'INR_motif' OR cvterm.name = 'DPE_motif' OR cvterm.name = 'BREu_motif' OR cvterm.name = 'TATA_box' OR cvterm.name = 'A_box' OR cvterm.name = 'B_box' OR cvterm.name = 'C_box' OR cvterm.name = 'MTE' OR cvterm.name = 'BREd_motif' OR cvterm.name = 'DCE' OR cvterm.name = 'intermediate_element' OR cvterm.name = 'GATA_box' OR cvterm.name = 'homol_D_box' OR cvterm.name = 'AACCCT_box' OR cvterm.name = 'RNA_polymerase_II_TATA_box' OR cvterm.name = 'RNA_polymerase_III_TATA_box' OR cvterm.name = 'A_box_type_1' OR cvterm.name = 'A_box_type_2' OR cvterm.name = 'iron_repressed_GATA_element' OR cvterm.name = 'core_promoter_element';

--- ************************************************
--- *** relation: rna_polymerase_ii_tata_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A TATA box core promoter of a gene trans ***
--- *** cribed by RNA polymerase II.             ***
--- ************************************************
---

CREATE VIEW rna_polymerase_ii_tata_box AS
  SELECT
    feature_id AS rna_polymerase_ii_tata_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RNA_polymerase_II_TATA_box';

--- ************************************************
--- *** relation: rna_polymerase_iii_tata_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A TATA box core promoter of a gene trans ***
--- *** cribed by RNA polymerase III.            ***
--- ************************************************
---

CREATE VIEW rna_polymerase_iii_tata_box AS
  SELECT
    feature_id AS rna_polymerase_iii_tata_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RNA_polymerase_III_TATA_box';

--- ************************************************
--- *** relation: bred_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A core TRNA polymerase II promoter eleme ***
--- *** nt with consensus (G/A)T(T/G/A)(T/A)(G/T ***
--- *** )(T/G)(T/G).                             ***
--- ************************************************
---

CREATE VIEW bred_motif AS
  SELECT
    feature_id AS bred_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'BREd_motif';

--- ************************************************
--- *** relation: dce ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A discontinuous core element of RNA poly ***
--- *** merase II transcribed genes, situated do ***
--- *** wnstream of the TSS. It is composed of t ***
--- *** hree sub elements: SI, SII and SIII.     ***
--- ************************************************
---

CREATE VIEW dce AS
  SELECT
    feature_id AS dce_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DCE';

--- ************************************************
--- *** relation: dce_si ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sub element of the DCE core promoter e ***
--- *** lement, with consensus sequence CTTC.    ***
--- ************************************************
---

CREATE VIEW dce_si AS
  SELECT
    feature_id AS dce_si_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DCE_SI';

--- ************************************************
--- *** relation: dce_sii ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sub element of the DCE core promoter e ***
--- *** lement with consensus sequence CTGT.     ***
--- ************************************************
---

CREATE VIEW dce_sii AS
  SELECT
    feature_id AS dce_sii_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DCE_SII';

--- ************************************************
--- *** relation: dce_siii ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sub element of the DCE core promoter e ***
--- *** lement with consensus sequence AGC.      ***
--- ************************************************
---

CREATE VIEW dce_siii AS
  SELECT
    feature_id AS dce_siii_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DCE_SIII';

--- ************************************************
--- *** relation: proximal_promoter_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW proximal_promoter_element AS
  SELECT
    feature_id AS proximal_promoter_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'proximal_promoter_element';

--- ************************************************
--- *** relation: rnapol_ii_core_promoter ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The minimal portion of the promoter requ ***
--- *** ired to properly initiate transcription  ***
--- *** in RNA polymerase II transcribed genes.  ***
--- ************************************************
---

CREATE VIEW rnapol_ii_core_promoter AS
  SELECT
    feature_id AS rnapol_ii_core_promoter_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'RNApol_II_core_promoter';

--- ************************************************
--- *** relation: distal_promoter_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW distal_promoter_element AS
  SELECT
    feature_id AS distal_promoter_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'distal_promoter_element';

--- ************************************************
--- *** relation: bacterial_rnapol_promoter_sigma_70 ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW bacterial_rnapol_promoter_sigma_70 AS
  SELECT
    feature_id AS bacterial_rnapol_promoter_sigma_70_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'bacterial_RNApol_promoter_sigma_70';

--- ************************************************
--- *** relation: bacterial_rnapol_promoter_sigma54 ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW bacterial_rnapol_promoter_sigma54 AS
  SELECT
    feature_id AS bacterial_rnapol_promoter_sigma54_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'bacterial_RNApol_promoter_sigma54';

--- ************************************************
--- *** relation: minus_12_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved region about 12-bp upstream  ***
--- *** of the start point of bacterial transcri ***
--- *** ption units, involved with sigma factor  ***
--- *** 54.                                      ***
--- ************************************************
---

CREATE VIEW minus_12_signal AS
  SELECT
    feature_id AS minus_12_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'minus_12_signal';

--- ************************************************
--- *** relation: minus_24_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved region about 12-bp upstream  ***
--- *** of the start point of bacterial transcri ***
--- *** ption units, involved with sigma factor  ***
--- *** 54.                                      ***
--- ************************************************
---

CREATE VIEW minus_24_signal AS
  SELECT
    feature_id AS minus_24_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'minus_24_signal';

--- ************************************************
--- *** relation: a_box_type_1 ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An A box within an RNA polymerase III ty ***
--- *** pe 1 promoter.                           ***
--- ************************************************
---

CREATE VIEW a_box_type_1 AS
  SELECT
    feature_id AS a_box_type_1_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'A_box_type_1';

--- ************************************************
--- *** relation: a_box_type_2 ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An A box within an RNA polymerase III ty ***
--- *** pe 2 promoter.                           ***
--- ************************************************
---

CREATE VIEW a_box_type_2 AS
  SELECT
    feature_id AS a_box_type_2_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'A_box_type_2';

--- ************************************************
--- *** relation: intermediate_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A core promoter region of RNA polymerase ***
--- ***  III type 1 promoters.                   ***
--- ************************************************
---

CREATE VIEW intermediate_element AS
  SELECT
    feature_id AS intermediate_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intermediate_element';

--- ************************************************
--- *** relation: regulatory_promoter_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element that is not part of t ***
--- *** he core promoter, but provides the promo ***
--- *** ter with a specific regulatory region.   ***
--- ************************************************
---

CREATE VIEW regulatory_promoter_element AS
  SELECT
    feature_id AS regulatory_promoter_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'proximal_promoter_element' OR cvterm.name = 'distal_promoter_element' OR cvterm.name = 'regulatory_promoter_element';

--- ************************************************
--- *** relation: transcription_regulatory_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regulatory region that is involved in  ***
--- *** the control of the process of transcript ***
--- *** ion.                                     ***
--- ************************************************
---

CREATE VIEW transcription_regulatory_region AS
  SELECT
    feature_id AS transcription_regulatory_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'terminator' OR cvterm.name = 'TF_binding_site' OR cvterm.name = 'polyA_signal_sequence' OR cvterm.name = 'gene_group_regulatory_region' OR cvterm.name = 'transcriptional_cis_regulatory_region' OR cvterm.name = 'splicing_regulatory_region' OR cvterm.name = 'cis_regulatory_frameshift_element' OR cvterm.name = 'intronic_regulatory_region' OR cvterm.name = 'bacterial_terminator' OR cvterm.name = 'eukaryotic_terminator' OR cvterm.name = 'rho_dependent_bacterial_terminator' OR cvterm.name = 'rho_independent_bacterial_terminator' OR cvterm.name = 'terminator_of_type_2_RNApol_III_promoter' OR cvterm.name = 'operator' OR cvterm.name = 'bacterial_RNApol_promoter' OR cvterm.name = 'bacterial_terminator' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_70' OR cvterm.name = 'bacterial_RNApol_promoter_sigma54' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_ecf' OR cvterm.name = 'rho_dependent_bacterial_terminator' OR cvterm.name = 'rho_independent_bacterial_terminator' OR cvterm.name = 'promoter' OR cvterm.name = 'insulator' OR cvterm.name = 'CRM' OR cvterm.name = 'promoter_targeting_sequence' OR cvterm.name = 'ISRE' OR cvterm.name = 'bidirectional_promoter' OR cvterm.name = 'RNA_polymerase_promoter' OR cvterm.name = 'RNApol_I_promoter' OR cvterm.name = 'RNApol_II_promoter' OR cvterm.name = 'RNApol_III_promoter' OR cvterm.name = 'bacterial_RNApol_promoter' OR cvterm.name = 'Phage_RNA_Polymerase_Promoter' OR cvterm.name = 'RNApol_II_core_promoter' OR cvterm.name = 'RNApol_III_promoter_type_1' OR cvterm.name = 'RNApol_III_promoter_type_2' OR cvterm.name = 'RNApol_III_promoter_type_3' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_70' OR cvterm.name = 'bacterial_RNApol_promoter_sigma54' OR cvterm.name = 'bacterial_RNApol_promoter_sigma_ecf' OR cvterm.name = 'SP6_RNA_Polymerase_Promoter' OR cvterm.name = 'T3_RNA_Polymerase_Promoter' OR cvterm.name = 'T7_RNA_Polymerase_Promoter' OR cvterm.name = 'locus_control_region' OR cvterm.name = 'enhancer' OR cvterm.name = 'silencer' OR cvterm.name = 'enhancer_bound_by_factor' OR cvterm.name = 'shadow_enhancer' OR cvterm.name = 'splice_enhancer' OR cvterm.name = 'intronic_splice_enhancer' OR cvterm.name = 'exonic_splice_enhancer' OR cvterm.name = 'transcription_regulatory_region';

--- ************************************************
--- *** relation: translation_regulatory_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regulatory region that is involved in  ***
--- *** the control of the process of translatio ***
--- *** n.                                       ***
--- ************************************************
---

CREATE VIEW translation_regulatory_region AS
  SELECT
    feature_id AS translation_regulatory_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'attenuator' OR cvterm.name = 'translation_regulatory_region';

--- ************************************************
--- *** relation: recombination_regulatory_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regulatory region that is involved in  ***
--- *** the control of the process of recombinat ***
--- *** ion.                                     ***
--- ************************************************
---

CREATE VIEW recombination_regulatory_region AS
  SELECT
    feature_id AS recombination_regulatory_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'recombination_regulatory_region';

--- ************************************************
--- *** relation: replication_regulatory_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regulatory region that is involved in  ***
--- *** the control of the process of nucleotide ***
--- ***  replication.                            ***
--- ************************************************
---

CREATE VIEW replication_regulatory_region AS
  SELECT
    feature_id AS replication_regulatory_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'replication_regulatory_region';

--- ************************************************
--- *** relation: sequence_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence motif is a nucleotide or amin ***
--- *** o-acid sequence pattern that may have bi ***
--- *** ological significance.                   ***
--- ************************************************
---

CREATE VIEW sequence_motif AS
  SELECT
    feature_id AS sequence_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'nucleotide_motif' OR cvterm.name = 'DNA_motif' OR cvterm.name = 'RNA_motif' OR cvterm.name = 'PSE_motif' OR cvterm.name = 'CAAT_signal' OR cvterm.name = 'minus_10_signal' OR cvterm.name = 'minus_35_signal' OR cvterm.name = 'DRE_motif' OR cvterm.name = 'E_box_motif' OR cvterm.name = 'INR1_motif' OR cvterm.name = 'GAGA_motif' OR cvterm.name = 'octamer_motif' OR cvterm.name = 'retinoic_acid_responsive_element' OR cvterm.name = 'promoter_element' OR cvterm.name = 'DCE_SI' OR cvterm.name = 'DCE_SII' OR cvterm.name = 'DCE_SIII' OR cvterm.name = 'minus_12_signal' OR cvterm.name = 'minus_24_signal' OR cvterm.name = 'androgen_response_element' OR cvterm.name = 'rDNA_intergenic_spacer_element' OR cvterm.name = 'Sap1_recognition_motif' OR cvterm.name = 'rDNA_replication_fork_barrier' OR cvterm.name = 'GC_rich_promoter_region' OR cvterm.name = 'DMv4_motif' OR cvterm.name = 'DMv5_motif' OR cvterm.name = 'DMv3_motif' OR cvterm.name = 'DMv2_motif' OR cvterm.name = 'DPE1_motif' OR cvterm.name = 'DMv1_motif' OR cvterm.name = 'NDM2_motif' OR cvterm.name = 'NDM3_motif' OR cvterm.name = 'core_promoter_element' OR cvterm.name = 'regulatory_promoter_element' OR cvterm.name = 'CSL_response_element' OR cvterm.name = 'AP_1_binding_site' OR cvterm.name = 'CRE' OR cvterm.name = 'CuRE' OR cvterm.name = 'DRE' OR cvterm.name = 'FLEX_element' OR cvterm.name = 'forkhead_motif' OR cvterm.name = 'homol_E_box' OR cvterm.name = 'HSE' OR cvterm.name = 'mating_type_M_box' OR cvterm.name = 'MCB' OR cvterm.name = 'CCAAT_motif' OR cvterm.name = 'Ace2_UAS' OR cvterm.name = 'TR_box' OR cvterm.name = 'STREP_motif' OR cvterm.name = 'sterol_regulatory_element' OR cvterm.name = 'CDRE_motif' OR cvterm.name = 'PCB' OR cvterm.name = 'm26_site' OR cvterm.name = 'INR_motif' OR cvterm.name = 'DPE_motif' OR cvterm.name = 'BREu_motif' OR cvterm.name = 'TATA_box' OR cvterm.name = 'A_box' OR cvterm.name = 'B_box' OR cvterm.name = 'C_box' OR cvterm.name = 'MTE' OR cvterm.name = 'BREd_motif' OR cvterm.name = 'DCE' OR cvterm.name = 'intermediate_element' OR cvterm.name = 'GATA_box' OR cvterm.name = 'homol_D_box' OR cvterm.name = 'AACCCT_box' OR cvterm.name = 'RNA_polymerase_II_TATA_box' OR cvterm.name = 'RNA_polymerase_III_TATA_box' OR cvterm.name = 'A_box_type_1' OR cvterm.name = 'A_box_type_2' OR cvterm.name = 'iron_repressed_GATA_element' OR cvterm.name = 'proximal_promoter_element' OR cvterm.name = 'distal_promoter_element' OR cvterm.name = 'RNA_internal_loop' OR cvterm.name = 'A_minor_RNA_motif' OR cvterm.name = 'RNA_junction_loop' OR cvterm.name = 'hammerhead_ribozyme' OR cvterm.name = 'asymmetric_RNA_internal_loop' OR cvterm.name = 'symmetric_RNA_internal_loop' OR cvterm.name = 'K_turn_RNA_motif' OR cvterm.name = 'sarcin_like_RNA_motif' OR cvterm.name = 'RNA_hook_turn' OR cvterm.name = 'sequence_motif';

--- ************************************************
--- *** relation: experimental_feature_attribute ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An attribute of an experimentally derive ***
--- *** d feature.                               ***
--- ************************************************
---

CREATE VIEW experimental_feature_attribute AS
  SELECT
    feature_id AS experimental_feature_attribute_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'score' OR cvterm.name = 'quality_value' OR cvterm.name = 'experimental_feature_attribute';

--- ************************************************
--- *** relation: score ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The score of an experimentally derived f ***
--- *** eature such as a p-value.                ***
--- ************************************************
---

CREATE VIEW score AS
  SELECT
    feature_id AS score_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'score';

--- ************************************************
--- *** relation: quality_value ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An experimental feature attribute that d ***
--- *** efines the quality of the feature in a q ***
--- *** uantitative way, such as a phred quality ***
--- ***  score.                                  ***
--- ************************************************
---

CREATE VIEW quality_value AS
  SELECT
    feature_id AS quality_value_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'quality_value';

--- ************************************************
--- *** relation: restriction_enzyme_recognition_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The nucleotide region (usually a palindr ***
--- *** ome) that is recognized by a restriction ***
--- ***  enzyme. This may or may not be equal to ***
--- ***  the restriction enzyme binding site.    ***
--- ************************************************
---

CREATE VIEW restriction_enzyme_recognition_site AS
  SELECT
    feature_id AS restriction_enzyme_recognition_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'blunt_end_restriction_enzyme_cleavage_site' OR cvterm.name = 'sticky_end_restriction_enzyme_cleavage_site' OR cvterm.name = 'restriction_enzyme_recognition_site';

--- ************************************************
--- *** relation: restriction_enzyme_cleavage_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The boundary at which a restriction enzy ***
--- *** me breaks the nucleotide sequence.       ***
--- ************************************************
---

CREATE VIEW restriction_enzyme_cleavage_junction AS
  SELECT
    feature_id AS restriction_enzyme_cleavage_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'blunt_end_restriction_enzyme_cleavage_junction' OR cvterm.name = 'single_strand_restriction_enzyme_cleavage_site' OR cvterm.name = 'five_prime_restriction_enzyme_junction' OR cvterm.name = 'three_prime_restriction_enzyme_junction' OR cvterm.name = 'restriction_enzyme_cleavage_junction';

--- ************************************************
--- *** relation: five_prime_restriction_enzyme_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The restriction enzyme cleavage junction ***
--- ***  on the 5' strand of the nucleotide sequ ***
--- *** ence.                                    ***
--- ************************************************
---

CREATE VIEW five_prime_restriction_enzyme_junction AS
  SELECT
    feature_id AS five_prime_restriction_enzyme_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_restriction_enzyme_junction';

--- ************************************************
--- *** relation: three_prime_restriction_enzyme_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW three_prime_restriction_enzyme_junction AS
  SELECT
    feature_id AS three_prime_restriction_enzyme_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'three_prime_restriction_enzyme_junction';

--- ************************************************
--- *** relation: blunt_end_restriction_enzyme_cleavage_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW blunt_end_restriction_enzyme_cleavage_site AS
  SELECT
    feature_id AS blunt_end_restriction_enzyme_cleavage_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'blunt_end_restriction_enzyme_cleavage_site';

--- ************************************************
--- *** relation: sticky_end_restriction_enzyme_cleavage_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW sticky_end_restriction_enzyme_cleavage_site AS
  SELECT
    feature_id AS sticky_end_restriction_enzyme_cleavage_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'sticky_end_restriction_enzyme_cleavage_site';

--- ************************************************
--- *** relation: blunt_end_restriction_enzyme_cleavage_junction ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A restriction enzyme cleavage site where ***
--- ***  both strands are cut at the same positi ***
--- *** on.                                      ***
--- ************************************************
---

CREATE VIEW blunt_end_restriction_enzyme_cleavage_junction AS
  SELECT
    feature_id AS blunt_end_restriction_enzyme_cleavage_junction_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'blunt_end_restriction_enzyme_cleavage_junction';

--- ************************************************
--- *** relation: single_strand_restriction_enzyme_cleavage_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A restriction enzyme cleavage site where ***
--- *** by only one strand is cut.               ***
--- ************************************************
---

CREATE VIEW single_strand_restriction_enzyme_cleavage_site AS
  SELECT
    feature_id AS single_strand_restriction_enzyme_cleavage_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'five_prime_restriction_enzyme_junction' OR cvterm.name = 'three_prime_restriction_enzyme_junction' OR cvterm.name = 'single_strand_restriction_enzyme_cleavage_site';

--- ************************************************
--- *** relation: restriction_enzyme_single_strand_overhang ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A terminal region of DNA sequence where  ***
--- *** the end of the region is not blunt ended ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW restriction_enzyme_single_strand_overhang AS
  SELECT
    feature_id AS restriction_enzyme_single_strand_overhang_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'restriction_enzyme_single_strand_overhang';

--- ************************************************
--- *** relation: experimentally_defined_binding_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region that has been implicated in bin ***
--- *** ding although the exact coordinates of b ***
--- *** inding may be unknown.                   ***
--- ************************************************
---

CREATE VIEW experimentally_defined_binding_region AS
  SELECT
    feature_id AS experimentally_defined_binding_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ChIP_seq_region' OR cvterm.name = 'experimentally_defined_binding_region';

--- ************************************************
--- *** relation: chip_seq_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of sequence identified by CHiP  ***
--- *** seq technology to contain a protein bind ***
--- *** ing site.                                ***
--- ************************************************
---

CREATE VIEW chip_seq_region AS
  SELECT
    feature_id AS chip_seq_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ChIP_seq_region';

--- ************************************************
--- *** relation: aspe_primer ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** "A primer containing an SNV at the 3' en ***
--- *** d for accurate genotyping.               ***
--- ************************************************
---

CREATE VIEW aspe_primer AS
  SELECT
    feature_id AS aspe_primer_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ASPE_primer';

--- ************************************************
--- *** relation: dcaps_primer ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A primer with one or more mis-matches to ***
--- ***  the DNA template corresponding to a pos ***
--- *** ition within a restriction enzyme recogn ***
--- *** ition site.                              ***
--- ************************************************
---

CREATE VIEW dcaps_primer AS
  SELECT
    feature_id AS dcaps_primer_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'dCAPS_primer';

--- ************************************************
--- *** relation: histone_modification ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Histone modification is a post translati ***
--- *** onally modified region whereby residues  ***
--- *** of the histone protein are modified by m ***
--- *** ethylation, acetylation, phosphorylation ***
--- *** , ubiquitination, sumoylation, citrullin ***
--- *** ation, or ADP-ribosylation.              ***
--- ************************************************
---

CREATE VIEW histone_modification AS
  SELECT
    feature_id AS histone_modification_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'histone_methylation_site' OR cvterm.name = 'histone_acetylation_site' OR cvterm.name = 'histone_ubiqitination_site' OR cvterm.name = 'histone_acylation_region' OR cvterm.name = 'H4K20_monomethylation_site' OR cvterm.name = 'H2BK5_monomethylation_site' OR cvterm.name = 'H3K27_methylation_site' OR cvterm.name = 'H3K36_methylation_site' OR cvterm.name = 'H3K4_methylation_site' OR cvterm.name = 'H3K79_methylation_site' OR cvterm.name = 'H3K9_methylation_site' OR cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'H3K9_acetylation_site' OR cvterm.name = 'H3K14_acetylation_site' OR cvterm.name = 'H3K18_acetylation_site' OR cvterm.name = 'H3K23_acylation_site' OR cvterm.name = 'H3K27_acylation_site' OR cvterm.name = 'H4K16_acylation_site' OR cvterm.name = 'H4K5_acylation_site' OR cvterm.name = 'H4K8_acylation_site' OR cvterm.name = 'H2B_ubiquitination_site' OR cvterm.name = 'H4K_acylation_region' OR cvterm.name = 'histone_modification';

--- ************************************************
--- *** relation: histone_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A histone modification site where the mo ***
--- *** dification is the methylation of the res ***
--- *** idue.                                    ***
--- ************************************************
---

CREATE VIEW histone_methylation_site AS
  SELECT
    feature_id AS histone_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K20_monomethylation_site' OR cvterm.name = 'H2BK5_monomethylation_site' OR cvterm.name = 'H3K27_methylation_site' OR cvterm.name = 'H3K36_methylation_site' OR cvterm.name = 'H3K4_methylation_site' OR cvterm.name = 'H3K79_methylation_site' OR cvterm.name = 'H3K9_methylation_site' OR cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'histone_methylation_site';

--- ************************************************
--- *** relation: histone_acetylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A histone modification where the modific ***
--- *** ation is the acylation of the residue.   ***
--- ************************************************
---

CREATE VIEW histone_acetylation_site AS
  SELECT
    feature_id AS histone_acetylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_acetylation_site' OR cvterm.name = 'H3K14_acetylation_site' OR cvterm.name = 'H3K18_acetylation_site' OR cvterm.name = 'H3K23_acylation_site' OR cvterm.name = 'H3K27_acylation_site' OR cvterm.name = 'H4K16_acylation_site' OR cvterm.name = 'H4K5_acylation_site' OR cvterm.name = 'H4K8_acylation_site' OR cvterm.name = 'histone_acetylation_site';

--- ************************************************
--- *** relation: h3k9_acetylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 9th residue (a lysine), from th ***
--- *** e start of the H3 histone protein is acy ***
--- *** lated.                                   ***
--- ************************************************
---

CREATE VIEW h3k9_acetylation_site AS
  SELECT
    feature_id AS h3k9_acetylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_acetylation_site';

--- ************************************************
--- *** relation: h3k14_acetylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 14th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is ac ***
--- *** ylated.                                  ***
--- ************************************************
---

CREATE VIEW h3k14_acetylation_site AS
  SELECT
    feature_id AS h3k14_acetylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K14_acetylation_site';

--- ************************************************
--- *** relation: h3k4_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification, whereby  ***
--- *** the 4th residue (a lysine), from the sta ***
--- *** rt of the H3 protein is mono-methylated. ***
--- ************************************************
---

CREATE VIEW h3k4_monomethylation_site AS
  SELECT
    feature_id AS h3k4_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K4_monomethylation_site';

--- ************************************************
--- *** relation: h3k4_trimethylation ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 4th residue (a lysine), from th ***
--- *** e start of the H3 protein is tri-methyla ***
--- *** ted.                                     ***
--- ************************************************
---

CREATE VIEW h3k4_trimethylation AS
  SELECT
    feature_id AS h3k4_trimethylation_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K4_trimethylation';

--- ************************************************
--- *** relation: h3k9_trimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 9th residue (a lysine), from th ***
--- *** e start of the H3 histone protein is tri ***
--- *** -methylated.                             ***
--- ************************************************
---

CREATE VIEW h3k9_trimethylation_site AS
  SELECT
    feature_id AS h3k9_trimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_trimethylation_site';

--- ************************************************
--- *** relation: h3k27_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 27th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is mo ***
--- *** no-methylated.                           ***
--- ************************************************
---

CREATE VIEW h3k27_monomethylation_site AS
  SELECT
    feature_id AS h3k27_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K27_monomethylation_site';

--- ************************************************
--- *** relation: h3k27_trimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 27th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is tr ***
--- *** i-methylated.                            ***
--- ************************************************
---

CREATE VIEW h3k27_trimethylation_site AS
  SELECT
    feature_id AS h3k27_trimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K27_trimethylation_site';

--- ************************************************
--- *** relation: h3k79_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 79th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is mo ***
--- *** no- methylated.                          ***
--- ************************************************
---

CREATE VIEW h3k79_monomethylation_site AS
  SELECT
    feature_id AS h3k79_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K79_monomethylation_site';

--- ************************************************
--- *** relation: h3k79_dimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 79th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is di ***
--- *** -methylated.                             ***
--- ************************************************
---

CREATE VIEW h3k79_dimethylation_site AS
  SELECT
    feature_id AS h3k79_dimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K79_dimethylation_site';

--- ************************************************
--- *** relation: h3k79_trimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 79th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is tr ***
--- *** i-methylated.                            ***
--- ************************************************
---

CREATE VIEW h3k79_trimethylation_site AS
  SELECT
    feature_id AS h3k79_trimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K79_trimethylation_site';

--- ************************************************
--- *** relation: h4k20_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 20th residue (a lysine), from t ***
--- *** he start of the H34histone protein is mo ***
--- *** no-methylated.                           ***
--- ************************************************
---

CREATE VIEW h4k20_monomethylation_site AS
  SELECT
    feature_id AS h4k20_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K20_monomethylation_site';

--- ************************************************
--- *** relation: h2bk5_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 5th residue (a lysine), from th ***
--- *** e start of the H2B protein is methylated ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW h2bk5_monomethylation_site AS
  SELECT
    feature_id AS h2bk5_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H2BK5_monomethylation_site';

--- ************************************************
--- *** relation: isre ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An ISRE is a transcriptional cis regulat ***
--- *** ory region, containing the consensus reg ***
--- *** ion: YAGTTTC(A/T)YTTTYCC, responsible fo ***
--- *** r increased transcription via interferon ***
--- ***  binding.                                ***
--- ************************************************
---

CREATE VIEW isre AS
  SELECT
    feature_id AS isre_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ISRE';

--- ************************************************
--- *** relation: histone_ubiqitination_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A histone modification site where ubiqui ***
--- *** tin may be added.                        ***
--- ************************************************
---

CREATE VIEW histone_ubiqitination_site AS
  SELECT
    feature_id AS histone_ubiqitination_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H2B_ubiquitination_site' OR cvterm.name = 'histone_ubiqitination_site';

--- ************************************************
--- *** relation: h2b_ubiquitination_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A histone modification site on H2B where ***
--- ***  ubiquitin may be added.                 ***
--- ************************************************
---

CREATE VIEW h2b_ubiquitination_site AS
  SELECT
    feature_id AS h2b_ubiquitination_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H2B_ubiquitination_site';

--- ************************************************
--- *** relation: h3k18_acetylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 14th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is ac ***
--- *** ylated.                                  ***
--- ************************************************
---

CREATE VIEW h3k18_acetylation_site AS
  SELECT
    feature_id AS h3k18_acetylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K18_acetylation_site';

--- ************************************************
--- *** relation: h3k23_acylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification, whereby  ***
--- *** the 23rd residue (a lysine), from the st ***
--- *** art of the H3 histone protein is acylate ***
--- *** d.                                       ***
--- ************************************************
---

CREATE VIEW h3k23_acylation_site AS
  SELECT
    feature_id AS h3k23_acylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K23_acylation_site';

--- ************************************************
--- *** relation: epigenetically_modified_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A biological region implicated in inheri ***
--- *** ted changes caused by mechanisms other t ***
--- *** han changes in the underlying DNA sequen ***
--- *** ce.                                      ***
--- ************************************************
---

CREATE VIEW epigenetically_modified_region AS
  SELECT
    feature_id AS epigenetically_modified_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'modified_DNA_base' OR cvterm.name = 'epigenetically_modified_gene' OR cvterm.name = 'histone_modification' OR cvterm.name = 'methylated_DNA_base_feature' OR cvterm.name = 'methylated_cytosine' OR cvterm.name = 'methylated_adenine' OR cvterm.name = '5_methylcytosine' OR cvterm.name = 'N4_methylcytosine' OR cvterm.name = 'N6_methyladenine' OR cvterm.name = 'gene_rearranged_at_DNA_level' OR cvterm.name = 'maternally_imprinted_gene' OR cvterm.name = 'paternally_imprinted_gene' OR cvterm.name = 'allelically_excluded_gene' OR cvterm.name = 'histone_methylation_site' OR cvterm.name = 'histone_acetylation_site' OR cvterm.name = 'histone_ubiqitination_site' OR cvterm.name = 'histone_acylation_region' OR cvterm.name = 'H4K20_monomethylation_site' OR cvterm.name = 'H2BK5_monomethylation_site' OR cvterm.name = 'H3K27_methylation_site' OR cvterm.name = 'H3K36_methylation_site' OR cvterm.name = 'H3K4_methylation_site' OR cvterm.name = 'H3K79_methylation_site' OR cvterm.name = 'H3K9_methylation_site' OR cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'H3K9_acetylation_site' OR cvterm.name = 'H3K14_acetylation_site' OR cvterm.name = 'H3K18_acetylation_site' OR cvterm.name = 'H3K23_acylation_site' OR cvterm.name = 'H3K27_acylation_site' OR cvterm.name = 'H4K16_acylation_site' OR cvterm.name = 'H4K5_acylation_site' OR cvterm.name = 'H4K8_acylation_site' OR cvterm.name = 'H2B_ubiquitination_site' OR cvterm.name = 'H4K_acylation_region' OR cvterm.name = 'epigenetically_modified_region';

--- ************************************************
--- *** relation: h3k27_acylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 27th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is ac ***
--- *** ylated.                                  ***
--- ************************************************
---

CREATE VIEW h3k27_acylation_site AS
  SELECT
    feature_id AS h3k27_acylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K27_acylation_site';

--- ************************************************
--- *** relation: h3k36_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 36th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is mo ***
--- *** no-methylated.                           ***
--- ************************************************
---

CREATE VIEW h3k36_monomethylation_site AS
  SELECT
    feature_id AS h3k36_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K36_monomethylation_site';

--- ************************************************
--- *** relation: h3k36_dimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 36th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is di ***
--- *** methylated.                              ***
--- ************************************************
---

CREATE VIEW h3k36_dimethylation_site AS
  SELECT
    feature_id AS h3k36_dimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K36_dimethylation_site';

--- ************************************************
--- *** relation: h3k36_trimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 36th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is tr ***
--- *** i-methylated.                            ***
--- ************************************************
---

CREATE VIEW h3k36_trimethylation_site AS
  SELECT
    feature_id AS h3k36_trimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K36_trimethylation_site';

--- ************************************************
--- *** relation: h3k4_dimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 4th residue (a lysine), from th ***
--- *** e start of the H3 histone protein is di- ***
--- *** methylated.                              ***
--- ************************************************
---

CREATE VIEW h3k4_dimethylation_site AS
  SELECT
    feature_id AS h3k4_dimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K4_dimethylation_site';

--- ************************************************
--- *** relation: h3k27_dimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 27th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is di ***
--- *** -methylated.                             ***
--- ************************************************
---

CREATE VIEW h3k27_dimethylation_site AS
  SELECT
    feature_id AS h3k27_dimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K27_dimethylation_site';

--- ************************************************
--- *** relation: h3k9_monomethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 9th residue (a lysine), from th ***
--- *** e start of the H3 histone protein is mon ***
--- *** o-methylated.                            ***
--- ************************************************
---

CREATE VIEW h3k9_monomethylation_site AS
  SELECT
    feature_id AS h3k9_monomethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_monomethylation_site';

--- ************************************************
--- *** relation: h3k9_dimethylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 9th residue (a lysine), from th ***
--- *** e start of the H3 histone protein may be ***
--- ***  dimethylated.                           ***
--- ************************************************
---

CREATE VIEW h3k9_dimethylation_site AS
  SELECT
    feature_id AS h3k9_dimethylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_dimethylation_site';

--- ************************************************
--- *** relation: h4k16_acylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 16th residue (a lysine), from t ***
--- *** he start of the H4 histone protein is ac ***
--- *** ylated.                                  ***
--- ************************************************
---

CREATE VIEW h4k16_acylation_site AS
  SELECT
    feature_id AS h4k16_acylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K16_acylation_site';

--- ************************************************
--- *** relation: h4k5_acylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 5th residue (a lysine), from th ***
--- *** e start of the H4 histone protein is acy ***
--- *** lated.                                   ***
--- ************************************************
---

CREATE VIEW h4k5_acylation_site AS
  SELECT
    feature_id AS h4k5_acylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K5_acylation_site';

--- ************************************************
--- *** relation: h4k8_acylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 8th residue (a lysine), from th ***
--- *** e start of the H4 histone protein is acy ***
--- *** lated.                                   ***
--- ************************************************
---

CREATE VIEW h4k8_acylation_site AS
  SELECT
    feature_id AS h4k8_acylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K8_acylation_site';

--- ************************************************
--- *** relation: h3k27_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 27th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is me ***
--- *** thylated.                                ***
--- ************************************************
---

CREATE VIEW h3k27_methylation_site AS
  SELECT
    feature_id AS h3k27_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K27_monomethylation_site' OR cvterm.name = 'H3K27_trimethylation_site' OR cvterm.name = 'H3K27_dimethylation_site' OR cvterm.name = 'H3K27_methylation_site';

--- ************************************************
--- *** relation: h3k36_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 36th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is me ***
--- *** thylated.                                ***
--- ************************************************
---

CREATE VIEW h3k36_methylation_site AS
  SELECT
    feature_id AS h3k36_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K36_monomethylation_site' OR cvterm.name = 'H3K36_dimethylation_site' OR cvterm.name = 'H3K36_trimethylation_site' OR cvterm.name = 'H3K36_methylation_site';

--- ************************************************
--- *** relation: h3k4_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification, whereby  ***
--- *** the 4th residue (a lysine), from the sta ***
--- *** rt of the H3 protein is methylated.      ***
--- ************************************************
---

CREATE VIEW h3k4_methylation_site AS
  SELECT
    feature_id AS h3k4_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K4_monomethylation_site' OR cvterm.name = 'H3K4_trimethylation' OR cvterm.name = 'H3K4_dimethylation_site' OR cvterm.name = 'H3K4_methylation_site';

--- ************************************************
--- *** relation: h3k79_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 79th residue (a lysine), from t ***
--- *** he start of the H3 histone protein is me ***
--- *** thylated.                                ***
--- ************************************************
---

CREATE VIEW h3k79_methylation_site AS
  SELECT
    feature_id AS h3k79_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K79_monomethylation_site' OR cvterm.name = 'H3K79_dimethylation_site' OR cvterm.name = 'H3K79_trimethylation_site' OR cvterm.name = 'H3K79_methylation_site';

--- ************************************************
--- *** relation: h3k9_methylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of histone modification site, whe ***
--- *** reby the 9th residue (a lysine), from th ***
--- *** e start of the H3 histone protein is met ***
--- *** hylated.                                 ***
--- ************************************************
---

CREATE VIEW h3k9_methylation_site AS
  SELECT
    feature_id AS h3k9_methylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H3K9_trimethylation_site' OR cvterm.name = 'H3K9_monomethylation_site' OR cvterm.name = 'H3K9_dimethylation_site' OR cvterm.name = 'H3K9_methylation_site';

--- ************************************************
--- *** relation: histone_acylation_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A histone modification, whereby the hist ***
--- *** one protein is acylated at multiple site ***
--- *** s in a region.                           ***
--- ************************************************
---

CREATE VIEW histone_acylation_region AS
  SELECT
    feature_id AS histone_acylation_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K_acylation_region' OR cvterm.name = 'histone_acylation_region';

--- ************************************************
--- *** relation: h4k_acylation_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of the H4 histone whereby multi ***
--- *** ple lysines are acylated.                ***
--- ************************************************
---

CREATE VIEW h4k_acylation_region AS
  SELECT
    feature_id AS h4k_acylation_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'H4K_acylation_region';

--- ************************************************
--- *** relation: gene_with_non_canonical_start_codon ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene with a start codon other than AUG ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW gene_with_non_canonical_start_codon AS
  SELECT
    feature_id AS gene_with_non_canonical_start_codon_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'gene_with_start_codon_CUG' OR cvterm.name = 'gene_with_non_canonical_start_codon';

--- ************************************************
--- *** relation: gene_with_start_codon_cug ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene with a translational start codon  ***
--- *** of CUG.                                  ***
--- ************************************************
---

CREATE VIEW gene_with_start_codon_cug AS
  SELECT
    feature_id AS gene_with_start_codon_cug_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'gene_with_start_codon_CUG';

--- ************************************************
--- *** relation: pseudogenic_gene_segment ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene segment which when incorporated b ***
--- *** y somatic recombination in the final gen ***
--- *** e transcript results in a nonfunctional  ***
--- *** product.                                 ***
--- ************************************************
---

CREATE VIEW pseudogenic_gene_segment AS
  SELECT
    feature_id AS pseudogenic_gene_segment_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pseudogenic_gene_segment';

--- ************************************************
--- *** relation: copy_number_gain ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence alteration whereby the copy n ***
--- *** umber of a given regions is greater than ***
--- ***  the reference sequence.                 ***
--- ************************************************
---

CREATE VIEW copy_number_gain AS
  SELECT
    feature_id AS copy_number_gain_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'copy_number_gain';

--- ************************************************
--- *** relation: copy_number_loss ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence alteration whereby the copy n ***
--- *** umber of a given region is less than the ***
--- ***  reference sequence.                     ***
--- ************************************************
---

CREATE VIEW copy_number_loss AS
  SELECT
    feature_id AS copy_number_loss_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'copy_number_loss';

--- ************************************************
--- *** relation: upd ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Uniparental disomy is a sequence_alterat ***
--- *** ion where a diploid individual receives  ***
--- *** two copies for all or part of a chromoso ***
--- *** me from one parent and no copies of the  ***
--- *** same chromosome or region from the other ***
--- ***  parent.                                 ***
--- ************************************************
---

CREATE VIEW upd AS
  SELECT
    feature_id AS upd_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'maternal_uniparental_disomy' OR cvterm.name = 'paternal_uniparental_disomy' OR cvterm.name = 'UPD';

--- ************************************************
--- *** relation: maternal_uniparental_disomy ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Uniparental disomy is a sequence_alterat ***
--- *** ion where a diploid individual receives  ***
--- *** two copies for all or part of a chromoso ***
--- *** me from the mother and no copies of the  ***
--- *** same chromosome or region from the fathe ***
--- *** r.                                       ***
--- ************************************************
---

CREATE VIEW maternal_uniparental_disomy AS
  SELECT
    feature_id AS maternal_uniparental_disomy_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'maternal_uniparental_disomy';

--- ************************************************
--- *** relation: paternal_uniparental_disomy ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Uniparental disomy is a sequence_alterat ***
--- *** ion where a diploid individual receives  ***
--- *** two copies for all or part of a chromoso ***
--- *** me from the father and no copies of the  ***
--- *** same chromosome or region from the mothe ***
--- *** r.                                       ***
--- ************************************************
---

CREATE VIEW paternal_uniparental_disomy AS
  SELECT
    feature_id AS paternal_uniparental_disomy_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'paternal_uniparental_disomy';

--- ************************************************
--- *** relation: open_chromatin_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A DNA sequence that in the normal state  ***
--- *** of the chromosome corresponds to an unfo ***
--- *** lded, un-complexed stretch of double-str ***
--- *** anded DNA.                               ***
--- ************************************************
---

CREATE VIEW open_chromatin_region AS
  SELECT
    feature_id AS open_chromatin_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'open_chromatin_region';

--- ************************************************
--- *** relation: sl3_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 3 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL3 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl3_acceptor_site AS
  SELECT
    feature_id AS sl3_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL3_acceptor_site';

--- ************************************************
--- *** relation: sl4_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 4 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL4 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl4_acceptor_site AS
  SELECT
    feature_id AS sl4_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL4_acceptor_site';

--- ************************************************
--- *** relation: sl5_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 5 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL5 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl5_acceptor_site AS
  SELECT
    feature_id AS sl5_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL5_acceptor_site';

--- ************************************************
--- *** relation: sl6_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 6 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL6 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl6_acceptor_site AS
  SELECT
    feature_id AS sl6_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL6_acceptor_site';

--- ************************************************
--- *** relation: sl7_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 7 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL7 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl7_acceptor_site AS
  SELECT
    feature_id AS sl7_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL7_acceptor_site';

--- ************************************************
--- *** relation: sl8_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 8 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL8 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl8_acceptor_site AS
  SELECT
    feature_id AS sl8_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL8_acceptor_site';

--- ************************************************
--- *** relation: sl9_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 9 RNA leader sequence to the 5' end of a ***
--- *** n mRNA. SL9 acceptor sites occur in gene ***
--- *** s in internal segments of polycistronic  ***
--- *** transcripts.                             ***
--- ************************************************
---

CREATE VIEW sl9_acceptor_site AS
  SELECT
    feature_id AS sl9_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL9_acceptor_site';

--- ************************************************
--- *** relation: sl10_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 10 RNA leader sequence to the 5' end of  ***
--- *** an mRNA. SL10 acceptor sites occur in ge ***
--- *** nes in internal segments of polycistroni ***
--- *** c transcripts.                           ***
--- ************************************************
---

CREATE VIEW sl10_acceptor_site AS
  SELECT
    feature_id AS sl10_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL10_acceptor_site';

--- ************************************************
--- *** relation: sl11_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 11 RNA leader sequence to the 5' end of  ***
--- *** an mRNA. SL11 acceptor sites occur in ge ***
--- *** nes in internal segments of polycistroni ***
--- *** c transcripts.                           ***
--- ************************************************
---

CREATE VIEW sl11_acceptor_site AS
  SELECT
    feature_id AS sl11_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL11_acceptor_site';

--- ************************************************
--- *** relation: sl12_acceptor_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A SL2_acceptor_site which appends the SL ***
--- *** 12 RNA leader sequence to the 5' end of  ***
--- *** an mRNA. SL12 acceptor sites occur in ge ***
--- *** nes in internal segments of polycistroni ***
--- *** c transcripts.                           ***
--- ************************************************
---

CREATE VIEW sl12_acceptor_site AS
  SELECT
    feature_id AS sl12_acceptor_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'SL12_acceptor_site';

--- ************************************************
--- *** relation: duplicated_pseudogene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A pseudogene that arose via gene duplica ***
--- *** tion. Generally duplicated pseudogenes h ***
--- *** ave the same structure as the original g ***
--- *** ene, including intron-exon structure and ***
--- ***  some regulatory sequence.               ***
--- ************************************************
---

CREATE VIEW duplicated_pseudogene AS
  SELECT
    feature_id AS duplicated_pseudogene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'duplicated_pseudogene';

--- ************************************************
--- *** relation: unitary_pseudogene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A pseudogene, deactivated from original  ***
--- *** state by mutation, fixed in a population ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW unitary_pseudogene AS
  SELECT
    feature_id AS unitary_pseudogene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'unitary_pseudogene';

--- ************************************************
--- *** relation: non_processed_pseudogene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A pseudogene that arose from a means oth ***
--- *** er than retrotransposition.              ***
--- ************************************************
---

CREATE VIEW non_processed_pseudogene AS
  SELECT
    feature_id AS non_processed_pseudogene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pseudogene_by_unequal_crossing_over' OR cvterm.name = 'nuclear_mt_pseudogene' OR cvterm.name = 'cassette_pseudogene' OR cvterm.name = 'duplicated_pseudogene' OR cvterm.name = 'unitary_pseudogene' OR cvterm.name = 'non_processed_pseudogene';

--- ************************************************
--- *** relation: variant_quality ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A dependent entity that inheres in a bea ***
--- *** rer, a sequence variant.                 ***
--- ************************************************
---

CREATE VIEW variant_quality AS
  SELECT
    feature_id AS variant_quality_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'variant_origin' OR cvterm.name = 'variant_frequency' OR cvterm.name = 'variant_phenotype' OR cvterm.name = 'coding_variant_quality' OR cvterm.name = 'maternal_variant' OR cvterm.name = 'paternal_variant' OR cvterm.name = 'somatic_variant' OR cvterm.name = 'germline_variant' OR cvterm.name = 'pedigree_specific_variant' OR cvterm.name = 'population_specific_variant' OR cvterm.name = 'de_novo_variant' OR cvterm.name = 'unique_variant' OR cvterm.name = 'rare_variant' OR cvterm.name = 'polymorphic_variant' OR cvterm.name = 'common_variant' OR cvterm.name = 'fixed_variant' OR cvterm.name = 'benign_variant' OR cvterm.name = 'disease_associated_variant' OR cvterm.name = 'disease_causing_variant' OR cvterm.name = 'lethal_variant' OR cvterm.name = 'quantitative_variant' OR cvterm.name = 'synonymous' OR cvterm.name = 'non_synonymous' OR cvterm.name = 'variant_quality';

--- ************************************************
--- *** relation: variant_origin ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A quality inhering in a variant by virtu ***
--- *** e of its origin.                         ***
--- ************************************************
---

CREATE VIEW variant_origin AS
  SELECT
    feature_id AS variant_origin_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'maternal_variant' OR cvterm.name = 'paternal_variant' OR cvterm.name = 'somatic_variant' OR cvterm.name = 'germline_variant' OR cvterm.name = 'pedigree_specific_variant' OR cvterm.name = 'population_specific_variant' OR cvterm.name = 'de_novo_variant' OR cvterm.name = 'variant_origin';

--- ************************************************
--- *** relation: variant_frequency ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A physical quality which inheres to the  ***
--- *** variant by virtue of the number instance ***
--- *** s of the variant within a population.    ***
--- ************************************************
---

CREATE VIEW variant_frequency AS
  SELECT
    feature_id AS variant_frequency_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'unique_variant' OR cvterm.name = 'rare_variant' OR cvterm.name = 'polymorphic_variant' OR cvterm.name = 'common_variant' OR cvterm.name = 'fixed_variant' OR cvterm.name = 'variant_frequency';

--- ************************************************
--- *** relation: unique_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A physical quality which inheres to the  ***
--- *** variant by virtue of the number instance ***
--- *** s of the variant within a population.    ***
--- ************************************************
---

CREATE VIEW unique_variant AS
  SELECT
    feature_id AS unique_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'unique_variant';

--- ************************************************
--- *** relation: rare_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW rare_variant AS
  SELECT
    feature_id AS rare_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'rare_variant';

--- ************************************************
--- *** relation: polymorphic_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW polymorphic_variant AS
  SELECT
    feature_id AS polymorphic_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polymorphic_variant';

--- ************************************************
--- *** relation: common_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW common_variant AS
  SELECT
    feature_id AS common_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'common_variant';

--- ************************************************
--- *** relation: fixed_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW fixed_variant AS
  SELECT
    feature_id AS fixed_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'fixed_variant';

--- ************************************************
--- *** relation: variant_phenotype ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A quality inhering in a variant by virtu ***
--- *** e of its phenotype.                      ***
--- ************************************************
---

CREATE VIEW variant_phenotype AS
  SELECT
    feature_id AS variant_phenotype_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'benign_variant' OR cvterm.name = 'disease_associated_variant' OR cvterm.name = 'disease_causing_variant' OR cvterm.name = 'lethal_variant' OR cvterm.name = 'quantitative_variant' OR cvterm.name = 'variant_phenotype';

--- ************************************************
--- *** relation: benign_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW benign_variant AS
  SELECT
    feature_id AS benign_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'benign_variant';

--- ************************************************
--- *** relation: disease_associated_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW disease_associated_variant AS
  SELECT
    feature_id AS disease_associated_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'disease_associated_variant';

--- ************************************************
--- *** relation: disease_causing_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW disease_causing_variant AS
  SELECT
    feature_id AS disease_causing_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'disease_causing_variant';

--- ************************************************
--- *** relation: lethal_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW lethal_variant AS
  SELECT
    feature_id AS lethal_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'lethal_variant';

--- ************************************************
--- *** relation: quantitative_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW quantitative_variant AS
  SELECT
    feature_id AS quantitative_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'quantitative_variant';

--- ************************************************
--- *** relation: maternal_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW maternal_variant AS
  SELECT
    feature_id AS maternal_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'maternal_variant';

--- ************************************************
--- *** relation: paternal_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW paternal_variant AS
  SELECT
    feature_id AS paternal_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'paternal_variant';

--- ************************************************
--- *** relation: somatic_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW somatic_variant AS
  SELECT
    feature_id AS somatic_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'somatic_variant';

--- ************************************************
--- *** relation: germline_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW germline_variant AS
  SELECT
    feature_id AS germline_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'germline_variant';

--- ************************************************
--- *** relation: pedigree_specific_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW pedigree_specific_variant AS
  SELECT
    feature_id AS pedigree_specific_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'pedigree_specific_variant';

--- ************************************************
--- *** relation: population_specific_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW population_specific_variant AS
  SELECT
    feature_id AS population_specific_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'population_specific_variant';

--- ************************************************
--- *** relation: de_novo_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW de_novo_variant AS
  SELECT
    feature_id AS de_novo_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'de_novo_variant';

--- ************************************************
--- *** relation: tf_binding_site_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant located within a tran ***
--- *** scription factor binding site.           ***
--- ************************************************
---

CREATE VIEW tf_binding_site_variant AS
  SELECT
    feature_id AS tf_binding_site_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'TF_binding_site_variant';

--- ************************************************
--- *** relation: complex_structural_alteration ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A structural sequence alteration or rear ***
--- *** rangement encompassing one or more genom ***
--- *** e fragments.                             ***
--- ************************************************
---

CREATE VIEW complex_structural_alteration AS
  SELECT
    feature_id AS complex_structural_alteration_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_structural_alteration';

--- ************************************************
--- *** relation: structural_alteration ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW structural_alteration AS
  SELECT
    feature_id AS structural_alteration_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'complex_structural_alteration' OR cvterm.name = 'rearrangement_breakpoint' OR cvterm.name = 'interchromosomal_breakpoint' OR cvterm.name = 'intrachromosomal_breakpoint' OR cvterm.name = 'structural_alteration';

--- ************************************************
--- *** relation: loss_of_heterozygosity ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A functional variant whereby the sequenc ***
--- *** e alteration causes a loss of function o ***
--- *** f one allele of a gene.                  ***
--- ************************************************
---

CREATE VIEW loss_of_heterozygosity AS
  SELECT
    feature_id AS loss_of_heterozygosity_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'loss_of_heterozygosity';

--- ************************************************
--- *** relation: splice_donor_5th_base_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that causes a change  ***
--- *** at the 5th base pair after the start of  ***
--- *** the intron in the orientation of the tra ***
--- *** nscript.                                 ***
--- ************************************************
---

CREATE VIEW splice_donor_5th_base_variant AS
  SELECT
    feature_id AS splice_donor_5th_base_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'splice_donor_5th_base_variant';

--- ************************************************
--- *** relation: u_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An U-box is a conserved T-rich region up ***
--- *** stream of a retroviral polypurine tract  ***
--- *** that is involved in PPT primer creation  ***
--- *** during reverse transcription.            ***
--- ************************************************
---

CREATE VIEW u_box AS
  SELECT
    feature_id AS u_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'U_box';

--- ************************************************
--- *** relation: mating_type_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A specialized region in the genomes of s ***
--- *** ome yeast and fungi, the genes of which  ***
--- *** regulate mating type.                    ***
--- ************************************************
---

CREATE VIEW mating_type_region AS
  SELECT
    feature_id AS mating_type_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mating_type_region';

--- ************************************************
--- *** relation: paired_end_fragment ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An assembly region that has been sequenc ***
--- *** ed from both ends resulting in a read_pa ***
--- *** ir (mate_pair).                          ***
--- ************************************************
---

CREATE VIEW paired_end_fragment AS
  SELECT
    feature_id AS paired_end_fragment_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'paired_end_fragment';

--- ************************************************
--- *** relation: exon_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes exon seq ***
--- *** uence.                                   ***
--- ************************************************
---

CREATE VIEW exon_variant AS
  SELECT
    feature_id AS exon_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'coding_sequence_variant' OR cvterm.name = 'non_coding_exon_variant' OR cvterm.name = 'terminator_codon_variant' OR cvterm.name = 'protein_altering_variant' OR cvterm.name = 'synonymous_variant' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'stop_lost' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'stop_retained_variant' OR cvterm.name = 'exon_variant';

--- ************************************************
--- *** relation: non_coding_exon_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant that changes non-codi ***
--- *** ng exon sequence.                        ***
--- ************************************************
---

CREATE VIEW non_coding_exon_variant AS
  SELECT
    feature_id AS non_coding_exon_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'non_coding_exon_variant';

--- ************************************************
--- *** relation: clone_end ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A read from an end of the clone sequence ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW clone_end AS
  SELECT
    feature_id AS clone_end_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'clone_end';

--- ************************************************
--- *** relation: point_centromere ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A point centromere is a relatively small ***
--- ***  centromere (about 125 bp DNA) in discre ***
--- *** te sequence, found in some yeast includi ***
--- *** ng S. cerevisiae.                        ***
--- ************************************************
---

CREATE VIEW point_centromere AS
  SELECT
    feature_id AS point_centromere_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'point_centromere';

--- ************************************************
--- *** relation: regional_centromere ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A regional centromere is a large modular ***
--- ***  centromere found in fission yeast and h ***
--- *** igher eukaryotes. It consist of a centra ***
--- *** l core region flanked by inverted inner  ***
--- *** and outer repeat regions.                ***
--- ************************************************
---

CREATE VIEW regional_centromere AS
  SELECT
    feature_id AS regional_centromere_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'regional_centromere';

--- ************************************************
--- *** relation: regional_centromere_central_core ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved region within the central re ***
--- *** gion of a modular centromere, where the  ***
--- *** kinetochore is formed.                   ***
--- ************************************************
---

CREATE VIEW regional_centromere_central_core AS
  SELECT
    feature_id AS regional_centromere_central_core_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'regional_centromere_central_core';

--- ************************************************
--- *** relation: centromeric_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A repeat region found within the modular ***
--- ***  centromere.                             ***
--- ************************************************
---

CREATE VIEW centromeric_repeat AS
  SELECT
    feature_id AS centromeric_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'regional_centromere_inner_repeat_region' OR cvterm.name = 'regional_centromere_outer_repeat_region' OR cvterm.name = 'dg_repeat' OR cvterm.name = 'dh_repeat' OR cvterm.name = 'centromeric_repeat';

--- ************************************************
--- *** relation: regional_centromere_inner_repeat_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The inner inverted repeat region of a mo ***
--- *** dular centromere and part of the entral  ***
--- *** core surrounding a non-conserved central ***
--- ***  region. This region is adjacent to the  ***
--- *** central core, on each chromosome arm.    ***
--- ************************************************
---

CREATE VIEW regional_centromere_inner_repeat_region AS
  SELECT
    feature_id AS regional_centromere_inner_repeat_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'regional_centromere_inner_repeat_region';

--- ************************************************
--- *** relation: regional_centromere_outer_repeat_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The heterochromatic outer repeat region  ***
--- *** of a modular centromere. These repeats e ***
--- *** xist in tandem arrays on both chromosome ***
--- ***  arms.                                   ***
--- ************************************************
---

CREATE VIEW regional_centromere_outer_repeat_region AS
  SELECT
    feature_id AS regional_centromere_outer_repeat_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'regional_centromere_outer_repeat_region';

--- ************************************************
--- *** relation: tasirna ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The sequence of a 21 nucleotide double s ***
--- *** tranded, polyadenylated non coding RNA,  ***
--- *** transcribed from the TAS gene.           ***
--- ************************************************
---

CREATE VIEW tasirna AS
  SELECT
    feature_id AS tasirna_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tasiRNA';

--- ************************************************
--- *** relation: tasirna_primary_transcript ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A primary transcript encoding a tasiRNA. ***
--- ************************************************
---

CREATE VIEW tasirna_primary_transcript AS
  SELECT
    feature_id AS tasirna_primary_transcript_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'tasiRNA_primary_transcript';

--- ************************************************
--- *** relation: increased_polyadenylation_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript processing variant whereby  ***
--- *** polyadenylation of the encoded transcrip ***
--- *** t is increased with respect to the refer ***
--- *** ence.                                    ***
--- ************************************************
---

CREATE VIEW increased_polyadenylation_variant AS
  SELECT
    feature_id AS increased_polyadenylation_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'increased_polyadenylation_variant';

--- ************************************************
--- *** relation: decreased_polyadenylation_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A transcript processing variant whereby  ***
--- *** polyadenylation of the encoded transcrip ***
--- *** t is decreased with respect to the refer ***
--- *** ence.                                    ***
--- ************************************************
---

CREATE VIEW decreased_polyadenylation_variant AS
  SELECT
    feature_id AS decreased_polyadenylation_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'decreased_polyadenylation_variant';

--- ************************************************
--- *** relation: ddb_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved polypeptide motif that media ***
--- *** tes protein-protein interaction and defi ***
--- *** nes adaptor proteins for DDB1/cullin 4 u ***
--- *** biquitin ligases.                        ***
--- ************************************************
---

CREATE VIEW ddb_box AS
  SELECT
    feature_id AS ddb_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DDB_box';

--- ************************************************
--- *** relation: destruction_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved polypeptide motif that can b ***
--- *** e recognized by both Fizzy/Cdc20- and FZ ***
--- *** R/Cdh1-activated anaphase-promoting comp ***
--- *** lex/cyclosome (APC/C) and targets a prot ***
--- *** ein for ubiquitination and subsequent de ***
--- *** gradation by the APC/C. The consensus se ***
--- *** quence is RXXLXXXXN.                     ***
--- ************************************************
---

CREATE VIEW destruction_box AS
  SELECT
    feature_id AS destruction_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'destruction_box';

--- ************************************************
--- *** relation: er_retention_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A C-terminal tetrapeptide motif that med ***
--- *** iates retention of a protein in (or retr ***
--- *** ieval to) the endoplasmic reticulum. In  ***
--- *** mammals the sequence is KDEL, and in fun ***
--- *** gi HDEL or DDEL.                         ***
--- ************************************************
---

CREATE VIEW er_retention_signal AS
  SELECT
    feature_id AS er_retention_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'ER_retention_signal';

--- ************************************************
--- *** relation: ken_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A conserved polypeptide motif that can b ***
--- *** e recognized by FZR/Cdh1-activated anaph ***
--- *** ase-promoting complex/cyclosome (APC/C)  ***
--- *** and targets a protein for ubiquitination ***
--- ***  and subsequent degradation by the APC/C ***
--- *** . The consensus sequence is KENXXXN.     ***
--- ************************************************
---

CREATE VIEW ken_box AS
  SELECT
    feature_id AS ken_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'KEN_box';

--- ************************************************
--- *** relation: mitochondrial_targeting_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the mitochondrion.            ***
--- ************************************************
---

CREATE VIEW mitochondrial_targeting_signal AS
  SELECT
    feature_id AS mitochondrial_targeting_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mitochondrial_targeting_signal';

--- ************************************************
--- *** relation: signal_anchor ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A signal sequence that is not cleaved fr ***
--- *** om the polypeptide. Anchors a Type II me ***
--- *** mbrane protein to the membrane.          ***
--- ************************************************
---

CREATE VIEW signal_anchor AS
  SELECT
    feature_id AS signal_anchor_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'signal_anchor';

--- ************************************************
--- *** relation: pip_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that mediates bindi ***
--- *** ng to PCNA. The consensus sequence is QX ***
--- *** X(hh)XX(aa), where (h) denotes residues  ***
--- *** with moderately hydrophobic side chains  ***
--- *** and (a) denotes residues with highly hyd ***
--- *** rophobic aromatic side chains.           ***
--- ************************************************
---

CREATE VIEW pip_box AS
  SELECT
    feature_id AS pip_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'PIP_box';

--- ************************************************
--- *** relation: phosphorylation_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A post-translationally modified region i ***
--- *** n which residues of the protein are modi ***
--- *** fied by phosphorylation.                 ***
--- ************************************************
---

CREATE VIEW phosphorylation_site AS
  SELECT
    feature_id AS phosphorylation_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'phosphorylation_site';

--- ************************************************
--- *** relation: transmembrane_helix ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region that traverses the lipid bilaye ***
--- *** r and adopts a helical secondary structu ***
--- *** re.                                      ***
--- ************************************************
---

CREATE VIEW transmembrane_helix AS
  SELECT
    feature_id AS transmembrane_helix_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'transmembrane_helix';

--- ************************************************
--- *** relation: vacuolar_sorting_signal ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A polypeptide region that targets a poly ***
--- *** peptide to the vacuole.                  ***
--- ************************************************
---

CREATE VIEW vacuolar_sorting_signal AS
  SELECT
    feature_id AS vacuolar_sorting_signal_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'vacuolar_sorting_signal';

--- ************************************************
--- *** relation: coding_variant_quality ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW coding_variant_quality AS
  SELECT
    feature_id AS coding_variant_quality_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'synonymous' OR cvterm.name = 'non_synonymous' OR cvterm.name = 'coding_variant_quality';

--- ************************************************
--- *** relation: synonymous ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW synonymous AS
  SELECT
    feature_id AS synonymous_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'synonymous';

--- ************************************************
--- *** relation: non_synonymous ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- ************************************************
---

CREATE VIEW non_synonymous AS
  SELECT
    feature_id AS non_synonymous_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'non_synonymous';

--- ************************************************
--- *** relation: inframe ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An attribute describing a sequence that  ***
--- *** contains a mutation involving the deleti ***
--- *** on or insertion of one or more bases, wh ***
--- *** ere this number is divisible by 3.       ***
--- ************************************************
---

CREATE VIEW inframe AS
  SELECT
    feature_id AS inframe_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inframe';

--- ************************************************
--- *** relation: protein_altering_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence_variant which is predicted to ***
--- ***  change the protein encoded in the codin ***
--- *** g sequence.                              ***
--- ************************************************
---

CREATE VIEW protein_altering_variant AS
  SELECT
    feature_id AS protein_altering_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'frameshift_variant' OR cvterm.name = 'inframe_variant' OR cvterm.name = 'frame_restoring_variant' OR cvterm.name = 'minus_1_frameshift_variant' OR cvterm.name = 'minus_2_frameshift_variant' OR cvterm.name = 'plus_1_frameshift_variant' OR cvterm.name = 'plus_2_frameshift_variant' OR cvterm.name = 'frameshift_elongation' OR cvterm.name = 'frameshift_truncation' OR cvterm.name = 'stop_lost' OR cvterm.name = 'initiator_codon_variant' OR cvterm.name = 'missense_variant' OR cvterm.name = 'stop_gained' OR cvterm.name = 'incomplete_terminal_codon_variant' OR cvterm.name = 'inframe_indel' OR cvterm.name = 'conservative_missense_variant' OR cvterm.name = 'non_conservative_missense_variant' OR cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'protein_altering_variant';

--- ************************************************
--- *** relation: synonymous_variant ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequence variant where there is no res ***
--- *** ulting change to the encoded amino acid. ***
--- ************************************************
---

CREATE VIEW synonymous_variant AS
  SELECT
    feature_id AS synonymous_variant_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'stop_retained_variant' OR cvterm.name = 'synonymous_variant';

--- ************************************************
--- *** relation: inframe_indel ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A coding sequence variant where the chan ***
--- *** ge does not alter the frame of the trans ***
--- *** cript.                                   ***
--- ************************************************
---

CREATE VIEW inframe_indel AS
  SELECT
    feature_id AS inframe_indel_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'inframe_insertion' OR cvterm.name = 'inframe_deletion' OR cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'inframe_indel';

--- ************************************************
--- *** relation: inframe_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe non synonymous variant that i ***
--- *** nserts bases into in the coding sequence ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW inframe_insertion AS
  SELECT
    feature_id AS inframe_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_inframe_insertion' OR cvterm.name = 'disruptive_inframe_insertion' OR cvterm.name = 'inframe_insertion';

--- ************************************************
--- *** relation: inframe_deletion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe non synonymous variant that d ***
--- *** eletes bases from the coding sequence.   ***
--- ************************************************
---

CREATE VIEW inframe_deletion AS
  SELECT
    feature_id AS inframe_deletion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_inframe_deletion' OR cvterm.name = 'disruptive_inframe_deletion' OR cvterm.name = 'inframe_deletion';

--- ************************************************
--- *** relation: conservative_inframe_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe increase in cds length that i ***
--- *** nserts one or more codons into the codin ***
--- *** g sequence between existing codons.      ***
--- ************************************************
---

CREATE VIEW conservative_inframe_insertion AS
  SELECT
    feature_id AS conservative_inframe_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_inframe_insertion';

--- ************************************************
--- *** relation: disruptive_inframe_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe_increase_in_cds_length that i ***
--- *** nserts one or more codons into the codin ***
--- *** g sequence within an existing codon.     ***
--- ************************************************
---

CREATE VIEW disruptive_inframe_insertion AS
  SELECT
    feature_id AS disruptive_inframe_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'disruptive_inframe_insertion';

--- ************************************************
--- *** relation: conservative_inframe_deletion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe decrease in cds length that d ***
--- *** eletes one or more entire codons from th ***
--- *** e coding sequence but does not change an ***
--- *** y remaining codons.                      ***
--- ************************************************
---

CREATE VIEW conservative_inframe_deletion AS
  SELECT
    feature_id AS conservative_inframe_deletion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'conservative_inframe_deletion';

--- ************************************************
--- *** relation: disruptive_inframe_deletion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An inframe decrease in cds length that d ***
--- *** eletes bases from the coding sequence st ***
--- *** arting within an existing codon.         ***
--- ************************************************
---

CREATE VIEW disruptive_inframe_deletion AS
  SELECT
    feature_id AS disruptive_inframe_deletion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'disruptive_inframe_deletion';

--- ************************************************
--- *** relation: mrna_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequencer read of an mRNA substrate.   ***
--- ************************************************
---

CREATE VIEW mrna_read AS
  SELECT
    feature_id AS mrna_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mRNA_read';

--- ************************************************
--- *** relation: genomic_dna_read ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A sequencer read of a genomic DNA substr ***
--- *** ate.                                     ***
--- ************************************************
---

CREATE VIEW genomic_dna_read AS
  SELECT
    feature_id AS genomic_dna_read_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'genomic_DNA_read';

--- ************************************************
--- *** relation: mrna_contig ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A contig composed of mRNA_reads.         ***
--- ************************************************
---

CREATE VIEW mrna_contig AS
  SELECT
    feature_id AS mrna_contig_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mRNA_contig';

--- ************************************************
--- *** relation: aflp_fragment ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A PCR product obtained by applying the A ***
--- *** FLP technique, based on a restriction en ***
--- *** zyme digestion of genomic DNA and an amp ***
--- *** lification of the resulting fragments.   ***
--- ************************************************
---

CREATE VIEW aflp_fragment AS
  SELECT
    feature_id AS aflp_fragment_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'AFLP_fragment';

--- ************************************************
--- *** relation: protein_hmm_match ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A match to a protein HMM such as pfam.   ***
--- ************************************************
---

CREATE VIEW protein_hmm_match AS
  SELECT
    feature_id AS protein_hmm_match_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'protein_hmm_match';

--- ************************************************
--- *** relation: immunoglobulin_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of immunoglobulin sequence, eit ***
--- *** her constant or variable.                ***
--- ************************************************
---

CREATE VIEW immunoglobulin_region AS
  SELECT
    feature_id AS immunoglobulin_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'V_region' OR cvterm.name = 'C_region' OR cvterm.name = 'immunoglobulin_region';

--- ************************************************
--- *** relation: v_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The variable region of an immunoglobulin ***
--- ***  polypeptide sequence.                   ***
--- ************************************************
---

CREATE VIEW v_region AS
  SELECT
    feature_id AS v_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'V_region';

--- ************************************************
--- *** relation: c_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The constant region of an immunoglobulin ***
--- ***  polypeptide sequence.                   ***
--- ************************************************
---

CREATE VIEW c_region AS
  SELECT
    feature_id AS c_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'C_region';

--- ************************************************
--- *** relation: n_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Extra nucleotides inserted between rearr ***
--- *** anged immunoglobulin segments.           ***
--- ************************************************
---

CREATE VIEW n_region AS
  SELECT
    feature_id AS n_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'N_region';

--- ************************************************
--- *** relation: s_region ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** The switch region of immunoglobulin heav ***
--- *** y chains; it is involved in the rearrang ***
--- *** ement of heavy chain DNA leading to the  ***
--- *** expression of a different immunoglobulin ***
--- ***  classes from the same B-cell.           ***
--- ************************************************
---

CREATE VIEW s_region AS
  SELECT
    feature_id AS s_region_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'S_region';

--- ************************************************
--- *** relation: mobile_element_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A kind of insertion where the inserted s ***
--- *** equence is a mobile element.             ***
--- ************************************************
---

CREATE VIEW mobile_element_insertion AS
  SELECT
    feature_id AS mobile_element_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mobile_element_insertion';

--- ************************************************
--- *** relation: novel_sequence_insertion ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An insertion the sequence of which canno ***
--- *** t be mapped to the reference genome.     ***
--- ************************************************
---

CREATE VIEW novel_sequence_insertion AS
  SELECT
    feature_id AS novel_sequence_insertion_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'novel_sequence_insertion';

--- ************************************************
--- *** relation: csl_response_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce GTGRGAA, bound by CSL (CBF1/RBP-JK/Su ***
--- *** ppressor of Hairless/LAG-1) transcriptio ***
--- *** n factors.                               ***
--- ************************************************
---

CREATE VIEW csl_response_element AS
  SELECT
    feature_id AS csl_response_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CSL_response_element';

--- ************************************************
--- *** relation: gata_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A GATA transcription factor element cont ***
--- *** aining the consensus sequence WGATAR (in ***
--- ***  which W indicates A/T and R indicates A ***
--- *** /G).                                     ***
--- ************************************************
---

CREATE VIEW gata_box AS
  SELECT
    feature_id AS gata_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'iron_repressed_GATA_element' OR cvterm.name = 'GATA_box';

--- ************************************************
--- *** relation: polymorphic_pseudogene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** Pseudogene owing to a SNP/DIP but in oth ***
--- *** er individuals/haplotypes/strains the ge ***
--- *** ne is translated.                        ***
--- ************************************************
---

CREATE VIEW polymorphic_pseudogene AS
  SELECT
    feature_id AS polymorphic_pseudogene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'polymorphic_pseudogene';

--- ************************************************
--- *** relation: ap_1_binding_site ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce TGACTCA, bound by AP-1 and related tr ***
--- *** anscription factors.                     ***
--- ************************************************
---

CREATE VIEW ap_1_binding_site AS
  SELECT
    feature_id AS ap_1_binding_site_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'AP_1_binding_site';

--- ************************************************
--- *** relation: cre ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce TGACGTCA; bound by the ATF/CREB famil ***
--- *** y of transcription factors.              ***
--- ************************************************
---

CREATE VIEW cre AS
  SELECT
    feature_id AS cre_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CRE';

--- ************************************************
--- *** relation: cure ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element bound by copper ion-s ***
--- *** ensing transcription factors such as S.  ***
--- *** cerevisiae Mac1p or S. pombe Cuf1; the c ***
--- *** onsensus sequence is HTHNNGCTGD (more sp ***
--- *** ecifically TTTGCKCR in budding yeast).   ***
--- ************************************************
---

CREATE VIEW cure AS
  SELECT
    feature_id AS cure_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CuRE';

--- ************************************************
--- *** relation: dre ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce CGWGGWNGMM, bound by transcription fa ***
--- *** ctors related to RecA and found in promo ***
--- *** ters of genes expressed following severa ***
--- *** l types of DNA damage or inhibition of D ***
--- *** NA synthesis.                            ***
--- ************************************************
---

CREATE VIEW dre AS
  SELECT
    feature_id AS dre_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'DRE';

--- ************************************************
--- *** relation: flex_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element that has consensus se ***
--- *** quence GTAAACAAACAAAM and contains a hep ***
--- *** tameric core GTAAACA, bound by transcrip ***
--- *** tion factors with a forkhead DNA-binding ***
--- ***  domain.                                 ***
--- ************************************************
---

CREATE VIEW flex_element AS
  SELECT
    feature_id AS flex_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'FLEX_element';

--- ************************************************
--- *** relation: forkhead_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce TTTRTTTACA, bound by transcription fa ***
--- *** ctors with a forkhead DNA-binding domain ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW forkhead_motif AS
  SELECT
    feature_id AS forkhead_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'forkhead_motif';

--- ************************************************
--- *** relation: homol_d_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A core promoter element that has the con ***
--- *** sensus sequence CAGTCACA (or its inverte ***
--- *** d form TGTGACTG), and plays the role of  ***
--- *** a TATA box in promoters that do not cont ***
--- *** ain a canonical TATA sequence.           ***
--- ************************************************
---

CREATE VIEW homol_d_box AS
  SELECT
    feature_id AS homol_d_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'homol_D_box';

--- ************************************************
--- *** relation: homol_e_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A core promoter element that has the con ***
--- *** sensus sequence ACCCTACCCT (or its inver ***
--- *** ted form AGGGTAGGGT), and is found near  ***
--- *** the homol D box in some promoters that u ***
--- *** se a homol D box instead of a canonical  ***
--- *** TATA sequence.                           ***
--- ************************************************
---

CREATE VIEW homol_e_box AS
  SELECT
    feature_id AS homol_e_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'homol_E_box';

--- ************************************************
--- *** relation: hse ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element that consists of at l ***
--- *** east three copies of the pentanucleotide ***
--- ***  NGAAN, bound by the heat shock transcri ***
--- *** ption factor HSF.                        ***
--- ************************************************
---

CREATE VIEW hse AS
  SELECT
    feature_id AS hse_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'HSE';

--- ************************************************
--- *** relation: iron_repressed_gata_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A GATA promoter element with consensus s ***
--- *** equence WGATAA, found in promoters of ge ***
--- *** nes repressed in the presence of iron.   ***
--- ************************************************
---

CREATE VIEW iron_repressed_gata_element AS
  SELECT
    feature_id AS iron_repressed_gata_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'iron_repressed_GATA_element';

--- ************************************************
--- *** relation: mating_type_m_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce ACAAT, found in promoters of mating t ***
--- *** ype M-specific genes in fission yeast an ***
--- *** d bound by the transcription factor Mat1 ***
--- *** -Mc.                                     ***
--- ************************************************
---

CREATE VIEW mating_type_m_box AS
  SELECT
    feature_id AS mating_type_m_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'mating_type_M_box';

--- ************************************************
--- *** relation: androgen_response_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A non-palindromic sequence found in the  ***
--- *** promoters of genes whose expression is r ***
--- *** egulated in response to androgen.        ***
--- ************************************************
---

CREATE VIEW androgen_response_element AS
  SELECT
    feature_id AS androgen_response_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'androgen_response_element';

--- ************************************************
--- *** relation: smfish_probe ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A smFISH is a probe that binds RNA in a  ***
--- *** single molecule in situ hybridization ex ***
--- *** periment.                                ***
--- ************************************************
---

CREATE VIEW smfish_probe AS
  SELECT
    feature_id AS smfish_probe_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'smFISH_probe';

--- ************************************************
--- *** relation: mcb ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce ACGCGT, bound by the transcription fa ***
--- *** ctor complex MBF (MCB-binding factor) an ***
--- *** d found in promoters of genes expressed  ***
--- *** during the G1/S transition of the cell c ***
--- *** ycle.                                    ***
--- ************************************************
---

CREATE VIEW mcb AS
  SELECT
    feature_id AS mcb_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'MCB';

--- ************************************************
--- *** relation: ccaat_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce CCAAT, bound by a protein complex tha ***
--- *** t represses transcription in response to ***
--- ***  low iron levels.                        ***
--- ************************************************
---

CREATE VIEW ccaat_motif AS
  SELECT
    feature_id AS ccaat_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CCAAT_motif';

--- ************************************************
--- *** relation: ace2_uas ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce CCAGCC, bound by the fungal transcrip ***
--- *** tion factor Ace2.                        ***
--- ************************************************
---

CREATE VIEW ace2_uas AS
  SELECT
    feature_id AS ace2_uas_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'Ace2_UAS';

--- ************************************************
--- *** relation: tr_box ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce TTCTTTGTTY, bound an HMG-box transcri ***
--- *** ption factor such as S. pombe Ste11, and ***
--- ***  found in promoters of genes up-regulate ***
--- *** d early in meiosis.                      ***
--- ************************************************
---

CREATE VIEW tr_box AS
  SELECT
    feature_id AS tr_box_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'TR_box';

--- ************************************************
--- *** relation: strep_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce CCCCTC, bound by the PKA-responsive z ***
--- *** inc finger transcription factor Rst2.    ***
--- ************************************************
---

CREATE VIEW strep_motif AS
  SELECT
    feature_id AS strep_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'STREP_motif';

--- ************************************************
--- *** relation: rdna_intergenic_spacer_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A DNA motif that contains a core consens ***
--- *** us sequence AGGTAAGGGTAATGCAC, is found  ***
--- *** in the intergenic regions of rDNA repeat ***
--- *** s, and is bound by an RNA polymerase I t ***
--- *** ranscription termination factor (e.g. S. ***
--- ***  pombe Reb1).                            ***
--- ************************************************
---

CREATE VIEW rdna_intergenic_spacer_element AS
  SELECT
    feature_id AS rdna_intergenic_spacer_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'rDNA_intergenic_spacer_element';

--- ************************************************
--- *** relation: sterol_regulatory_element ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A 10-bp promoter element bound by sterol ***
--- ***  regulatory element binding proteins (SR ***
--- *** EBPs), found in promoters of genes invol ***
--- *** ved in sterol metabolism. Many variants  ***
--- *** of the sequence ATCACCCCAC function as S ***
--- *** REs.                                     ***
--- ************************************************
---

CREATE VIEW sterol_regulatory_element AS
  SELECT
    feature_id AS sterol_regulatory_element_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'sterol_regulatory_element';

--- ************************************************
--- *** relation: gt_dinucleotide_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A dinucleotide repeat region composed of ***
--- ***  GT repeating elements.                  ***
--- ************************************************
---

CREATE VIEW gt_dinucleotide_repeat AS
  SELECT
    feature_id AS gt_dinucleotide_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'GT_dinucleotide_repeat';

--- ************************************************
--- *** relation: gtt_trinucleotide_repeat ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A trinucleotide repeat region composed o ***
--- *** f GTT repeating elements.                ***
--- ************************************************
---

CREATE VIEW gtt_trinucleotide_repeat AS
  SELECT
    feature_id AS gtt_trinucleotide_repeat_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'GTT_trinucleotide_repeat';

--- ************************************************
--- *** relation: sap1_recognition_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A DNA motif to which the S. pombe Sap1 p ***
--- *** rotein binds. The consensus sequence is  ***
--- *** 5'-TARGCAGNTNYAACGMG-3'; it is found at  ***
--- *** the mating type locus, where it is impor ***
--- *** tant for mating type switching, and at r ***
--- *** eplication fork barriers in rDNA repeats ***
--- *** .                                        ***
--- ************************************************
---

CREATE VIEW sap1_recognition_motif AS
  SELECT
    feature_id AS sap1_recognition_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'Sap1_recognition_motif';

--- ************************************************
--- *** relation: cdre_motif ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** An RNA polymerase II promoter element fo ***
--- *** und in the promoters of genes regulated  ***
--- *** by calcineurin. The consensus sequence i ***
--- *** s GNGGCKCA.                              ***
--- ************************************************
---

CREATE VIEW cdre_motif AS
  SELECT
    feature_id AS cdre_motif_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'CDRE_motif';

--- ************************************************
--- *** relation: bac_read_contig ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A contig of BAC reads.                   ***
--- ************************************************
---

CREATE VIEW bac_read_contig AS
  SELECT
    feature_id AS bac_read_contig_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'BAC_read_contig';

--- ************************************************
--- *** relation: candidate_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A gene suspected of being involved in th ***
--- *** e expression of a trait.                 ***
--- ************************************************
---

CREATE VIEW candidate_gene AS
  SELECT
    feature_id AS candidate_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'positional_candidate_gene' OR cvterm.name = 'functional_candidate_gene' OR cvterm.name = 'candidate_gene';

--- ************************************************
--- *** relation: positional_candidate_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A candidate gene whose association with  ***
--- *** a trait is based on the gene's location  ***
--- *** on a chromosome.                         ***
--- ************************************************
---

CREATE VIEW positional_candidate_gene AS
  SELECT
    feature_id AS positional_candidate_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'positional_candidate_gene';

--- ************************************************
--- *** relation: functional_candidate_gene ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A candidate gene whose function has some ***
--- *** thing in common biologically with the tr ***
--- *** ait under investigation.                 ***
--- ************************************************
---

CREATE VIEW functional_candidate_gene AS
  SELECT
    feature_id AS functional_candidate_gene_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'functional_candidate_gene';

--- ************************************************
--- *** relation: enhancerrna ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A short ncRNA that is transcribed from a ***
--- *** n enhancer. May have a regulatory functi ***
--- *** on.                                      ***
--- ************************************************
---

CREATE VIEW enhancerrna AS
  SELECT
    feature_id AS enhancerrna_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'enhancerRNA';

--- ************************************************
--- *** relation: pcb ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A promoter element with consensus sequen ***
--- *** ce GNAACR, bound by the transcription fa ***
--- *** ctor complex PBF (PCB-binding factor) an ***
--- *** d found in promoters of genes expressed  ***
--- *** during the M/G1 transition of the cell c ***
--- *** ycle.                                    ***
--- ************************************************
---

CREATE VIEW pcb AS
  SELECT
    feature_id AS pcb_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'PCB';

--- ************************************************
--- *** relation: rearrangement_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A region of a chromosome, where the chro ***
--- *** mosome has undergone a large structural  ***
--- *** rearrangement that altered the genome or ***
--- *** ganization. There is no longer synteny t ***
--- *** o the reference genome.                  ***
--- ************************************************
---

CREATE VIEW rearrangement_breakpoint AS
  SELECT
    feature_id AS rearrangement_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'interchromosomal_breakpoint' OR cvterm.name = 'intrachromosomal_breakpoint' OR cvterm.name = 'rearrangement_breakpoint';

--- ************************************************
--- *** relation: interchromosomal_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A rearrangement breakpoint between two d ***
--- *** ifferent chromosomes.                    ***
--- ************************************************
---

CREATE VIEW interchromosomal_breakpoint AS
  SELECT
    feature_id AS interchromosomal_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'interchromosomal_breakpoint';

--- ************************************************
--- *** relation: intrachromosomal_breakpoint ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A rearrangement breakpoint within the sa ***
--- *** me chromosome.                           ***
--- ************************************************
---

CREATE VIEW intrachromosomal_breakpoint AS
  SELECT
    feature_id AS intrachromosomal_breakpoint_id,
    feature.*
  FROM
    feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id)
  WHERE cvterm.name = 'intrachromosomal_breakpoint';

--- ************************************************
--- *** relation: unassigned_supercontig ***
--- *** relation type: VIEW                      ***
--- ***                                          ***
--- *** A supercontig that is not been assigned  ***
--- *** to any ultracontig during a genome assem ***
--- *** bly project.                             ***
--- ************************************************
---

