-
Notifications
You must be signed in to change notification settings - Fork 73
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
ExpansionHunter extract sex from a ped file. #281
Conversation
wdl/ExpansionHunter.wdl
Outdated
sex="" | ||
if [ ! -z "~{ped_filename}" -a "~{ped_filename}" != " " ]; then | ||
if [ -e "~{ped_filename}" ]; then | ||
sex=$(awk -F '\t' '{if ($2 == "~{individual_id}") {if ($5 == "1") {print "--sex male"; exit 0} else if ($5 == "2") {print "--sex female"; exit 0} else {exit 1}}}' < ~{ped_filename} ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would actually try to emit a helpful error message if the sex is undefined. I think it would be best to define sex="NA"
if the ped file is provided. Then use print "NA"; exit 0
instead of exit 1
in the last if
clause. Then check the value of sex
below - if it's NA
then warn that either the sample id was not found or the sex is undefined and fail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check if the updated condition would be equally good.
Co-authored-by: Mark Walker <[email protected]>
Co-authored-by: Mark Walker <[email protected]>
Co-authored-by: Mark Walker <[email protected]>
Co-authored-by: Mark Walker <[email protected]>
Co-authored-by: Mark Walker <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! One minor suggestion.
Co-authored-by: Mark Walker <[email protected]>
Co-authored-by: Mark Walker <[email protected]>
# Conflicts: # wdl/ExpansionHunter.wdl
EH processes male and female samples differently; this PR adds a functionality where sample sex is extracted from a provided
PED
file.