Skip to content
Permalink
main
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 22 lines (21 sloc) 692 Bytes
REGIONS="$1" # e.g. svim_ambiguous_regions.txt
METHOD="$2" # e.g. svim
VCF_FILE="$3" # $FILTERED_VCFS/svim_sorted_filtered.vcf.gz
vcf="$(zgrep -v '^#' "$VCF_FILE")"
line_num=0
while read -r line;
do
((line_num++))
genotypes="$line_num"
svs=$(echo "$line" | grep "'$METHOD[[:alnum:]._-]*'" -o | tr -d "\'")
[ -z "$svs" ] && continue # if no svim svs are found in that line
sv_cnt=0
while read -r sv;
do
[ $sv_cnt -eq 0 ] && genotypes=$(getpos "$sv")
((sv_cnt++))
genotypes="$genotypes $(echo "$vcf" |
awk -F'\t' -v "SV=$sv" '$3~SV {split($10,a,":");print a[1], $6}')"
done <<< "$svs"
echo "$genotypes"
done < "$REGIONS"