Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow required property with default value to be absent #159

Closed
wants to merge 2 commits into from

Conversation

sverhoeven
Copy link
Member

@sverhoeven sverhoeven commented May 27, 2024

Refs #154

Can be tested with

  1. Add default: output to packages/haddock3_catalog/public/catalog/haddock3.easy.yaml:global.schema.properties.run_dir
  2. yarn dev
  3. open haddock3-download application on http://localhost:3000
  4. Upload a workflow.cfg without run_dir key.
  5. It should be loaded and valid.

Copy link

netlify bot commented May 27, 2024

Deploy Preview for i-vresse-workflow-builder ready!

Name Link
🔨 Latest commit 436f7cb
🔍 Latest deploy log https://app.netlify.com/sites/i-vresse-workflow-builder/deploys/6654626937ed7400080c289c
😎 Deploy Preview https://deploy-preview-159--i-vresse-workflow-builder.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@sverhoeven
Copy link
Member Author

sverhoeven commented May 27, 2024

I tried to use defaults but then every parameter with a default value is filled in the workflow.cfg file.

For example with the testing instructions and no-rundir.zip, I got

mode = 'local'
molecules = [
  'processed-A2A-2oob.pdb',
  'processed-B2B-2oob.pdb',
]

postprocess = true
clean = true
offline = false
ncores = 6
run_dir = 'output'
preprocess = false
batch_type = 'slurm'
queue_limit = 100
concat = 1

[topoaa]

delenph = true

[rigidbody]

ambig_fname = 'ambig.tbl'
sampling = 1000
randorien = true
elecflag = true

[caprieval]

irmsd = true
fnat = true
lrmsd = true
ilrmsd = true
dockq = true
irmsd_cutoff = 10
fnat_cutoff = 5
receptor_chain = 'A'
ligand_chains = [
  'B',
]

sortby = 'score'
sort_ascending = true
alignment_method = 'sequence'
clt_threshold = 4
allatoms = false

[seletop]

select = 200

['caprieval.2']

irmsd = true
fnat = true
lrmsd = true
ilrmsd = true
dockq = true
irmsd_cutoff = 10
fnat_cutoff = 5
receptor_chain = 'A'
ligand_chains = [
  'B',
]

sortby = 'score'
sort_ascending = true
alignment_method = 'sequence'
clt_threshold = 4
allatoms = false

[flexref]

ambig_fname = 'ambig.tbl'
dihedrals_on = false
ssdihed = 'none'
error_dih = 10
dnarest_on = false
elecflag = true
sinter_rigid_final = 0.001

['caprieval.3']

irmsd = true
fnat = true
lrmsd = true
ilrmsd = true
dockq = true
irmsd_cutoff = 10
fnat_cutoff = 5
receptor_chain = 'A'
ligand_chains = [
  'B',
]

sortby = 'score'
sort_ascending = true
alignment_method = 'sequence'
clt_threshold = 4
allatoms = false

[emref]

ambig_fname = 'ambig.tbl'
dihedrals_on = false
dihedrals_scale = 200
ssdihed = 'none'
error_dih = 10
dnarest_on = false
elecflag = true

['caprieval.4']

irmsd = true
fnat = true
lrmsd = true
ilrmsd = true
dockq = true
irmsd_cutoff = 10
fnat_cutoff = 5
receptor_chain = 'A'
ligand_chains = [
  'B',
]

sortby = 'score'
sort_ascending = true
alignment_method = 'sequence'
clt_threshold = 4
allatoms = false

[clustfcc]

plot_matrix = true
contact_distance_cutoff = 5
clust_cutoff = 0.6
min_population = 4
strictness = 0.75

[seletopclusts]

top_models = 4
top_cluster = 1000
sortby = 'score'

['caprieval.5']

irmsd = true
fnat = true
lrmsd = true
ilrmsd = true
dockq = true
irmsd_cutoff = 10
fnat_cutoff = 5
receptor_chain = 'A'
ligand_chains = [
  'B',
]

sortby = 'score'
sort_ascending = true
alignment_method = 'sequence'
clt_threshold = 4
allatoms = false

[contactmap]

ca_ca_dist_threshold = 9
shortest_dist_threshold = 4.5
color_ramp = 'Greys'
single_model_analysis = false
generate_heatmap = true
generate_chordchart = true
cluster_heatmap_datatype = 'shortest-cont-probability'
chordchart_datatype = 'shortest-dist'

This is not nice, as the user did not set most of those.

Setting the default value in the web app is not the way to go.
The builder page in the app should be given a schema without run dir property, but validation on server side (that happens after the run_dir is set to output) could still validate with the prop.

@sverhoeven sverhoeven closed this May 27, 2024
sverhoeven added a commit to i-VRESSE/haddock3-webapp that referenced this pull request May 27, 2024
The default value for run_dir did not work during validation.
As ajv has useDefaults:false, see i-VRESSE/workflow-builder#159 why that was not used.

Fixes i-VRESSE/workflow-builder#154
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant