Chado query HOWTO: FBgn -> FBal

A forum for discussing Power User related features of FlyBase such as using Chado, GFF, FASTA files, etc...

Chado query HOWTO: FBgn -> FBal

Postby Josh Goodman » Wed Feb 23, 2011 4:06 pm

This query returns a 6 column list containing the current values of the gene ID and symbol, the corresponding allele ID and symbol, and the genus and species. Instructions for connecting to our public Chado database can be found here.

Code: Select all
select g.uniquename as FBgn, as gsym,
       a.uniquename as FBal, as asym,
       o.genus, o.species
       from feature g left join feature_relationship fr on (g.feature_id=fr.object_id)
                      left join feature a on (fr.subject_id=a.feature_id)
                      left join cvterm cvt on (fr.type_id=cvt.cvterm_id)
                      left join organism o on (g.organism_id=o.organism_id)
       where g.uniquename ~ '^FBgn[0-9]+$'
          and g.is_obsolete=false
          and g.is_analysis=false
          and a.uniquename ~ '^FBal[0-9]+$'
          and a.is_obsolete=false
          and a.is_analysis=false
Josh Goodman
Site Admin
Posts: 64
Joined: Mon Nov 26, 2007 2:39 pm

Return to Power Users