Practice AND Learn: AWK/CUT SED GREP
Q: how to use variable in awk?
reference:
$ myvar="Linux Hint"
$ echo | awk -v awkvar='$myvar' '{ print awkvar; }'
$ echo | awk -v awkvar="$myvar" '{ print awkvar; }'
Usage:
cat barcode05.vcf|awk -F'\t' '$7 "PASS"'|grep "=BND"|grep 'PASS'$'\t''PRECISE' |awk '$1 ~ /^chr(1?[0-9]|2[0-2]|X|Y)$/'|sed "/chrUn/d"|sed "/random/d"|sed "/_alt/d"|awk -F'[;=]' '{if ($5>="2") print}'|awk -F'[\t\]\[:]' '{print $1"\t"$6}'|sort -u|while read i j ; do grep -w "$i.*$j" tempp; done|sort -u>temppp; cat temppp|while read i j ; do grep -w "$j.*$i" temppp; done|sort -k1|uniq|while read i j ; do awk -F'[\t;=]' -v a="$i" -v b="$j" '{if($1==a && $20==b) print }' barcode05-vcf.txt; done
#Knowlegde is FREE but Solution is Your's🤘🏻 #Keep on Learning and Executing...🏃🏻
BioInformaticsFuture.com!
Contact@:BioInformaticsFuture@gmail.com