{"action":"created","issue":{"url":"https://api.github.com/repos/nextflow-io/nextflow/issues/818","repository_url":"https://api.github.com/repos/nextflow-io/nextflow","labels_url":"https://api.github.com/repos/nextflow-io/nextflow/issues/818/labels{/name}","comments_url":"https://api.github.com/repos/nextflow-io/nextflow/issues/818/comments","events_url":"https://api.github.com/repos/nextflow-io/nextflow/issues/818/events","html_url":"https://github.com/nextflow-io/nextflow/issues/818","id":345676919,"node_id":"MDU6SXNzdWUzNDU2NzY5MTk=","number":818,"title":"possible to override conflicting parameters given on the command line?","user":{"login":"bio15anu","id":35332383,"node_id":"MDQ6VXNlcjM1MzMyMzgz","avatar_url":"https://avatars1.githubusercontent.com/u/35332383?v=4","gravatar_id":"","url":"https://api.github.com/users/bio15anu","html_url":"https://github.com/bio15anu","followers_url":"https://api.github.com/users/bio15anu/followers","following_url":"https://api.github.com/users/bio15anu/following{/other_user}","gists_url":"https://api.github.com/users/bio15anu/gists{/gist_id}","starred_url":"https://api.github.com/users/bio15anu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bio15anu/subscriptions","organizations_url":"https://api.github.com/users/bio15anu/orgs","repos_url":"https://api.github.com/users/bio15anu/repos","events_url":"https://api.github.com/users/bio15anu/events{/privacy}","received_events_url":"https://api.github.com/users/bio15anu/received_events","type":"User","site_admin":false},"labels":[{"id":33572984,"node_id":"MDU6TGFiZWwzMzU3Mjk4NA==","url":"https://api.github.com/repos/nextflow-io/nextflow/labels/kind/question","name":"kind/question","color":"cc317c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-07-30T09:20:49Z","updated_at":"2018-07-30T10:10:57Z","closed_at":null,"author_association":"NONE","body":"I am thinking of a case scenario where the user has erroneously specified conflicting parameters on the command line, such as params.one and params.two for example. Is there a mechanism where one can use a simple conditional to override one such parameter if they are found to occur together?\r\n\r\neg.\r\n`if ((params.one == true) && (params.two == true)) {params.two = false}`\r\n\r\nI haven't actually tested this but my understanding is that the command line would take priority over the main.nf script here so such a script would essentially be ignored?"},"comment":{"url":"https://api.github.com/repos/nextflow-io/nextflow/issues/comments/408814761","html_url":"https://github.com/nextflow-io/nextflow/issues/818#issuecomment-408814761","issue_url":"https://api.github.com/repos/nextflow-io/nextflow/issues/818","id":408814761,"node_id":"MDEyOklzc3VlQ29tbWVudDQwODgxNDc2MQ==","user":{"login":"pditommaso","id":816968,"node_id":"MDQ6VXNlcjgxNjk2OA==","avatar_url":"https://avatars0.githubusercontent.com/u/816968?v=4","gravatar_id":"","url":"https://api.github.com/users/pditommaso","html_url":"https://github.com/pditommaso","followers_url":"https://api.github.com/users/pditommaso/followers","following_url":"https://api.github.com/users/pditommaso/following{/other_user}","gists_url":"https://api.github.com/users/pditommaso/gists{/gist_id}","starred_url":"https://api.github.com/users/pditommaso/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pditommaso/subscriptions","organizations_url":"https://api.github.com/users/pditommaso/orgs","repos_url":"https://api.github.com/users/pditommaso/repos","events_url":"https://api.github.com/users/pditommaso/events{/privacy}","received_events_url":"https://api.github.com/users/pditommaso/received_events","type":"User","site_admin":false},"created_at":"2018-07-30T10:10:57Z","updated_at":"2018-07-30T10:10:57Z","author_association":"MEMBER","body":"This is not possible because `params` are only be supposed to overridden from the CLI or the config file, not from the script file. \r\n\r\nBest practice are to validate and throw an exception in case of wrong usage, ie: \r\n\r\n```\r\nif ( params.one && params.two ) { error \"Params one and two collide\" }\r\n```\r\n\r\nMore similar to your approach you can use an intermediate variable, ie: \r\n\r\n```\r\ntwo_flag = params.one && params.two ? false : params.two \r\n```\r\n"}}
{"actor":{"display_login":"pditommaso"}}