Skip to content

Commit 11b9fb0

Browse files
authored
Merge branch 'main' into nf-annotation-kegg-viewer
2 parents c0995f1 + fcf54ce commit 11b9fb0

File tree

7 files changed

+78
-1
lines changed

7 files changed

+78
-1
lines changed

installation/install.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ if [ ! -d $io_home ]; then
1717
"public"
1818
"sra"
1919
"db"
20+
"opaver_web"
21+
"opaver_web/data"
2022
)
2123

2224
for dir in "${dirs[@]}"
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
import React, { useState, useEffect } from 'react'
2+
import { Card, CardBody, Collapse } from 'reactstrap'
3+
import { StatsTable } from 'src/edge/common/Tables'
4+
import { Header } from 'src/edge/project/results/CardHeader'
5+
import config from 'src/config'
6+
7+
export const AntiSmash = (props) => {
8+
const [collapseCard, setCollapseCard] = useState(true)
9+
const url = config.APP.BASE_URI + '/projects/' + props.project.code + '/'
10+
11+
useEffect(() => {
12+
if (props.allExpand > 0) {
13+
setCollapseCard(false)
14+
}
15+
}, [props.allExpand])
16+
17+
useEffect(() => {
18+
if (props.allClosed > 0) {
19+
setCollapseCard(true)
20+
}
21+
}, [props.allClosed])
22+
23+
return (
24+
<Card className="workflow-result-card">
25+
<Header
26+
toggle={true}
27+
toggleParms={() => {
28+
setCollapseCard(!collapseCard)
29+
}}
30+
title={'AntiSmash Result'}
31+
collapseParms={collapseCard}
32+
/>
33+
<Collapse isOpen={!collapseCard}>
34+
<CardBody>
35+
{props.result.antiSmashHtml && (
36+
<>
37+
<a href={url + props.result.antiSmashHtml} target="_blank" rel="noreferrer">
38+
[full window view]
39+
</a>
40+
<br></br>
41+
<div key={'metagenomics-antisMash-iframe'}>
42+
<iframe
43+
src={url + props.result.antiSmashHtml}
44+
className="edge-iframe"
45+
title={'AntiSmash Result Viewer'}
46+
/>
47+
</div>
48+
<br></br>
49+
</>
50+
)}
51+
</CardBody>
52+
</Collapse>
53+
</Card>
54+
)
55+
}

webapp/client/src/workflows/project/ProjectResult.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import ProjectOutputs from '/src/edge/project/results/ProjectOutputs'
77
import { RunFaQCs } from '../metagenomics/results/RunFaQCs'
88
import { Assembly } from '../metagenomics/results/Assembly'
99
import { Phylogeny } from '../metagenomics/results/Phylogeny'
10+
import { AntiSmash } from '../metagenomics/results/AntiSmash'
1011

1112
const ProjectResult = (props) => {
1213
const [project, setProject] = useState()
@@ -240,6 +241,15 @@ const ProjectResult = (props) => {
240241
allClosed={allClosed}
241242
/>
242243
)}
244+
{project.type === 'antiSmash' && (
245+
<AntiSmash
246+
result={result}
247+
project={project}
248+
userType={type}
249+
allExpand={allExpand}
250+
allClosed={allClosed}
251+
/>
252+
)}
243253
</>
244254
)}
245255
{outputs && (

webapp/server/config.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -199,6 +199,8 @@ const config = {
199199
PROJECT_BASE_DIR: process.env.PROJECTS_BASE_DIR || path.join(IO_BASE_DIR, 'projects'),
200200
// Directory to store sra workflow results.
201201
SRA_BASE_DIR: process.env.SRA_BASE_DIR || path.join(IO_BASE_DIR, 'sra'),
202+
// Directory to store KEGG viewer data.
203+
KEGG_VIEWER_DIR: process.env.KEGG_VIEWER_DIR || path.join(IO_BASE_DIR, 'opaver_web/data'),
202204
// Directory to store public data.
203205
PUBLIC_BASE_DIR: process.env.PUBLIC_BASE_DIR || path.join(IO_BASE_DIR, 'public'),
204206
// Directory to store user uploaded files

webapp/server/utils/nextflow.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ const generateInputs = async (projHome, projectConf, proj) => {
1818
...projectConf.rawReads,
1919
// download sra data to shared directory
2020
sraOutdir: config.IO.SRA_BASE_DIR,
21+
keggViewerDir: config.IO.KEGG_VIEWER_DIR,
2122
inputFastq2: [],
2223
projOutdir: `${projHome}/${workflowSettings.outdir}`,
2324
project: proj.name,

webapp/server/utils/workflow.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ const generateWorkflowResult = (proj) => {
176176
if (fs.existsSync(treeCdsHtml)) {
177177
result.treeCdsHtml = `${workflowList[projectConf.workflow.name].outdir}/SNPphyloTree.cds.html`;
178178
}
179+
} else if (projectConf.workflow.name === 'antiSmash') {
180+
// antiSMASH HTML output
181+
const antiSmashHtml = `${outdir}/output/index.html`;
182+
if (fs.existsSync(antiSmashHtml)) {
183+
result.antiSmashHtml = `${workflowList[projectConf.workflow.name].outdir}/output/index.html`;
184+
}
179185
}
180186

181187
fs.writeFileSync(resultJson, JSON.stringify(result));

workflows/Nextflow/templates/module_params.tmpl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,9 @@
8585
evalue = <% if(typeof evalue !== 'undefined') { %><%= evalue %><% } else { %>0.000000001<%} %>
8686
gcode = <% if(typeof gcode !== 'undefined') { %><%= gcode %><% } else { %>11<%} %>
8787
keggView = <% if(typeof keggView !== 'undefined') { %><%= keggView %><% } else { %>false<%} %>
88-
keggViewerDir = "<%=keggViewerDir %>"
88+
keggViewerDir = <% if(typeof keggViewerDir !== 'undefined') { %>"<%= keggViewerDir %>"<% } else { %>"undefined"<%} %>
8989
dataCode = "<%= nextflowOutDir %>".split("/")[-2]
90+
9091
}
9192

9293
binning {

0 commit comments

Comments
 (0)