Skip to content

Commit

Permalink
Readded comments for user clarity
Browse files Browse the repository at this point in the history
  • Loading branch information
kjaisingh committed Jan 28, 2025
1 parent 6512861 commit bd4473f
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sv-pipeline/04_variant_resolution/scripts/IntegrateGQ.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,22 @@ zcat "$pegeno_indiv_file" | \
awk -v OFS="\t" '
ARGIND==1 {
if ($5 == "DEL") {
del[$4] # e.g. del["variant_id"]
del[$4]
} else {
nodel[$4]
}
next
}
ARGIND==2 {
if ($1 in del) {
##Deletions, need to PE-SR genotypes to match RD format (2==ref)##
final_gt = ($4>1 ? 0 : ($4==1 ? 1 : 2))
print $1"@"$2, $1, $2, $4, final_gt, $5
} else if ($1 in nodel) {
##Duplications and other events, need to PE-SR genotypes to match RD (2==ref)##
final_gt = ($4>0 ? $4+2 : 2)
print $1"@"$2, $1, $2, $4, final_gt, $5
}
# If $1 not in either array, do nothing.
}
' int.bed - \
| awk '!seen[$1]++' \
Expand All @@ -69,9 +70,11 @@ awk -v OFS="\t" '
}
ARGIND==2 {
if ($1 in del) {
##Deletions, need to PE-SR genotypes to match RD format (2==ref)##
final_gt = ($4>1 ? 0 : ($4==1 ? 1 : 2))
print $1"@"$2, $1, $2, $4, final_gt, $5
} else if ($1 in nodel) {
##Duplications and other events, need to PE-SR genotysrs to match RD (2==ref)##
final_gt = ($4>0 ? $4+2 : 2)
print $1"@"$2, $1, $2, $4, final_gt, $5
}
Expand Down

0 comments on commit bd4473f

Please sign in to comment.