Skip to content

Commit

Permalink
Merge pull request #5 from eastgenomics/URA-91_NA_fix
Browse files Browse the repository at this point in the history
Ura 91 v1.0.2 na fix
  • Loading branch information
Aisha-D authored Mar 28, 2022
2 parents e70993d + c79226e commit 3974902
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
8 changes: 4 additions & 4 deletions dxapp.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "eggd_somalier_relate2multiqc_v1.0.1",
"title": "eggd_somalier_relate2multiqc_v1.0.1",
"name": "eggd_somalier_relate2multiqc_v1.0.2",
"title": "eggd_somalier_relate2multiqc_v1.0.2",
"summary": "Reformats somalier output somalier.samples.tsv to append predicted sex to file and it is in a suitable format for multiqc",
"dxapi": "1.0.1",
"dxapi": "1.0.2",
"properties": {
"githubRelease": "v1.0.1"
"githubRelease": "v1.0.2"
},
"inputSpec": [
{
Expand Down
12 changes: 7 additions & 5 deletions resources/home/dnanexus/reformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,18 +195,20 @@ def matching_sexes(data):
lambda x: mappings.get(str(x))
)

# Need to create a column called match that has true/false boolean
# Need to create a column called match that has true/false boolean
# for every row, stating whether they match between reported and
# predicted sex. If reported is unknown/none, then match is NA
# predicted sex. If reported is unknown/none, then matching sex is NA

data["Match_Sexes"] = "NA"

# If reported sex is not unknown or none, then see if reported and
# If reported sex is not unknown or none, then see if reported and
# predicted sex is a match (false/true boolean)
# If predicted sex is unknown, matching sex will be reported as NA
for idx, row in data.iterrows():
if not (row['original_pedigree_sex'] == "unknown" or row['original_pedigree_sex'] == "none"):
if not (row['original_pedigree_sex'] == "unknown" or row['original_pedigree_sex'] == "none"
or row['Predicted_Sex'] == "unknown"):
data.at[idx, 'Match_Sexes'] = row['original_pedigree_sex'] == row['Predicted_Sex']
# need to make the false/true boolean to string to make it
# need to make the false/true boolean to string to make it
# lower case for multiqc
data.at[idx, 'Match_Sexes'] = str(data.at[idx, 'Match_Sexes']).lower()

Expand Down

0 comments on commit 3974902

Please sign in to comment.