<commit_before><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="mm"%>
<%@ taglib uri="http://flymine.org/imutil" prefix="imutil"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1"
    prefix="str"%>

<!-- experiment.jsp -->

<html:xhtml />
<script type="text/javascript" src="<html:rewrite page='/js/jquery.qtip-1.0.0-rc3.min.js'/>"></script>
<script type="text/javascript" src="js/tablesort.js"></script>
<link rel="stylesheet" type="text/css" href="css/sorting_experiments.css"/>
<link rel="stylesheet" type="text/css" href="model/css/experiment.css"/>

<tiles:importAttribute />

<div class="body">

<%-- EXPERIMENT --%>

<c:forEach items="${experiments}" var="exp"  varStatus="status">
<%-- for gbrowse: to modify and take the organism from the submission --%>
<c:set var="ncbiftp" value="ftp://ftp.ncbi.nlm.nih.gov"/>
<c:set var="isPrimer" value="primer"/>
<c:set var="wormTracksCounter" value="0"/>
<c:set var="flyTracksCounter" value="0"/>
<c:set var="project" value="${exp.piSurname}"/>
<c:set var="proGFF" value="PianoWaterstonCelniker"/>

  <im:boxarea title="${exp.name}" stylename="gradientbox">

  <table cellpadding="0" cellspacing="0" border="0" class="dbsources">
  <tr>

  <td>
    <c:forEach items="${exp.organisms}" var="organism" varStatus="orgStatus">
      <c:if test="${organism eq 'D. melanogaster'}">
        <img border="0" class="arrow" src="model/images/f_vvs.png" title="fly"/>
            <c:set var="fly" value="1" />
          </c:if>
      <c:if test="${organism eq 'C. elegans'}">
        <img border="0" class="arrow" src="model/images/w_vvs.png" title="worm"/>
            <c:set var="worm" value="1" />
          </c:if>
    </c:forEach>
  </td>

  <td>experiment: <b><c:out value="${exp.name}"/></b></td>
  <td>project: <b><c:out value="${exp.projectName}"></c:out></b></td>
  <td>PI: <b><c:out value="${exp.pi}"></c:out></b></td>
  <td>Labs:
<%-- Note: linking with surname only, 2 Green and Kim  --%>
<%-- whole foreach on one line to avoid spaces before commas --%>
    <c:forEach items="${exp.labs}" var="lab" varStatus="labStatus"><c:if test="${!labStatus.first}">, </c:if><b><html:link href="/${WEB_PROPERTIES['webapp.path']}/portal.do?externalid=*${lab}&class=Lab" title="more info on ${lab}'s lab">${lab}</html:link></b></c:forEach>
  </td>

  </tr>


  <tr>
  <td colspan="5"><c:out value="${exp.description}"></c:out></td>
  </tr>
  </table>

<%-- EXPERIMENT FEATURES --%>
  <c:if test="${! empty exp.featureCountsRecords || !empty tracks[exp.name]}">
  <div id="experimentFeatures">

  <br/>
     <table>
     <tr>
     <td style="width: 45%" align="top">
      <c:choose>
      <c:when test="${!empty exp.featureCountsRecords}">

All features generated by this experiment:

      <table cellpadding="0" cellspacing="0" border="0" class="dbsources">
      <tr>
        <th colspan="3">Feature</th>
        <th colspan="4">Export</th>
      </tr>

      <c:forEach items="${exp.featureCountsRecords}" var="fc" varStatus="status">
          <tr>
            <td><b>${fc.featureType}</b></td>
            <td>
<c:forEach items="${expFeatDescription}" var="fdes" varStatus="fdes_status">
<c:if test="${fn:substringBefore(fdes.key, '+') == exp.name && fn:substringAfter(fdes.key, '+') == fc.featureType}">
<img src="model/images/def_s.png" title="${fdes.value }" />
            </c:if>
</c:forEach>

</td>
            <td align="right">
              <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=results&experiment=${exp.name}&feature=${fc.featureType}"
        title="View all ${fc.featureType}s">${fc.featureCounts}
              <html:img src="images/right-arrow.gif" title="View all ${fc.featureType}s" /></html:link>

<%--TODO find icon for expression levels --%>

<c:forEach items="${expFeatEL}" var="expEL" varStatus="expEL_status">
  <c:if test="${expEL.key == exp.name}" >
  <c:forEach items="${expEL.value}" var="expELF" varStatus="expELF_status">
    <c:if test="${expELF.key == fc.featureType}" >
Expression Levels

  <html:link
    href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=expEL&action=results&experiment=${exp.name}&feature=${fc.featureType}"
        title="View all expression levels for these ${fc.featureType}s">${expELF.value}
              <html:img src="images/right-arrow.gif" title="View all expression levels for these ${fc.featureType}s" /></html:link>

    </c:if>
  </c:forEach>
  </c:if>
</c:forEach>

      <c:if test="${!empty fc.uniqueFeatureCounts && fc.uniqueFeatureCounts != fc.featureCounts}">
      <br>
      This represents ${fc.uniqueFeatureCounts} unique ${fc.featureType}s
      </c:if>
            </td>

            <td align="center">
               <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=export&experiment=${exp.name}&feature=${fc.featureType}&format=tab"
        title="Download in tab separated value format">TAB</html:link>

            </td>
            <td align="center">
              <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=export&experiment=${exp.name}&feature=${fc.featureType}&format=csv"
        title="Download in comma separated value format">CSV</html:link>

            </td>

       <%--     <c:if test="${!empty exp.unlocated }"> --%>
<c:choose>
<c:when test="${!empty exp.unlocated && fn:contains(exp.unlocated, fc.featureType)}"><commit_msg>Unique experiment feature count - changed font size<commit_after><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html"%>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="im"%>
<%@ taglib tagdir="/WEB-INF/tags" prefix="mm"%>
<%@ taglib uri="http://flymine.org/imutil" prefix="imutil"%>
<%@ taglib uri="http://jakarta.apache.org/taglibs/string-1.1"
    prefix="str"%>

<!-- experiment.jsp -->

<html:xhtml />
<script type="text/javascript" src="<html:rewrite page='/js/jquery.qtip-1.0.0-rc3.min.js'/>"></script>
<script type="text/javascript" src="js/tablesort.js"></script>
<link rel="stylesheet" type="text/css" href="css/sorting_experiments.css"/>
<link rel="stylesheet" type="text/css" href="model/css/experiment.css"/>

<tiles:importAttribute />

<div class="body">

<%-- EXPERIMENT --%>

<c:forEach items="${experiments}" var="exp"  varStatus="status">
<%-- for gbrowse: to modify and take the organism from the submission --%>
<c:set var="ncbiftp" value="ftp://ftp.ncbi.nlm.nih.gov"/>
<c:set var="isPrimer" value="primer"/>
<c:set var="wormTracksCounter" value="0"/>
<c:set var="flyTracksCounter" value="0"/>
<c:set var="project" value="${exp.piSurname}"/>
<c:set var="proGFF" value="PianoWaterstonCelniker"/>

  <im:boxarea title="${exp.name}" stylename="gradientbox">

  <table cellpadding="0" cellspacing="0" border="0" class="dbsources">
  <tr>

  <td>
    <c:forEach items="${exp.organisms}" var="organism" varStatus="orgStatus">
      <c:if test="${organism eq 'D. melanogaster'}">
        <img border="0" class="arrow" src="model/images/f_vvs.png" title="fly"/>
            <c:set var="fly" value="1" />
          </c:if>
      <c:if test="${organism eq 'C. elegans'}">
        <img border="0" class="arrow" src="model/images/w_vvs.png" title="worm"/>
            <c:set var="worm" value="1" />
          </c:if>
    </c:forEach>
  </td>

  <td>experiment: <b><c:out value="${exp.name}"/></b></td>
  <td>project: <b><c:out value="${exp.projectName}"></c:out></b></td>
  <td>PI: <b><c:out value="${exp.pi}"></c:out></b></td>
  <td>Labs:
<%-- Note: linking with surname only, 2 Green and Kim  --%>
<%-- whole foreach on one line to avoid spaces before commas --%>
    <c:forEach items="${exp.labs}" var="lab" varStatus="labStatus"><c:if test="${!labStatus.first}">, </c:if><b><html:link href="/${WEB_PROPERTIES['webapp.path']}/portal.do?externalid=*${lab}&class=Lab" title="more info on ${lab}'s lab">${lab}</html:link></b></c:forEach>
  </td>

  </tr>


  <tr>
  <td colspan="5"><c:out value="${exp.description}"></c:out></td>
  </tr>
  </table>

<%-- EXPERIMENT FEATURES --%>
  <c:if test="${! empty exp.featureCountsRecords || !empty tracks[exp.name]}">
  <div id="experimentFeatures">

  <br/>
     <table>
     <tr>
     <td style="width: 45%" align="top">
      <c:choose>
      <c:when test="${!empty exp.featureCountsRecords}">

All features generated by this experiment:

      <table cellpadding="0" cellspacing="0" border="0" class="dbsources">
      <tr>
        <th colspan="3">Feature</th>
        <th colspan="4">Export</th>
      </tr>

      <c:forEach items="${exp.featureCountsRecords}" var="fc" varStatus="status">
          <tr>
            <td><b>${fc.featureType}</b></td>
            <td>
<c:forEach items="${expFeatDescription}" var="fdes" varStatus="fdes_status">
<c:if test="${fn:substringBefore(fdes.key, '+') == exp.name && fn:substringAfter(fdes.key, '+') == fc.featureType}">
<img src="model/images/def_s.png" title="${fdes.value }" />
            </c:if>
</c:forEach>

</td>
            <td align="right">
              <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=results&experiment=${exp.name}&feature=${fc.featureType}"
        title="View all ${fc.featureType}s">${fc.featureCounts}
              <html:img src="images/right-arrow.gif" title="View all ${fc.featureType}s" /></html:link>

<%--TODO find icon for expression levels --%>

<c:forEach items="${expFeatEL}" var="expEL" varStatus="expEL_status">
  <c:if test="${expEL.key == exp.name}" >
  <c:forEach items="${expEL.value}" var="expELF" varStatus="expELF_status">
    <c:if test="${expELF.key == fc.featureType}" >
Expression Levels

  <html:link
    href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=expEL&action=results&experiment=${exp.name}&feature=${fc.featureType}"
        title="View all expression levels for these ${fc.featureType}s">${expELF.value}
              <html:img src="images/right-arrow.gif" title="View all expression levels for these ${fc.featureType}s" /></html:link>

    </c:if>
  </c:forEach>
  </c:if>
</c:forEach>

      <c:if test="${!empty fc.uniqueFeatureCounts && fc.uniqueFeatureCounts != fc.featureCounts}">
      <br>
      <i style="font-size:0.9em;">
      This represents ${fc.uniqueFeatureCounts} unique ${fc.featureType}s
      </i>
      </c:if>
            </td>

            <td align="center">
               <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=export&experiment=${exp.name}&feature=${fc.featureType}&format=tab"
        title="Download in tab separated value format">TAB</html:link>

            </td>
            <td align="center">
              <html:link
        href="/${WEB_PROPERTIES['webapp.path']}/features.do?type=experiment&action=export&experiment=${exp.name}&feature=${fc.featureType}&format=csv"
        title="Download in comma separated value format">CSV</html:link>

            </td>

       <%--     <c:if test="${!empty exp.unlocated }"> --%>
<c:choose>
<c:when test="${!empty exp.unlocated && fn:contains(exp.unlocated, fc.featureType)}">
{'fraction_non_alphanumeric': 0.22404043865661413, 'fraction_numerical': 0.004283755997258396, 'mean_word_length': 3.9820742637644044, 'pattern_counts': {'":': 0, '<': 289, '<?xml version=': 0, '>': 289, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4664708', 'n_tokens_mistral': 4276, 'n_tokens_neox': 4138, 'n_words': 682}