Skip to content

Commit

Permalink
Merge branch 'ZFIN:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
rtaylorzfin authored Apr 18, 2023
2 parents bfc5abd + 6db2f9c commit 82a8e82
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 9 deletions.
3 changes: 2 additions & 1 deletion home/WEB-INF/jsp/ontology/term-view.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,12 @@
<c:set var="GENES_INVOLVED" value="${NavigationMenuOptions.GENES_INVOLVED.value}"/>
<c:set var="ZEBRAFISH_MODELS" value="${NavigationMenuOptions.ZEBRAFISH_MODELS.value}"/>
<c:set var="EXPRESSION" value="${NavigationMenuOptions.EXPRESSION.value}"/>
<c:set var="OTHER_PAGES" value="${NavigationMenuOptions.OTHER_PAGE.value}"/>
<c:set var="CITATIONS" value="${NavigationMenuOptions.CITATION.value}"/>

<c:set var="secs"/>

<z:dataPage sections="${[]}" navigationMenu="${navigationMenu}">
<z:dataPage sections="${[]}" navigationMenu="${navigationMenu}" additionalBodyClass="term-view nav-title-wrap-break-word">

<jsp:attribute name="entityName">
${term.termName}
Expand Down
7 changes: 7 additions & 0 deletions home/css/datapage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,13 @@ table.lab-view-summary-table dd a, table.company-view-summary-table dd a {
word-break: break-all; /* <-- remove for ellipses truncation */
}

/* Wrap the page title as it appears in the left navigation menu and break on word separators */
.nav-title-wrap-break-word a.back-to-top-link {
display: inline;
white-space: normal;
word-break: break-word;
}

/* Set margin for figure component on publication view page */
.publication-view #xpresimg_control_box {
margin-top: 20px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,11 @@ const ChebiModifiedPhenotypeTable = ({termId, directAnnotationOnly, endpointUrl
},
{
label: 'Term',
content: ({term}) => <a href={'/' + term.zdbID}>{term.termName}</a>,
content: ({allChebiTerms}) => <CommaSeparatedList>
{allChebiTerms.map(term => {
return <a href={'/' + term.zdbID} key={Math.random()}>{term.termName}</a>
})}
</CommaSeparatedList>,
filterName: 'termName',
width: '120px',
},
Expand Down
6 changes: 5 additions & 1 deletion home/javascript/react/containers/ChebiPhenotypeTable.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ const ChebiPhenotypeTable = ({termId, directAnnotationOnly, endpointUrl = 'pheno
},
{
label: 'Term',
content: ({term}) => <a href={'/' + term.zdbID}>{term.termName}</a>,
content: ({allChebiTerms}) => <CommaSeparatedList>
{allChebiTerms.map(term => {
return <a href={'/' + term.zdbID} key={Math.random()}>{term.termName}</a>
})}
</CommaSeparatedList>,
filterName: 'termName',
width: '120px',
},
Expand Down
4 changes: 4 additions & 0 deletions source/org/zfin/db/postGmakePostloaddb/1143/ZFIN-8504.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
--liquibase formatted sql
--changeset cmpich:ZFIN-8504.sql

alter table UI.CHEBI_PHENOTYPE_DISPLAY add COLUMN cpd_exp_condition_chebi_search text;
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<include file="source/org/zfin/db/postGmakePostloaddb/1143/ZFIN-8519.sql" />
<include file="source/org/zfin/db/postGmakePostloaddb/1143/ZFIN-8520.sql" />
<include file="source/org/zfin/db/postGmakePostloaddb/1143/ZFIN-8531-construct-relationship.sql" />
<include file="source/org/zfin/db/postGmakePostloaddb/1143/ZFIN-8504.sql" />


</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

import lombok.Getter;
import lombok.Setter;
import org.zfin.framework.featureflag.FeatureFlagEnum;

import static org.zfin.framework.featureflag.FeatureFlags.isFlagEnabled;

@Getter
@Setter
Expand All @@ -16,9 +19,11 @@ public DiseaseNavigationMenu() {
super(
title(NavigationMenuOptions.SUMMARY).showCount(false),
title(NavigationMenuOptions.RELATIONSHIPS).showCount(false),
title(NavigationMenuOptions.OTHER_PAGE).showCount(false),
title(NavigationMenuOptions.GENES_INVOLVED).showCount(false),
title(NavigationMenuOptions.ZEBRAFISH_MODELS).showCount(false),
title(NavigationMenuOptions.ALLELE).showCount(false)
isFlagEnabled(FeatureFlagEnum.SHOW_ALLIANCE_DATA) ?
title(NavigationMenuOptions.ALLELE).showCount(false) : null
);
}

Expand Down
6 changes: 4 additions & 2 deletions source/org/zfin/framework/presentation/NavigationMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Stream;

/**
Expand All @@ -22,14 +23,15 @@ public class NavigationMenu {

public NavigationMenu(NavigationItem.NavigationItemBuilder ...navigationItemBuilders) {
this.navigationItems = Stream.of(navigationItemBuilders)
.filter(Objects::nonNull)
.map(NavigationItem.NavigationItemBuilder::build)
.toList();
}

/**
* Set the hidden attribute for the NavigationItem in this menu matching the given title
* @param title
* @param value
* @param title title of the item we are looking for (enum)
* @param value true if the item should be hidden
*/
public void setHidden(NavigationMenuOptions title, boolean value) {
for(NavigationItem item : navigationItems) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ public enum NavigationMenuOptions {
EFGs("Engineered Foreign Genes"),
ERRATA("Errata / Notes"),
EXPRESSION("Expression"),
OTHER_PAGE("Other Pages"),
FIGURES("Figures"),
FISH("Fish"),
GENES("Genes / Markers"),
Expand Down
6 changes: 6 additions & 0 deletions source/org/zfin/indexer/TermPageIndexer.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public class TermPageIndexer {
public static void main(String[] args) throws NoSuchFieldException {
TermPageIndexer indexer = new TermPageIndexer();
indexer.init();

indexer.publicationExpressions();
indexer.runFishModels();
indexer.runGenesInvolved();
Expand Down Expand Up @@ -227,6 +228,11 @@ private void runChebiPhenotype() throws NoSuchFieldException {
display.setPhenotypeStatementSearch(phenotypeStatementWarehouses.stream().map(PhenotypeStatementWarehouse::getDisplayName).collect(Collectors.joining("|")));
display.setGeneSymbolSearch(fish.getAffectedGenes().stream().map(Marker::getAbbreviation).sorted().collect(Collectors.joining("|")));
display.setConditionSearch(experiment.getDisplayAllConditions());
display.setExpConditionChebiSearch(experiment.getExperimentConditions().stream()
.filter(experimentCondition -> experimentCondition.getChebiTerm() != null)
.map(ExperimentCondition::getChebiTerm)
.map(GenericTerm::getTermName)
.collect(Collectors.joining("|")));
HibernateUtil.currentSession().save(display);
});
}));
Expand Down
22 changes: 22 additions & 0 deletions source/org/zfin/mutant/presentation/ChebiPhenotypeDisplay.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import lombok.Getter;
import lombok.Setter;
import org.zfin.expression.Experiment;
import org.zfin.expression.ExperimentCondition;
import org.zfin.expression.Figure;
import org.zfin.framework.api.View;
import org.zfin.mutant.Fish;
Expand All @@ -13,6 +14,8 @@

import javax.persistence.*;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

/**
* class to retrieve chebi term page - phenotype
Expand Down Expand Up @@ -85,6 +88,10 @@ public class ChebiPhenotypeDisplay {
@Column(name = "cpd_ameliorated_exacerbated_phenotype_search")
private String amelioratedExacerbatedPhenoSearch;

@JsonView(View.API.class)
@Column(name = "cpd_exp_condition_chebi_search")
private String expConditionChebiSearch;

@Transient
private boolean includeSubstructures;

Expand All @@ -100,4 +107,19 @@ public Fish getFish() {
return fish;
}

@JsonView(View.API.class)
public Set<GenericTerm> getAllChebiTerms() {
Set<GenericTerm> allTerms = new TreeSet<>();
allTerms.add(term);
allTerms.addAll(experiment.getExperimentConditions()
.stream()
.filter(experimentCondition -> experimentCondition.getChebiTerm() != null)
.map(ExperimentCondition::getChebiTerm)
.sorted()
.toList());
return allTerms;
}

public void setAllChebiTerms(Set<GenericTerm> terms) {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1885,9 +1885,10 @@ public Fish getFishByGenoStr(Fish fish) {
Query<Fish> query = session.createQuery(hql, Fish.class);
query.setParameter("genotype", fish.getGenotype());
if (strsAvailable) {
query.setParameter("numberOfStrs", fish.getStrList().size());
Long numberOfStrs = Long.valueOf(fish.getStrList().size());
query.setParameter("numberOfStrs", numberOfStrs);
} else {
query.setParameter("numberOfStrs", 0);
query.setParameter("numberOfStrs", 0L);
}
if (strsAvailable) {
int index = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ protected String termDetailPagePrototype(@PathVariable String termID,
boolean isChebi = term.getOntology().equals(Ontology.CHEBI);
model.addAttribute("isChebiTerm", isChebi);
model.addAttribute("showPhenotypeSection", !term.getOntology().equals(Ontology.ECO));
form.setAgrDiseaseLinks(OntologyService.getAGRLinks(term));

NavigationMenu menu = new DefaultTermNavigationMenu();
if (isChebi) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ public JsonResultResponse<ChebiPhenotypeDisplay> getPhenotypeChebi(@PathVariable
pagination.addToFilterMap("chebiPhenotype.phenotypeStatementSearch", filterPhenotype);
}
if (StringUtils.isNotEmpty(filterTermName)) {
pagination.addToFilterMap("chebiPhenotype.term.termName", filterTermName);
pagination.addToFilterMap("chebiPhenotype.expConditionChebiSearch", filterTermName);
}

PaginationResult<ChebiPhenotypeDisplay> genesInvolvedForDiseaseDirect = getDiseasePageRepository().getPhenotypeChebi(term, pagination, false);
Expand Down

0 comments on commit 82a8e82

Please sign in to comment.