-
-
Notifications
You must be signed in to change notification settings - Fork 114
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
165 additions
and
94 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,5 @@ pkg | |
node_modules | ||
|
||
spec/dotdir/* | ||
spec/downloads/* | ||
spec/downloads/* | ||
spec/tmp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import ReportHeader from './report_header'; | ||
import Hits from '../hits'; | ||
|
||
const AlignmentResults = (props) => { | ||
const renderContent = () => ( | ||
<div> | ||
{props.state.results} | ||
<Hits | ||
{...props} | ||
componentFinishedUpdating={(_) => props.componentFinishedUpdating(_)} | ||
/> | ||
</div> | ||
); | ||
|
||
return <ReportHeader name="Alignment Results" renderContent={renderContent} />; | ||
}; | ||
|
||
export default AlignmentResults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import Circos from '../circos'; | ||
import ReportHeader from './report_header'; | ||
|
||
const GraphicalOverview = ({queries, program, plugins}) => { | ||
/** | ||
* Does the report have at least two hits? This is used to determine | ||
* whether Circos should be enabled or not. | ||
*/ | ||
const atLeastTwoHits = () => { | ||
let hitNum = 0; | ||
return queries.some((query) => { | ||
hitNum += query.hits.length; | ||
return hitNum > 1; | ||
}); | ||
} | ||
|
||
const renderContent = () => { | ||
if(!atLeastTwoHits()) return null; | ||
|
||
return ( | ||
<> | ||
<Circos queries={queries} program={program} /> | ||
{plugins.generateStats(queries)} | ||
</> | ||
) | ||
} | ||
|
||
return ( | ||
<ReportHeader name="Graphical Overview" renderContent={renderContent} renderable={atLeastTwoHits()} /> | ||
) | ||
} | ||
|
||
export default GraphicalOverview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import React, { useState } from 'react'; | ||
import CollapsePreferences from '../collapse_preferences'; | ||
|
||
const ReportHeader = (props) => { | ||
const [state, setState] = useState({ collapsed: null }); | ||
const [renderable, _setRenderable] = useState(props.renderable === undefined ? true : props.renderable); | ||
const collapsePreferences = new CollapsePreferences({ name: props.name, state: { ...state }, setState: setState }); | ||
|
||
if (state.collapsed === null) setState({ collapsed: collapsePreferences.preferenceStoredAsCollapsed() }); | ||
if (!renderable) return null; | ||
|
||
return ( | ||
<> | ||
<h3 className="caption font-bold border-b-2 border-seqorange" onClick={() => collapsePreferences.toggleCollapse()}> | ||
{collapsePreferences.renderCollapseIcon()} | ||
<span> {props.name}</span> | ||
</h3> | ||
<div className='mx-1'> | ||
{!state.collapsed && props.renderContent()} | ||
</div> | ||
</> | ||
); | ||
}; | ||
|
||
export default ReportHeader; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import ReportHeader from './report_header'; | ||
import _ from 'underscore'; | ||
|
||
const RunSummary = (props) => { | ||
const renderContent = () => { | ||
return ( | ||
<div className="overview mr-0 mb-0"> | ||
<p className="m-0 text-sm"> | ||
<strong>SequenceServer {props.seqserv_version}</strong> using{' '} | ||
<strong>{props.program_version}</strong> | ||
{props.submitted_at && | ||
`, query submitted on ${props.submitted_at}`} | ||
</p> | ||
<p className="m-0 text-sm"> | ||
<strong> Databases: </strong> | ||
{props.querydb | ||
.map((db) => { | ||
return db.title; | ||
}) | ||
.join(', ')}{' '} | ||
({props.stats.nsequences} sequences, | ||
{props.stats.ncharacters} characters) | ||
</p> | ||
<p className="m-0 text-sm"> | ||
<strong>Parameters: </strong>{' '} | ||
{_.map(props.params, function (val, key) { | ||
return key + ' ' + val; | ||
}).join(', ')} | ||
</p> | ||
<p className="m-0 text-sm"> | ||
Please cite:{' '} | ||
<a href="https://doi.org/10.1093/molbev/msz185" className="text-seqblue hover:text-seqorange"> | ||
https://doi.org/10.1093/molbev/msz185 | ||
</a> | ||
</p> | ||
</div> | ||
); | ||
}; | ||
|
||
return <ReportHeader name="Run Summary" renderContent={renderContent} />; | ||
}; | ||
|
||
export default RunSummary; |
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters