0

I would like to return some values from a loop with or without using a function. My current script is like this, here I am interested in retrieving the value "parameter" and the individual values might be something like this - general_option=true, targeted_option=true, minReads=2, mxVariants=10, target_interval=/path/to/file.txt, minimumReads=4, cap_dup=2;

def analysis_parameters(general_option, targeted_option, minReads, mxVariants, target_interval, minimumReads, cap_dup):
if general_option is 'true':
    parameters=['--minReads='+minReads+' --maxVariants='+mxVariants]
    return parameters
elif targeted_option is 'true':
    parameters=['--regions='+target_interval+' --minReads='+minimumReads+' --filterDuplicates='+cap_dup]
    return parameters

Any help is very much appreciated.

1 Answer 1

1

Why not use a single return statement?

if general_option is 'true':
    parameters = ['--minReads=' + minReads + ' --maxVariants=' + mxVariants]
elif targeted_option is 'true':
    parameters = ['--regions=' + target_interval + ' --minReads=' + minimumReads + ' --filterDuplicates=' + cap_dup]
return parameters
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.