Skip to content

Commit 4c548b1

Browse files
authored
Merge pull request #153 from LANL-Bioinformatics/149-add-genefamily
Add geneFamily workflow
2 parents fe33af4 + 8ab3c16 commit 4c548b1

File tree

9 files changed

+494
-27
lines changed

9 files changed

+494
-27
lines changed

webapp/client/src/_nav.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const _nav = [
4343
to: '/workflow/metagenomics',
4444
badge: {
4545
color: 'info',
46-
text: '8',
46+
text: '9',
4747
},
4848
},
4949
],

webapp/client/src/components/OrcidLoginHelp.js

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,23 +10,23 @@ const OrcidLoginHelp = (props) => {
1010
ORCID Account Integration
1111
</CardTitle>
1212
<CardText className="edge-header-orcid-login-help-text">
13-
<p>
14-
EDGE requires an ORCID iD to log in. When logged in you have access to features such
15-
as uploading files and the ability to create and manage workflow runs.
16-
</p>
17-
<p>
18-
Click the &quot;ORCID Login&quot; button, to either register for an ORCID iD or, if
19-
you already have one, to sign into your ORCID account, then grant permission for EDGE
20-
to access your ORCID iD. This allows us to verify your identity and securely connect
21-
to your ORCID iD. Additionally, we may use information, such as your name and id, to
22-
associate your ORCID record with your EDGE workflow runs.
23-
</p>
24-
<p>
25-
Learn more about{' '}
26-
<a href="https://orcid.org/blog/2017/02/20/whats-so-special-about-signing">
27-
what&apos;s so special about signing in.
28-
</a>
29-
</p>
13+
EDGE requires an ORCID iD to log in. When logged in you have access to features such as
14+
uploading files and the ability to create and manage workflow runs.
15+
<br></br>
16+
<br></br>
17+
Click the &quot;ORCID Login&quot; button, to either register for an ORCID iD or, if you
18+
already have one, to sign into your ORCID account, then grant permission for EDGE to
19+
access your ORCID iD. This allows us to verify your identity and securely connect to
20+
your ORCID iD. Additionally, we may use information, such as your name and id, to
21+
associate your ORCID record with your EDGE workflow runs.
22+
<br></br>
23+
<br></br>
24+
Learn more about{' '}
25+
<a href="https://orcid.org/blog/2017/02/20/whats-so-special-about-signing">
26+
what&apos;s so special about signing in.
27+
</a>
28+
<br></br>
29+
<br></br>
3030
</CardText>
3131
</CardBody>
3232
</Card>

webapp/client/src/edge/um/user/UploadFiles.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ const UploadFiles = (props) => {
190190
<>
191191
<LoaderDialog
192192
loading={submitting}
193-
text={'Uploading...' + Math.round((filesUploaded / files2upload) * 100) + '%'}
193+
text={`Uploading... ${files2upload > 5 ? Math.round((filesUploaded / files2upload) * 100) + '%' : ''}`}
194194
/>
195195
<ToastContainer />
196196
<div className="clearfix">

webapp/client/src/util.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,9 @@ export const workflowList = {
4848
category: 'metagenomics',
4949
info: 'Reference-Based Analysis workflow ',
5050
},
51+
geneFamily: {
52+
label: 'Gene Family Analysis',
53+
category: 'metagenomics',
54+
info: 'Gene Family Analysis workflow ',
55+
},
5156
}

webapp/client/src/workflows/metagenomics/Main.js

Lines changed: 56 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import { AntiSmash } from './forms/AntiSmash'
2020
import { Taxonomy } from './forms/Taxonomy'
2121
import { Phylogeny } from './forms/Phylogeny'
2222
import { RefBased } from './forms/RefBased'
23+
import { GeneFamily } from './forms/GeneFamily'
2324

2425
const Main = (props) => {
2526
const navigate = useNavigate()
@@ -161,6 +162,25 @@ const Main = (props) => {
161162
: {}),
162163
}
163164
}
165+
//add optional inputs to main inputs
166+
if (workflow === 'geneFamily') {
167+
// eslint-disable-next-line prettier/prettier
168+
if (selectedWorkflows[workflow].inputs['readsGeneFamily'].value) {
169+
// eslint-disable-next-line prettier/prettier
170+
selectedWorkflows[workflow].inputs = {
171+
...selectedWorkflows[workflow].inputs,
172+
// eslint-disable-next-line prettier/prettier
173+
...selectedWorkflows[workflow].readsInputs
174+
}
175+
} else {
176+
// eslint-disable-next-line prettier/prettier
177+
selectedWorkflows[workflow].inputs = {
178+
...selectedWorkflows[workflow].inputs,
179+
// eslint-disable-next-line prettier/prettier
180+
...selectedWorkflows[workflow].contigsInputs
181+
}
182+
}
183+
}
164184

165185
Object.keys(selectedWorkflows[workflow].inputs).forEach((key) => {
166186
myWorkflow.input[key] = selectedWorkflows[workflow].inputs[key].value
@@ -283,7 +303,6 @@ const Main = (props) => {
283303
<h4 className="pt-3">Run a Single Workflow</h4>
284304
<hr />
285305
<Project setParams={setProject} />
286-
287306
<br></br>
288307
<b>Workflow</b>
289308
<MySelect
@@ -537,7 +556,6 @@ const Main = (props) => {
537556
/>
538557
</>
539558
)}
540-
<br></br>
541559
{workflow === 'phylogeny' && (
542560
<>
543561
<InputRawReads
@@ -574,7 +592,6 @@ const Main = (props) => {
574592
/>
575593
</>
576594
)}
577-
<br></br>
578595
{workflow === 'refBased' && (
579596
<>
580597
<InputRawReads
@@ -611,9 +628,43 @@ const Main = (props) => {
611628
/>
612629
</>
613630
)}
614-
<br></br>
631+
{workflow === 'geneFamily' && (
632+
<>
633+
<InputRawReads
634+
setParams={setRawData}
635+
isValidFileInput={isValidFileInput}
636+
source={workflows[workflow]['rawReadsInput'].source}
637+
sourceDisplay={workflows[workflow]['rawReadsInput'].text}
638+
sourceOptionsOn={true}
639+
text={workflows[workflow]['rawReadsInput'].text}
640+
tooltip={workflows[workflow]['rawReadsInput'].tooltip}
641+
title={'Input Raw Reads'}
642+
fastqSettings={workflows[workflow]['rawReadsInput'].fastq}
643+
fastaSettings={workflows[workflow]['rawReadsInput'].fasta}
644+
isValid={rawDataParams ? rawDataParams.validForm : false}
645+
errMessage={rawDataParams ? rawDataParams.errMessage : null}
646+
allExpand={allExpand}
647+
allClosed={allClosed}
648+
/>
649+
<GeneFamily
650+
name={workflow}
651+
full_name={workflow}
652+
title={workflowList[workflow].label}
653+
setParams={setWorkflowParams}
654+
isValid={
655+
selectedWorkflows[workflow] ? selectedWorkflows[workflow].validForm : false
656+
}
657+
errMessage={
658+
selectedWorkflows[workflow] ? selectedWorkflows[workflow].errMessage : null
659+
}
660+
source={rawDataParams.inputs.source.value}
661+
pairedReads={rawDataParams.inputs.paired.value}
662+
allExpand={allExpand}
663+
allClosed={allClosed}
664+
/>
665+
</>
666+
)}
615667
</div>
616-
617668
<div className="edge-center">
618669
<Button
619670
color="primary"

webapp/client/src/workflows/metagenomics/defaults.js

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export const workflowOptions = [
99
{ value: 'taxonomy', label: workflowList['taxonomy'].label },
1010
{ value: 'phylogeny', label: workflowList['phylogeny'].label },
1111
{ value: 'refBased', label: workflowList['refBased'].label },
12+
{ value: 'geneFamily', label: workflowList['geneFamily'].label },
1213
]
1314

1415
export const taxClassificationOptions = {
@@ -1861,4 +1862,122 @@ export const workflows = {
18611862
},
18621863
},
18631864
},
1865+
geneFamily: {
1866+
validForm: true,
1867+
errMessage: 'input error',
1868+
paramsOn: true,
1869+
files: [],
1870+
rawReadsInput: {
1871+
source: 'fastq',
1872+
fastq: {
1873+
enableInput: true,
1874+
placeholder: 'Select a file or enter a file http(s) url',
1875+
dataSources: ['upload', 'public', 'project'],
1876+
fileTypes: ['fastq', 'fq', 'fastq.gz', 'fq.gz'],
1877+
projectTypes: ['runFaQCs'],
1878+
projectScope: ['self+shared'],
1879+
viewFile: false,
1880+
isOptional: false,
1881+
cleanupInput: true,
1882+
maxInput: 1000,
1883+
},
1884+
fasta: {
1885+
enableInput: true,
1886+
placeholder: 'Select a file or enter a file http(s) url',
1887+
dataSources: ['upload', 'public', 'project'],
1888+
fileTypes: ['fasta', 'fa', 'fna', 'contigs'],
1889+
projectTypes: ['assembly', 'annotation'],
1890+
projectScope: ['self+shared'],
1891+
viewFile: false,
1892+
isOptional: false,
1893+
cleanupInput: true,
1894+
maxInput: 1,
1895+
},
1896+
},
1897+
inputs: {
1898+
readsGeneFamily: {
1899+
text: 'Reads Gene Family Analysis',
1900+
value: true,
1901+
switcher: {
1902+
trueText: 'Yes',
1903+
falseText: 'No',
1904+
defaultValue: true,
1905+
},
1906+
},
1907+
contigsGeneFamily: {
1908+
text: 'Contigs Gene Family Analysis',
1909+
value: false,
1910+
switcher: {
1911+
trueText: 'Yes',
1912+
falseText: 'No',
1913+
defaultValue: false,
1914+
},
1915+
},
1916+
},
1917+
readsInputs: {
1918+
virulenceFactorTool: {
1919+
text: 'Virulence Factor (VF) Detection Tool',
1920+
tooltip: `MetaVF Toolkit will identify VFs in PE reads through sequence similarity search using
1921+
VFDB 2.0 <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC11402979/" target="_blank" rel="noopener noreferrer"><span style="color:yellow;">[here]</span></a>`,
1922+
value: 'MetaVF Toolkit',
1923+
display: 'MetaVF Toolkit',
1924+
options: [
1925+
{ text: 'MetaVF Toolkit', value: 'MetaVF Toolkit' },
1926+
{ text: 'PathoFact2', value: 'PathoFact2', disabled: true },
1927+
],
1928+
},
1929+
},
1930+
contigsInputs: {
1931+
inputFAA: {
1932+
text: 'Input FAA File',
1933+
value: null,
1934+
display: null,
1935+
fileInput: {
1936+
enableInput: true,
1937+
placeholder: '(Required) Select a file or enter a file http(s) url',
1938+
dataSources: ['upload', 'public', 'project'],
1939+
fileTypes: ['faa'],
1940+
projectTypes: ['annotation'],
1941+
projectScope: ['self+shared'],
1942+
viewFile: false,
1943+
isOptional: false,
1944+
cleanupInput: true,
1945+
},
1946+
},
1947+
inputGFF: {
1948+
text: 'Input GFF File',
1949+
value: null,
1950+
display: null,
1951+
fileInput: {
1952+
enableInput: true,
1953+
placeholder: '(Required) Select a file or enter a file http(s) url',
1954+
dataSources: ['upload', 'public', 'project'],
1955+
fileTypes: ['gff'],
1956+
projectTypes: ['annotation'],
1957+
projectScope: ['self+shared'],
1958+
viewFile: false,
1959+
isOptional: false,
1960+
cleanupInput: true,
1961+
},
1962+
},
1963+
virulenceFactorTool: {
1964+
text: 'Virulence Factor (VF) Detection Tool',
1965+
tooltip: `MetaVF Toolkit will identify VFs in contigs through sequence similarity search using
1966+
VFDB 2.0 <a href="https://pmc.ncbi.nlm.nih.gov/articles/PMC11402979/" target="_blank" rel="noopener noreferrer"><span style="color:yellow;">[here]</span></a>; PathoFact2.`,
1967+
value: 'MetaVF Toolkit',
1968+
display: 'MetaVF Toolkit',
1969+
options: [
1970+
{ text: 'MetaVF Toolkit', value: 'MetaVF Toolkit' },
1971+
{ text: 'PathoFact2', value: 'PathoFact2' },
1972+
],
1973+
},
1974+
},
1975+
// only for input with validation method
1976+
validInputs: {
1977+
contigsInputs: {
1978+
inputFAA: { isValid: false, error: 'Input FAA File error. Required' },
1979+
inputGFF: { isValid: false, error: 'Input GFF File error. Required' },
1980+
},
1981+
},
1982+
},
18641983
}

0 commit comments

Comments
 (0)