-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #134 from GlobalPneumoSeq/dev
Release Version 1.0.0-rc11
- Loading branch information
Showing
16 changed files
with
376 additions
and
334 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,55 @@ | ||
# Determine overall QC result based on File Validity, Read QC, Assembly QC, Mapping QC and Taxonomy QC | ||
# In case File Validity is not PASS, save its value (i.e. description of the issue) to Overall QC | ||
# In case of assembler failure, there will be no Assembly QC input, save ASSEMBLER FAILURE to Overall QC | ||
|
||
if [[ ! "$FILE_VALIDITY" == "PASS" ]]; then | ||
OVERALL_QC="$FILE_VALIDITY" | ||
elif [[ "$READ_QC" == "PASS" ]] && [[ "$ASSEMBLY_QC" == "PASS" ]] && [[ "$MAPPING_QC" == "PASS" ]] && [[ "$TAXONOMY_QC" == "PASS" ]]; then | ||
OVERALL_QC="PASS" | ||
elif [[ "$READ_QC" == "PASS" ]] && [[ "$ASSEMBLY_QC" == "null" ]]; then | ||
OVERALL_QC="ASSEMBLER FAILURE" | ||
else | ||
OVERALL_QC="FAIL" | ||
fi | ||
# In case of preprocess/assembly/mapping/taxonomy failure, there will be no relevant QC input, save corresponding MODULE FAILURE to Overall QC | ||
|
||
assign_overall_qc() { | ||
if [[ "$FILE_VALIDITY" == "null" ]]; then | ||
OVERALL_QC="FILE VALIDATION FAILURE" | ||
return | ||
fi | ||
|
||
if [[ ! "$FILE_VALIDITY" == "PASS" ]]; then | ||
OVERALL_QC="$FILE_VALIDITY" | ||
return | ||
fi | ||
|
||
if [[ "$READ_QC" == "null" ]]; then | ||
OVERALL_QC="PREPROCESS MODULE FAILURE" | ||
return | ||
fi | ||
|
||
if [[ "$READ_QC" == "FAIL" ]]; then | ||
OVERALL_QC="FAIL" | ||
return | ||
fi | ||
|
||
OVERALL_QC="" | ||
|
||
if [[ "$ASSEMBLY_QC" == "null" ]]; then | ||
OVERALL_QC+="ASSEMBLY MODULE FAILURE;" | ||
fi | ||
|
||
if [[ "$MAPPING_QC" == "null" ]]; then | ||
OVERALL_QC+="MAPPING MODULE FAILURE;" | ||
fi | ||
|
||
if [[ "$TAXONOMY_QC" == "null" ]]; then | ||
OVERALL_QC+="TAXONOMY MODULE FAILURE;" | ||
fi | ||
|
||
if [[ ! "$OVERALL_QC" == "" ]]; then | ||
OVERALL_QC="${OVERALL_QC%;}" | ||
return | ||
fi | ||
|
||
if [[ "$READ_QC" == "PASS" ]] && [[ "$ASSEMBLY_QC" == "PASS" ]] && [[ "$MAPPING_QC" == "PASS" ]] && [[ "$TAXONOMY_QC" == "PASS" ]]; then | ||
OVERALL_QC="PASS" | ||
else | ||
OVERALL_QC="FAIL" | ||
fi | ||
} | ||
|
||
assign_overall_qc | ||
|
||
echo \"Overall_QC\" > "$OVERALL_QC_REPORT" | ||
echo \""$OVERALL_QC"\" >> "$OVERALL_QC_REPORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,6 @@ | ||
# Run SeroBA to serotype samples | ||
|
||
{ | ||
seroba runSerotyping "${SEROBA_DB}" "$READ1" "$READ2" "$SAMPLE_ID" && SEROTYPE=$(awk -F'\t' '{ print $2 }' "${SAMPLE_ID}/pred.tsv") | ||
} || { | ||
SEROTYPE="SEROBA FAILURE" | ||
} | ||
seroba runSerotyping "${SEROBA_DB}" "$READ1" "$READ2" "$SAMPLE_ID" && SEROTYPE=$(awk -F'\t' '{ print $2 }' "${SAMPLE_ID}/pred.tsv") | ||
|
||
echo \"Serotype\" > "$SEROTYPE_REPORT" | ||
echo \""$SEROTYPE"\" >> "$SEROTYPE_REPORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,35 +1,30 @@ | ||
# Extract the results from the output file of the PBP AMR predictor | ||
|
||
# For all, replace null or space-only string with empty string | ||
# For all, replace null, empty, or space-only string with underscore | ||
|
||
function GET_VALUE { | ||
< "$JSON_FILE" jq -r --arg target "$1" '.[$target]' \ | ||
| sed 's/^null$//g;s/^\s+$//g' | ||
} | ||
|
||
function GET_RES { | ||
< "$JSON_FILE" jq -r --arg target "$1" '.[$target]' \ | ||
| sed 's/^null$//g;s/^\s+$//g' | ||
| sed 's/^\(null\|\s*\)$/_/g' | ||
} | ||
|
||
pbp1a=$(GET_VALUE "pbp1a") | ||
pbp2b=$(GET_VALUE "pbp2b") | ||
pbp2x=$(GET_VALUE "pbp2x") | ||
AMO_MIC=$(GET_VALUE "amxMic") | ||
AMO=$(GET_RES "amx") | ||
AMO=$(GET_VALUE "amx") | ||
CFT_MIC=$(GET_VALUE "croMic") | ||
CFT_NONMENINGITIS=$(GET_RES "croNonMeningitis") | ||
CFT_MENINGITIS=$(GET_RES "croMeningitis") | ||
CFT_NONMENINGITIS=$(GET_VALUE "croNonMeningitis") | ||
CFT_MENINGITIS=$(GET_VALUE "croMeningitis") | ||
TAX_MIC=$(GET_VALUE "ctxMic") | ||
TAX_NONMENINGITIS=$(GET_RES "ctxNonMeningitis") | ||
TAX_MENINGITIS=$(GET_RES "ctxMeningitis") | ||
TAX_NONMENINGITIS=$(GET_VALUE "ctxNonMeningitis") | ||
TAX_MENINGITIS=$(GET_VALUE "ctxMeningitis") | ||
CFX_MIC=$(GET_VALUE "cxmMic") | ||
CFX=$(GET_RES "cxm") | ||
CFX=$(GET_VALUE "cxm") | ||
MER_MIC=$(GET_VALUE "memMic") | ||
MER=$(GET_RES "mem") | ||
MER=$(GET_VALUE "mem") | ||
PEN_MIC=$(GET_VALUE "penMic") | ||
PEN_NONMENINGITIS=$(GET_RES "penNonMeningitis") | ||
PEN_MENINGITIS=$(GET_RES "penMeningitis") | ||
PEN_NONMENINGITIS=$(GET_VALUE "penNonMeningitis") | ||
PEN_MENINGITIS=$(GET_VALUE "penMeningitis") | ||
|
||
echo \"pbp1a\",\"pbp2b\",\"pbp2x\",\"AMO_MIC\",\"AMO_Res\",\"CFT_MIC\",\"CFT_Res\(Meningital\)\",\"CFT_Res\(Non-meningital\)\",\"TAX_MIC\",\"TAX_Res\(Meningital\)\",\"TAX_Res\(Non-meningital\)\",\"CFX_MIC\",\"CFX_Res\",\"MER_MIC\",\"MER_Res\",\"PEN_MIC\",\"PEN_Res\(Meningital\)\",\"PEN_Res\(Non-meningital\)\" > "$PBP_AMR_REPORT" | ||
echo \""$pbp1a"\",\""$pbp2b"\",\""$pbp2x"\",\""$AMO_MIC"\",\""$AMO"\",\""$CFT_MIC"\",\""$CFT_MENINGITIS"\",\""$CFT_NONMENINGITIS"\",\""$TAX_MIC"\",\""$TAX_MENINGITIS"\",\""$TAX_NONMENINGITIS"\",\""$CFX_MIC"\",\""$CFX"\",\""$MER_MIC"\",\""$MER"\",\""$PEN_MIC"\",\""$PEN_MENINGITIS"\",\""$PEN_NONMENINGITIS"\" >> "$PBP_AMR_REPORT" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.