[go: up one dir, main page]

Menu

[78dfa4]: / makeagp.awk  Maximize  Restore  History

Download this file

36 lines (33 with data), 920 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#awk [-vprefix=CHR -vlg=1 -vgapLength=100] -f makeagp.awk chr1.la
BEGIN{
map["+"]="+"
map["++"]="+"
map["+++"]="+"
map["-"]="-"
map["--"]="-"
map["---"]="-"
map[""]="+"
map["?"]="+"
if (lg == "")
lg = 1
if (prefix == "")
prefix = "CHR"
suffix = 1
if (gapLength == "")
gapLength = 100
}
(/^[^#]/ && /^[^$]/ && $3-$2>=0){
if (n != "") {
if ($4=="?" || (($4 == "+" || $4 == "-") && (prevO != "+" && prevO != "-")) || (($4 == "++" || $4 == "--") && (prevO != "++" && prevO != "--")) || (($4 == "+++" || $4 == "---") && (prevO != "+++" && prevO != "---"))) {
++suffix
pos = 0
n = ""
} else if (gapLength > 0){
print prefix lg "." suffix "\t" pos + 1 "\t" pos + gapLength "\t" ++n "\tU\t" gapLength "\tcontig\tno\tna"
pos += gapLength
}
}
print prefix lg "." suffix "\t" pos + 1 "\t" pos + ($3-$2+1) "\t" ++n "\tW\t" $1 "\t" $2 "\t" $3 "\t" map[$4]
pos += ($3-$2+1)
prevO = $4
}