import React, { useState } from 'react' import { Dialog } from '@jbrowse/core/ui' import { getSession } from '@jbrowse/core/util' import { Button, DialogActions, DialogContent, Typography } from '@mui/material' import { observer } from 'mobx-react' import { launchInterProScan } from '../../launchInterProScan.ts' import type { MsaViewModel } from '../../model.ts' const InterProScanDialog = observer(function ({ handleClose, model, }: { handleClose: () => void model: MsaViewModel }) { const [vals, setVals] = useState([ { name: 'NCBIfam', description: 'NCBI RefSeq FAMs including TIGRFAMs', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'SFLD', description: 'Structure function linkage database', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'Phobius', checked: true, description: 'A combined transmembrane topology and signal peptide predictor', category: 'Other sequence features', }, { name: 'SignalP', checked: true, category: 'Other sequence features', }, { name: 'SignalP_EUK', category: 'Other category', checked: true, }, { name: 'SignalP_GRAM_POSITIVE', category: 'Other category', checked: true, }, { name: 'SignalP_GRAM_NEGATIVE', checked: true, category: 'Other category', }, { name: 'SuperFamily', category: 'Structural domains', checked: true, }, { name: 'Panther', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'Gene3d', category: 'Structural domains', checked: true, }, { name: 'HAMAP', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'PrositeProfiles', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'PrositePatterns', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'Coils', category: 'Other sequence features', checked: true, }, { name: 'SMART', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'CDD', description: 'Conserved Domains Database', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'PRINTS', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'PfamA', category: 'Families, domains, sites & repeats', checked: true, }, { name: 'MobiDBLite', checked: true, category: 'Other sequence features', }, { name: 'PIRSF', checked: true, category: 'Other category', }, { name: 'TMHMM', checked: true, category: 'Other sequence features', }, { name: 'AntiFam', checked: true, category: 'Other category', }, { name: 'FunFam', checked: true, category: 'Other category', }, { name: 'PIRSR', checked: true, category: 'Families, domains, sites & repeats', }, ]) const programs = vals.filter(e => e.checked).map(e => e.name) const [show, setShow] = useState(false) return ( { handleClose() }} open > This will run InterProScan via the InterProScan API on all rows of the current MSA {show ? (
Select algorithms for InterProScan to run
{vals .toSorted((a, b) => a.category.localeCompare(b.category)) .map(({ name, checked, category }) => ( ))}
{ setVals( vals.map(e => e.name === name ? { ...e, checked: !e.checked } : e, ), ) }} /> {name} {category}
) : null}
) }) export default InterProScanDialog