/***********************************************************************
 * Defines setupExplorer() method for ChromosomeExplorer
 * The file was automatically generated by aroma.affymetrix.
 * Do not edit this file!
 ***********************************************************************/

function setupExplorer(explorer) {
  /* Detected chip types */
  explorer.setChipTypes(new Array(<%=paste("'", chipTypes, "'", sep="", collapse=", ")%>));

  explorer.onSetChipType = function(chipType) {
  <% for (reporter in reporters) { %>
  <%
    colorMaps <- getColorMaps(reporter);
    verbose && cat(verbose, "Color maps: ", paste(colorMaps, collapse=", "));
    chipType <- getChipType(reporter);
    verbose && cat(verbose, "Chip type: ", chipType);
    samples <- getFullNames(setTuple);
    verbose && cat(verbose, "Samples: ", paste(samples, collapse=", "));
    aliases <- gsub(",.*", "", samples);
    verbose && cat(verbose, "Aliases: ", paste(aliases, collapse=", "));
  %>
    if (chipType == '<%=chipType%>') {
      /* Sample aliases */
      explorer.setSampleAliases(new Array(<%=paste("'", aliases, "'", sep="", collapse=", ")%>));
      /* Sample names */
      explorer.setSamples(new Array(<%=paste("'", samples, "'", sep="", collapse=", ")%>));
      /* Detected color maps */
      explorer.setColorMaps(new Array(<%=paste("'", colorMaps, "'", sep="", collapse=", ")%>));
  
      return(false);
    }
  <% } # for (reporter ...) %>
 
    alert('Error in explorer.onChipType(). Unknown chipType: ' + chipType);
  
    return(false);
  } // onSetChipType()

  return(false);
}
