%==============================================================================
%    fill_phenotypes.m
%    Copyright (C) 2007  Amoolya H. Singh, singh@embl.de
%
%    This program is free software: you can redistribute it and/or modify
%    it under the terms of the GNU General Public License as published by
%    the Free Software Foundation, either version 3 of the License, or
%    (at your option) any later version.
%
%    This program is distributed in the hope that it will be useful,
%    but WITHOUT ANY WARRANTY; without even the implied warranty of
%    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
%    GNU General Public License for more details.
%
%    You should have received a copy of the GNU General Public License
%    along with this program.  If not, see <http://www.gnu.org/licenses/>.
%===============================================================================
function phenotypes = fill_phenotypes(species)
%------------------------------------------------------------------------------
%
% phenotypes = fill_phenotypes(species) fills out the phenotype vector
% 'n' to fill out the phenotype vector
%
% Input: 
%   species, vector of 'y', 'f', and 'n' indicating whether a
%            species has the phenotype, doesn't have it, or has a
%            facultative/variant of the phenotype
% Output:
%   phenotypes, binary vector indicating the same
%
%------------------------------------------------------------------------------

phenotypes = [];
for i=1:length(species)
  if ((char(species(i))=='y')|(char(species(i))=='f'))
    phenotypes(i)=1;
  else
    phenotypes(i)=0;
  end
end

