<commit_before>import React from "react";
import ClosestOrtholog from "./closestOrtholog.jsx";

const ResultBody = (props) =>
        <div className="result-gene-summary">
          <div className="result-gene-title-body">
               {renderTitle(props)}
               {renderBody(props)}
          </div>
             {renderMetadata(props)}
        </div>
    ;

function renderMetadata(props) {
  return renderTairSummary(props)
      || renderClosestOrtholog(props);
}

function renderTitle({searchResult}) {
  let species, geneId, synonyms;

  if (searchResult.species_name) {
    species = <span className="species-name">{searchResult.species_name}</span>;
  }
  if (searchResult.id !== searchResult.name) {
    geneId = <span className="gene-id">{searchResult.id}</span>;
  }
  if (searchResult.synonyms) {
    // synonyms = searchResult.synonyms.filter(syn => syn !== searchResult.description).join(' ');
    synonyms = searchResult.synonyms.filter(syn => /^GRMZM/.test(syn)).join(' ');
  }
  return (
      <h3 className="gene-title">
        <span className="gene-name">{searchResult.name} </span>
        <wbr/>
        <small className="gene-id">{geneId} </small>
        <small className="gene-synonyms">{synonyms}</small>
        <small className="gene-species"> {species}</small>
      </h3>
  );
}

function renderBody({searchResult}) {
  return (
      <p className="gene-description">{searchResult.description}</p>
  );
}

function renderTairSummary({searchResult}) {
  const summary = searchResult.summary;<commit_msg>put link to ensembl species page on species name<commit_after>import React from "react";
import ClosestOrtholog from "./closestOrtholog.jsx";
var ensemblURL = require('../../../package.json').gramene.ensemblURL;

const ResultBody = (props) =>
        <div className="result-gene-summary">
          <div className="result-gene-title-body">
               {renderTitle(props)}
               {renderBody(props)}
          </div>
             {renderMetadata(props)}
        </div>
    ;

function renderMetadata(props) {
  return renderTairSummary(props)
      || renderClosestOrtholog(props);
}

function renderTitle({searchResult}) {
  let species, geneId, synonyms;

  if (searchResult.species_name) {
    species = <span className="species-name">{searchResult.species_name}</span>;
  }
  if (searchResult.id !== searchResult.name) {
    geneId = <span className="gene-id">{searchResult.id}</span>;
  }
  if (searchResult.synonyms) {
    // synonyms = searchResult.synonyms.filter(syn => syn !== searchResult.description).join(' ');
    synonyms = searchResult.synonyms.filter(syn => /^GRMZM/.test(syn)).join(' ');
  }
  return (
      <h3 className="gene-title">
        <span className="gene-name">{searchResult.name} </span>
        <wbr/>
        <small className="gene-id">{geneId} </small>
        <small className="gene-synonyms">{synonyms}</small>
        <small className="gene-species"> <a href={`//${ensemblURL}/${searchResult.system_name}/Info/Index`}>{species}</a></small>
      </h3>
  );
}

function renderBody({searchResult}) {
  return (
      <p className="gene-description">{searchResult.description}</p>
  );
}

function renderTairSummary({searchResult}) {
  const summary = searchResult.summary;
{'fraction_non_alphanumeric': 0.16257668711656442, 'fraction_numerical': 0.001226993865030675, 'mean_word_length': 3.424694708276798, 'pattern_counts': {'":': 0, '<': 47, '<?xml version=': 0, '>': 53, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '118872', 'n_tokens_mistral': 1041, 'n_tokens_neox': 1007, 'n_words': 165}