Skip to content

Commit

Permalink
Merge branch 'release-1.5'
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobsonMT committed Apr 24, 2018
2 parents c32cb19 + 3eb6cae commit 2900abb
Show file tree
Hide file tree
Showing 7 changed files with 65 additions and 28 deletions.
2 changes: 1 addition & 1 deletion gotrack/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<groupId>ubc.pavlab</groupId>
<artifactId>gotrack</artifactId>
<packaging>war</packaging>
<version>1.4</version>
<version>1.5</version>
<name>gotrack</name>
<url>http://maven.apache.org</url>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -896,6 +896,8 @@ public void removeAllGenes() {
if ( selectGenes != null ) {
selectGenes.clear();
}
bulkQuery = "";
queryGene = null;
}

/**
Expand Down
37 changes: 30 additions & 7 deletions gotrack/src/main/java/ubc/pavlab/gotrack/beans/GeneView.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@

package ubc.pavlab.gotrack.beans;

import com.google.common.collect.*;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.google.gson.Gson;
import lombok.Getter;
import lombok.Setter;
Expand Down Expand Up @@ -277,6 +280,20 @@ public void fetchData() {
// retrieve data
annotationData = fetchAnnotationData();

// Prune inferred root terms
Set<GeneOntologyTerm> rootGOTerms = Sets.newHashSet( "GO:0003674", "GO:0008150", "GO:0005575" ).stream()
.map( s -> cache.getCurrentTerm( s ) )
.collect( Collectors.toSet() );

annotationData.values().forEach( editionData -> {
for ( GeneOntologyTerm term : rootGOTerms ) {
Set<FullAnnotation> annotations = editionData.get( term );
if ( annotations != null && annotations.stream().noneMatch( FullAnnotation::isDirect ) ) {
editionData.remove( term );
}
}
} );

// A map that will be needed in the front end for drilling down
Map<Long, Integer> dateToEdition = new HashMap<>();

Expand Down Expand Up @@ -542,17 +559,23 @@ public void fetchTimeline() {

for ( Edition ed : allEditions ) {

Map<String, Long> categoryCounts = Maps.newHashMap();

Map<GeneOntologyTerm, Set<FullAnnotation>> editionData = annotationData.get( ed );

Stream<Entry<GeneOntologyTerm, Set<FullAnnotation>>> dataStream = editionData.entrySet().stream();
if (editionData != null) {
Stream<Entry<GeneOntologyTerm, Set<FullAnnotation>>> dataStream = editionData.entrySet().stream();

if ( !filterTerms.isEmpty() ) {
dataStream = dataStream.filter( e -> filterTerms.contains( e.getKey() ) );
}

// Group by annotation.evidence.category
categoryCounts = dataStream.flatMap( e -> e.getValue().stream() )
.collect( Collectors.groupingBy( o -> o.getAnnotation().getEvidence().getCategory(), Collectors.counting() ) );

if ( !filterTerms.isEmpty() ) {
dataStream = dataStream.filter( e -> filterTerms.contains( e.getKey() ) );
}

// Group by annotation.evidence.category
Map<String, Long> categoryCounts = dataStream.flatMap( e -> e.getValue().stream() )
.collect( Collectors.groupingBy( o -> o.getAnnotation().getEvidence().getCategory(), Collectors.counting() ) );
for (String category : cache.getEvidenceCategories().keySet() ) {
seriesMap.computeIfAbsent( category, Series::new ).addDataPoint( ed.getDate(), categoryCounts.getOrDefault( category, 0L ) );
}
Expand Down
39 changes: 22 additions & 17 deletions gotrack/src/main/webapp/about.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,13 @@

.section {
margin-bottom: 40px;
width: 80%;
max-width: 1000px;
/*width: 80%;*/
/*max-width: 1000px;*/
}

.section-separator {
height: 1px;
max-width: 150px;
}
</h:outputStylesheet>

Expand Down Expand Up @@ -76,21 +81,21 @@
</div>
</div>

<div id="content-wrapper" class="center" style="width:100%; max-width:1600px; min-width:900px;">
<div id="content-wrapper" class="center" style="width:100%; max-width:1000px; min-width:900px;">

<p:outputPanel styleClass="text-left">
<p:outputPanel>

<h:form id="titleForm">
<div class="page-title">
<h1>About GOTrack</h1>
</div>
</h:form>
<p:separator style="max-width:400px; margin-bottom:25px;"/>
<p:separator style="max-width:400px; margin-bottom:45px;"/>


<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">Citing</h2>
<p:separator style="max-width:150px; margin:0;"/>
<p:separator class="section-separator"/>
</div>

<div class="section">
Expand All @@ -102,9 +107,9 @@
</p>
</div>

<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">Contact</h2>
<p:separator style="max-width:150px; margin:0;"/>
<p:separator class="section-separator"/>
</div>

<div class="section">
Expand All @@ -114,9 +119,9 @@
</p>
</div>

<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">License</h2>
<p:separator style="max-width:150px; margin:0;"/>
<p:separator class="section-separator"/>
</div>

<div class="section">
Expand All @@ -131,16 +136,16 @@
<p>Fork it on <a href="https://github.com/PavlidisLab/gotrack">Github</a></p>
</div>

<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">Disclaimer</h2>
<p:separator style="max-width:150px; margin:0;"/>
<p:separator class="section-separator"/>
</div>
<div class="section">
<p>Use at your own risk. GOTrack is provided "AS-IS" without any warranty, expressed or implied.</p>
</div>
<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">Credits and acknowledgments</h2>
<p:separator style="max-width:250px; margin:0;"/>
<p:separator class="section-separator" style="max-width:250px;"/>
</div>
<div class="section">
<p>
Expand All @@ -157,9 +162,9 @@
</p>
</div>

<div class="text-left section-title">
<div class="section-title">
<h2 style="margin-bottom: 5px;">Financial support</h2>
<p:separator style="max-width:150px; margin:0;"/>
<p:separator class="section-separator"/>
</div>
<div class="section">
<div style="display: inline-block;position: relative;height:120px;width:150px;">
Expand Down
2 changes: 1 addition & 1 deletion gotrack/src/main/webapp/enrichment.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@
oncomplete="PF('addMultipleGenesDlg').show()"/>
<p:commandButton icon="fa fa-trash" value="Clear"
action="#{enrichmentView.removeAllGenes()}"
update=":formSelect:geneList :formSelect:runEnrichmentBtn"/>
update=":formSelect:geneList :formSelect:runEnrichmentBtn :formAddGenes"/>
</f:facet>
</p:dataList>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<composite:implementation>
<p:dataTable id="enrichmentTable" widgetVar="tableEnrichmentWdg"
var="entry" value="#{cc.attrs.value}"
sortMode="multiple" style="margin-bottom:0;max-height: 225px;"
sortMode="multiple" style="margin-bottom:0;"
emptyMessage="No enrichment data found for selected edition"
filteredValue="#{cc.attrs.filteredValue}"
rowStyleClass="#{entry.result.significant == true ? 'significant' : 'not-significant'}"
Expand All @@ -33,6 +33,7 @@
rowKey="#{entry.term.goId}"
liveScroll="true"
scrollRows="25"
scrollHeight="225"
resizableColumns="true">
<p:ajax event="filter"
oncomplete="postAjaxSortTable(PF('tableEnrichmentWdg'))"/>
Expand Down
8 changes: 7 additions & 1 deletion gotrack/src/main/webapp/resources/composites/geneTable.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,13 @@

<composite:implementation>

<p:dataTable var="gene" value="#{cc.attrs.value}" emptyMessage="No genes found." style="width:100%;max-height: 200px;" scrollable="true" scrollRows="25">
<p:dataTable var="gene"
value="#{cc.attrs.value}"
emptyMessage="No genes found."
style="width:100%;"
scrollHeight="150"
scrollable="true"
scrollRows="25">
<p:column headerText="Symbol" style="width:120px;">
<a href="http://www.uniprot.org/uniprot/#{gene.accession.accession}"
target="_blank" style="margin-right: 5px; text-decoration: none;">
Expand Down

0 comments on commit 2900abb

Please sign in to comment.