diff --git a/resources/biseps b/resources/biseps index 118312e39b35c7dc7f64a55e6f443d7bf8815604..96d521e99c330a087fb82aae18b789f2a6d052bb 160000 --- a/resources/biseps +++ b/resources/biseps @@ -1 +1 @@ -Subproject commit 118312e39b35c7dc7f64a55e6f443d7bf8815604 +Subproject commit 96d521e99c330a087fb82aae18b789f2a6d052bb diff --git a/src/backend/helpers/createConfigComparison.js b/src/backend/helpers/createConfigComparison.js index 1665ce64aaa01c347b291582a73f16cf4879f65c..ff1bf897905f8c9f9210c6e67dedd06432d46bff 100644 --- a/src/backend/helpers/createConfigComparison.js +++ b/src/backend/helpers/createConfigComparison.js @@ -32,19 +32,15 @@ const createConfigComparison = (body, uniqueDir, uniqueDirRemote) => { }, params: { method: body.method, - binSize: Number(body.binsize), - kernelFunction: body.kernelFunction, + windowSize: Number(body.binsize), + stepSize: Number(body.stepsize), test: body.stat, + overdispersion: body.overdispersion, + qValue: Number(body.pValueThreshold), + minCov: Number(body.minReadsPerCytosine), + minDiff: Number(body.minProportionDifference), context: body.contexts, - pseudocountM: Number(body.pseudocountM), - pseudocountN: Number(body.pseudocountN), - pValueThreshold: Number(body.pValueThreshold), - minCytosinesCount: Number(body.minCytosinesCount), - minProportionDifference: Number(body.minProportionDifference), - minGap: parseInt(body.minGap), - minSize: parseInt(body.minSize), - minReadsPerCytosine: Number(body.minReadsPerCytosine), - cores: body.remote ? 10 : cpuCount, + species: body.species, }, }; const yamlStr = yaml.dump(config); diff --git a/src/backend/models/Comparison.js b/src/backend/models/Comparison.js index da3338e513e918e2afd13fb1f712856f65857b0c..2c8f9675854f8b1175b23a1fcceae0a497cca086 100644 --- a/src/backend/models/Comparison.js +++ b/src/backend/models/Comparison.js @@ -6,7 +6,6 @@ const comparisonSchema = new Schema({ createdBy: { type: Schema.Types.ObjectId, ref: "users" }, outdir: { type: String, required: true }, remoteDir: { type: String, required: false }, - method: { type: String, required: false }, date: { type: Date, default: Date.now, @@ -16,18 +15,17 @@ const comparisonSchema = new Schema({ required: false, default: false, }, - stat: { type: String, required: false }, + method: { type: String, required: false }, genome: { type: String, required: false }, - contexts: [{ type: String, required: false }], - binSize: { type: Number, required: false }, - pseudocountN: { type: Number, required: false }, - pseudocountM: { type: Number, required: false }, - pValueThreshold: { type: Number, required: false }, - minCytosinesCount: { type: Number, required: false }, - minProportionDifference: { type: Number, required: false }, - minGap: { type: Number, required: false }, - minSize: { type: Number, required: false }, - minReadsPerCytosine: { type: Number, required: false }, + windowSize: { type: Number, required: false }, + stepSize: { type: Number, required: false }, + test: { type: String, required: false }, + overdispersion: { type: String, required: false }, + qValue: { type: Number, required: false }, + minCov: { type: Number, required: false }, + minDiff: { type: Number, required: false }, + context: [{ type: String, required: false }], + species: { type: String, required: false }, remote: { type: Boolean, required: false }, cluster: { type: Boolean, required: false }, machine: { diff --git a/src/backend/routes/api/comparisonController.js b/src/backend/routes/api/comparisonController.js index ff251dd9b9b7b6304813c64a89d05e897c6f968b..be804f8d46bf59b66e64479959d489c8e12ed589 100644 --- a/src/backend/routes/api/comparisonController.js +++ b/src/backend/routes/api/comparisonController.js @@ -47,24 +47,21 @@ router.post("/comparison", (req, res) => { const newComparison = new Comparison({ outdir: uniqueDir, - machine: req.body.machine, - genome: req.body.genome, - remoteDir: req.body.remoteDir, profile: profile, + genome: req.body.genome, + method: req.body.method, + windowSize: req.body.binsize, + stepSize: req.body.stepsize, + TransitionEvent: req.body.stat, + overdispersion: req.body.overdispersion, + qValue: req.body.pValueThreshold, + minCov: req.body.minReadsPerCytosine, + minDiff: req.body.minProportionDifference, + context: req.body.contexts, + species: req.body.species, + machine: req.body.machine, comparisons: req.body.comparisons, remotecomparisons: req.body.remotecomparisons, - method: req.body.method, - stat: req.body.stat, - contexts: req.body.contexts, - binSize: req.body.binSize, - pseudocountN: req.body.pseudocountN, - pseudocountM: req.body.pseudocountM, - pValueThreshold: req.body.pValueThreshold, - minCytosinesCount: req.body.minCytosinesCount, - minProportionDifference: req.body.minProportionDifference, - minGap: req.body.minGap, - minSize: req.body.minSize, - minReadsPerCytosine: req.body.minReadsPerCytosine, remote: req.body.remote, cluster: req.body.cluster, createdBy: req.body.userId, @@ -120,23 +117,21 @@ router.post("/comparison", (req, res) => { const newComparison = new Comparison({ outdir: uniqueDir, profile: profile, - remoteDir: uniqueDirRemote, genome: req.body.genome, + remoteDir: uniqueDirRemote, + bins: req.body.bins, + windowSize: req.body.binsize, + stepSize: req.body.stepsize, + TransitionEvent: req.body.stat, + overdispersion: req.body.overdispersion, + qValue: req.body.pValueThreshold, + minCov: req.body.minReadsPerCytosine, + minDiff: req.body.minProportionDifference, + context: req.body.contexts, + species: req.body.species, machine: req.body.machine, comparisons: req.body.comparisons, remotecomparisons: req.body.remotecomparisons, - method: req.body.method, - stat: req.body.stat, - contexts: req.body.contexts, - binSize: req.body.binSize, - pseudocountN: req.body.pseudocountN, - pseudocountM: req.body.pseudocountM, - pValueThreshold: req.body.pValueThreshold, - minCytosinesCount: req.body.minCytosinesCount, - minProportionDifference: req.body.minProportionDifference, - minGap: req.body.minGap, - minSize: req.body.minSize, - minReadsPerCytosine: req.body.minReadsPerCytosine, remote: req.body.remote, cluster: req.body.cluster, createdBy: req.body.userId, diff --git a/src/components/ComparisonStepper/GlobalConfig.js b/src/components/ComparisonStepper/GlobalConfig.js index 1c745d0bb29bbfae0d19f2d97d9f9686eeabb0d4..34d3433e13f75422b3972e5656027d5de429ebe3 100644 --- a/src/components/ComparisonStepper/GlobalConfig.js +++ b/src/components/ComparisonStepper/GlobalConfig.js @@ -185,12 +185,7 @@ export default function GlobalConfig() { onChange={handleCompState} > <MenuItem value="bins">Bins</MenuItem> - <MenuItem value="neighbourhood">Neighbourhood</MenuItem>{" "} - {compState.stat != "betareg" ? ( - <MenuItem value="noise_filter">Noise Filter</MenuItem> - ) : ( - "" - )} + <MenuItem value="base">Base Level</MenuItem> </Select> <FormHelperText> Choose DMR Calling method. Default: bins @@ -210,9 +205,9 @@ export default function GlobalConfig() { input={<Input />} renderValue={(selected) => selected.join(", ")} > - <MenuItem key={1} value="CG"> - <Checkbox checked={compState.contexts.indexOf("CG") > -1} /> - <ListItemText primary={"CG"} /> + <MenuItem key={1} value="CpG"> + <Checkbox checked={compState.contexts.indexOf("CpG") > -1} /> + <ListItemText primary={"CpG"} /> </MenuItem> <MenuItem key={2} value={"CHG"}> <Checkbox checked={compState.contexts.indexOf("CHG") > -1} /> @@ -238,26 +233,10 @@ export default function GlobalConfig() { name="stat" onChange={handleCompState} > - <MenuItem value="score">Score</MenuItem> - <MenuItem value="fisher">Fisher</MenuItem> - {compState.method != "noise_filter" ? ( - <MenuItem value="betareg">Betareg</MenuItem> - ) : ( - "" - )} - - {/* <input - accept=".fa" - className={classes.input} - style={{ display: "none" }} - id="test" - multiple - onChange={handleRunFiles} - type="file" - /> - <label htmlFor="test"> - <MenuItem value="Upload">Upload</MenuItem> - </label> */} + <MenuItem value="F">F</MenuItem> + <MenuItem value="fast.fisher">Fast Fisher</MenuItem> + <MenuItem value="midPval">midPval</MenuItem> + <MenuItem value="Chisq">Chisq</MenuItem> </Select> <FormHelperText>Choose test</FormHelperText> </FormControl> @@ -280,7 +259,7 @@ export default function GlobalConfig() { <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -290,63 +269,27 @@ export default function GlobalConfig() { </FormHelperText> </FormControl> </Grid> - {compState.method === "neighbourhood" ? ( - "" - ) : ( - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <Typography gutterBottom> - {compState.method === "bins" ? "Bin Size" : "Window Size"}{" "} - </Typography> - <Slider - id="binsize" - name="binsize" - onChange={handleSlider} - value={compState.binsize} - step={50} - min={0} - max={1000} - valueLabelDisplay="auto" - /> - <FormHelperText> - Choose bin size for Bins and Noise Filter methods. See{" "} - <Link - onClick={() => - createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" - ) - } - > - docs - </Link> - . - </FormHelperText> - </FormControl> - </Grid> - )} - {compState.stat != "betareg" ? ( + + {compState.method != "bins" ? ( "" ) : ( <> <Grid item xs={12} sm={4}> <FormControl className={classes.formControl}> - <Typography gutterBottom> - Methylated Reads Pseudocount - </Typography> + <Typography gutterBottom>Window Size</Typography> <Input - id="pseudocountM" - name="pseudocountM" + id="binsize" + name="binsize" type="number" onChange={handleCompState} - value={compState.pseudocountM} + value={compState.binsize} /> <FormHelperText> - Numerical Value to be added to methylated reads before beta - regression. See{" "} + Choose bin size for Bins and Noise Filter methods. See{" "} <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -358,21 +301,20 @@ export default function GlobalConfig() { </Grid> <Grid item xs={12} sm={4}> <FormControl className={classes.formControl}> - <Typography gutterBottom>Total Reads Pseudocount</Typography> + <Typography gutterBottom>Step Size</Typography> <Input - id="pseudocountN" - name="pseudocountN" + id="stepsize" + name="stepsize" type="number" onChange={handleCompState} - value={compState.pseudocountN} + value={compState.stepsize} /> <FormHelperText> - Numerical Value to be added to total reads before beta - regression. See{" "} + Step to use to go over genome. <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -384,32 +326,7 @@ export default function GlobalConfig() { </Grid> </> )} - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <Typography gutterBottom>Minimum Cytosines Count</Typography> - <Input - id="minCytosinesCount" - name="minCytosinesCount" - type="number" - onChange={handleCompState} - value={compState.minCytosinesCount} - /> - <FormHelperText> - Minimum methylated cytosines count present in a region to be - qualified as DMR. See{" "} - <Link - onClick={() => - createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" - ) - } - > - docs - </Link> - . - </FormHelperText> - </FormControl> - </Grid> + <Grid item xs={12} sm={4}> <FormControl className={classes.formControl}> <Typography gutterBottom>Minimum Reads Per Cytosine </Typography> @@ -425,7 +342,7 @@ export default function GlobalConfig() { <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -456,32 +373,7 @@ export default function GlobalConfig() { <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" - ) - } - > - docs - </Link> - . - </FormHelperText> - </FormControl> - </Grid> - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <Typography gutterBottom>Minimum Gap</Typography> - <Input - id="minGap" - name="minGap" - type="number" - onChange={handleCompState} - value={compState.minGap} - /> - <FormHelperText> - DMRs separated by a gap of at least minGap are not merged. See{" "} - <Link - onClick={() => - createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -491,6 +383,7 @@ export default function GlobalConfig() { </FormHelperText> </FormControl> </Grid> + <Grid item xs={12} sm={4}> <FormControl className={classes.formControl}> <Typography gutterBottom>Minimum Size</Typography> @@ -506,7 +399,7 @@ export default function GlobalConfig() { <Link onClick={() => createBrowserWindow( - "https://bioconductor.org/packages/release/bioc/html/DMRcaller.html" + "https://bioconductor.org/packages/release/bioc/manuals/methylKit/man/methylKit.pdf" ) } > @@ -517,57 +410,7 @@ export default function GlobalConfig() { </FormControl> </Grid> - {compState.method != "noise_filter" ? ( - "" - ) : ( - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <InputLabel>Kernel Function</InputLabel> - <Select - value={compState.kernelFunction} - labelId="kernelFunction" - id="kernelFunction" - name="kernelFunction" - onChange={handleCompState} - > - <MenuItem value="uniform">Uniform</MenuItem> - <MenuItem value="triangular">Triangular</MenuItem>{" "} - <MenuItem value="gaussian">Gaussian</MenuItem> - <MenuItem value="epanechnicov">Epanechnicov</MenuItem> - </Select> - <FormHelperText> - Choose kernel function to be used with noise filter method. - Default : uniform. - </FormHelperText> - </FormControl> - </Grid> - )} - <Grid item sm={12}> - <FormControl className={classes.formControl}> - <Button - variant="contained" - component="label" - color={compState.genome === "" ? "default" : "primary"} - > - {compState.genome === "" - ? "upload genome" - : compState.genome.split(/[\\/]/).pop()} - <input - type="file" - required - id="genome" - name="genome" - label="Genome" - accept=".fasta , .fa , .fq , .fq.gz" - onChange={handleGenome} - type="file" - hidden - /> - </Button> - - <FormHelperText>Choose genome in .fasta Format </FormHelperText> - </FormControl> <FormControl className={classes.formControl}> <Button variant="contained" @@ -590,127 +433,49 @@ export default function GlobalConfig() { </Button> <FormHelperText> - Choose annotation file in gff/bed Format + Choose annotation file in gff/bed Format. </FormHelperText> </FormControl> - </Grid> - {/* <Grid item xs={12} sm={6}> <FormControl className={classes.formControl}> <Button variant="contained" component="label" - color={compState.outdir === "" ? "default" : "primary"} + color={compState.genome === "" ? "default" : "primary"} > - {compState.outdir === "" + {compState.genome === "" ? "upload genome" - : compState.outdir.split(/[\\/]/).pop()} + : compState.genome.split(/[\\/]/).pop()} <input type="file" - required id="genome" name="genome" label="Genome" - accept=".fasta , .fa , .fq , .fq.gz" - onChange={handleGenome} + accept=".fasta , .fa" + onChange={handleFile} type="file" hidden /> </Button> - <FormHelperText>Choose genome in .fasta Format</FormHelperText> - </FormControl> - </Grid> - <Grid item xs={12} sm={6}> - <FormControl className={classes.formControl}> - <InputLabel>Number of Mismatches</InputLabel> - <Select - value={compState.n} - labelId="n" - id="n" - name="n" - onChange={handleCompState} - > - <MenuItem value={0}>0</MenuItem> - <MenuItem value={1}>1</MenuItem> - </Select> <FormHelperText> - Choose Number of Mismatches. Default: 0, choosing 1 makes process - much slower + Choose genome used to make the alignments. </FormHelperText> </FormControl> - </Grid> - <Grid item xs={12} sm={4}> <FormControl className={classes.formControl}> - <Typography gutterBottom>Minlen </Typography> - <Slider - name="minlen" - id="minlen" - onChange={handleSlider} - value={compState.minlen} - aria-labelledby="minlen" - step={10} - min={30} - max={100} - valueLabelDisplay="auto" - />{" "} - <FormHelperText>Choose minimal read length</FormHelperText> - </FormControl> - </Grid> - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <Typography gutterBottom>Min-Score </Typography> - <Slider - id="minscore" - name="minscore" - onChange={handleSlider} - value={compState.minscore} - step={-0.1} - min={-1} - max={-0.2} - valueLabelDisplay="auto" - /> - <FormHelperText> - Choose minimal alignement quality score. See - <Link href="http://www.bioinformatics.babraham.ac.uk/projects/bismark/Bismark_User_Guide_v0.7.12.pdf"> - docs - </Link> - . - </FormHelperText> - </FormControl> - </Grid> - <Grid item xs={12} sm={4}> - <FormControl className={classes.formControl}> - <Typography gutterBottom>L</Typography> - <Slider - value={compState.l} - onChange={handleSlider} - aria-labelledby="l" - id="l" - name="l" - step={1} - min={20} - max={32} - valueLabelDisplay="auto" - /> - <FormHelperText> - Choose k-mer length for alignment. Higher : Faster but less - sensitive - </FormHelperText> + <Input + onChange={handleCompState} + id="species" + name="species" + label="Species" + value={compState.species} + placeholder="Species" + required + type="text" + ></Input> </FormControl> </Grid> - <Grid item xs={12} sm={6}> - <FormControlLabel - className={classes.formControl} - control={ - <Checkbox - onChange={handleCheckBox} - color="secondary" - name="subsample" - /> - } - ></FormControlLabel> - </Grid> */} + <Grid item xs={12}> <Typography variant="h6" gutterBottom> Execution Parameters{" "} diff --git a/src/components/ComparisonStepper/RunForm.js b/src/components/ComparisonStepper/RunForm.js index 5f43fed70666921a8eb61476151b46089785aa38..da4ced8a85a0be77bd7bb017263a2308ebe5626f 100644 --- a/src/components/ComparisonStepper/RunForm.js +++ b/src/components/ComparisonStepper/RunForm.js @@ -18,6 +18,7 @@ import { useHistory } from "react-router-dom"; import CircularProgress from "@material-ui/core/CircularProgress"; import Snackbar from "@material-ui/core/Snackbar"; import MuiAlert from "@material-ui/lab/Alert"; +const path = require("path"); const http = require("http"); function Alert(props) { return <MuiAlert elevation={6} variant="filled" {...props} />; @@ -116,6 +117,10 @@ export default function RunForm() { // in a signle array const errors = []; + if (compState.species.length === 0) { + errors.push("You have to specify a a species name"); + } + if (compState.genome.length === 0) { errors.push("You have to specify a genome"); } @@ -164,16 +169,18 @@ export default function RunForm() { setLoading(false); return errors; } + console.log(path.dirname(compState.genome)); const request = { ...compState, rerun: false, comparisons, remotecomparisons, + outdir: path.dirname(compState.genome), userId: user.user.id, email: user.user.email, }; const token = sessionStorage.jwtToken; - + console.log(request); const options = { method: "POST", path: "http://localhost/api/comparisons/comparison", diff --git a/src/components/Comparisons/ComparisonTable.js b/src/components/Comparisons/ComparisonTable.js index 6f3f2df63cd94e2e6d82ee1114a8d075615d192d..c656384956129c2371a1ad875d26743c7ee5e73b 100644 --- a/src/components/Comparisons/ComparisonTable.js +++ b/src/components/Comparisons/ComparisonTable.js @@ -314,7 +314,7 @@ export default function InteractiveList() { width: 1080, }); console.log("here"); - + console.log(path); win.loadURL(`file://${path}`); }; @@ -588,7 +588,7 @@ export default function InteractiveList() { <div className={classes.demo}> <List dense={dense}> {row.comparisons.map((comparison) => - row.contexts.map((context) => ( + row.context.map((context) => ( <ListItem key={context} button diff --git a/src/components/Visualization/VisualizationFill.js b/src/components/Visualization/VisualizationFill.js index 59be61ef62e182b05280f62c69266c958686ed9c..6ecf37ceb44f60de81cd35d463fd44629e0351b2 100644 --- a/src/components/Visualization/VisualizationFill.js +++ b/src/components/Visualization/VisualizationFill.js @@ -336,6 +336,7 @@ export default function VisualizationFill() { const result = mix.reduce(function (r, o) { console.log(r); const key = o.genome; + console.log(o.genome); const genome = path.basename(o.genome); const genomePath = o.genome; if (!helper[key]) { diff --git a/src/hooks/useConfig.js b/src/hooks/useConfig.js index 6a642bdd2447cd69942bc0cbae81e15417c7a154..129a9f185c1a09d41c47a60b826d729bef0b5d2a 100644 --- a/src/hooks/useConfig.js +++ b/src/hooks/useConfig.js @@ -53,24 +53,22 @@ const useProvideConfig = () => { homepath: "", }, method: "bins", - stat: "score", - annot: "", + binsize: 1000, + stepsize: 1000, + stat: "F", + overdispersion: "none", + pValueThreshold: 0.01, + minReadsPerCytosine: 10, + minProportionDifference: 0.25, + contexts: ["CpG"], genome: "", + species: "", + annot: "", remoteDir: "", - binsize: 200, - pseudocountN: 2, - pseudocountM: 1, - pValueThreshold: 0.05, - minCytosinesCount: 4, - minProportionDifference: 0.4, - minGap: 0, - minSize: 50, - minReadsPerCytosine: 4, outdir: "", remote: false, cluster: false, - contexts: ["CG"], - kernelFunction: "triangular", + contexts: ["CpG"], jobs: "10", }; const [runState, setRunState] = useState(initialRun);