   end
 
   def groups(species) do
-
     subq =
       case use_type(species) do
         { :integer, i } -> "Species.id = #{i}"

  def group_info(group) do
    subq =
      case use_type(group) do
        { :integer, i } -> "InbredSet.id = #{i}"
        { :string, s }  -> "InbredSet.Name = '#{s}'"
      end
    query = "
SELECT DISTINCT Species.speciesid,Species.Name,InbredSet.InbredSetid,InbredSet.name,InbredSet.mappingmethodid,InbredSet.genetictype
FROM Species, InbredSet
WHERE #{subq} and InbredSet.SpeciesId = Species.Id"
    {:ok, rows} = DB.query(query)
    for r <- rows, do: ( {species_id,species,group_id,group_name,method_id,genetic_type} = r; [group_id,group_name,species_id,species,method_id,genetic_type] )
  end

  def dataset_info(dataset_name) do

    for r <- rows, do: ( {id,name,full_name,short_name,data_scale,tissue_id,tissue_name,public,confidential} = r; [id,name,full_name,short_name,data_scale,tissue_id,tissue_name,public,confidential] )
  end


  def menu_species do
    {:ok, rows} = DB.query("SELECT speciesid,name,menuname FROM Species")
