Patch two bug in the best cluster selection
This commit is contained in:
@ -80,27 +80,34 @@ BEGIN {
|
|||||||
END {
|
END {
|
||||||
ClustScoreMax=0
|
ClustScoreMax=0
|
||||||
# make clusters
|
# make clusters
|
||||||
|
|
||||||
|
|
||||||
pi = -1
|
pi = -1
|
||||||
for (i in Cover) {
|
for (i in Cover) {
|
||||||
if (i+0 > pi+1)
|
if (i+0 > pi+1)
|
||||||
Clust[++NbClust]["from"] = i
|
Clust[++NbClust]["from"] = i
|
||||||
pi = Clust[NbClust]["to"] = i
|
pi = Clust[NbClust]["to"] = i
|
||||||
}
|
}
|
||||||
|
|
||||||
# get highest scoring clusters
|
# get highest scoring clusters
|
||||||
for (i = 1 ; i <= NbEntry ; i++) {
|
for (i = 1 ; i <= NbEntry ; i++) {
|
||||||
valid = Entry[i]["valid"]
|
valid = Entry[i]["valid"]
|
||||||
|
|
||||||
if (! valid) continue
|
if (! valid) continue
|
||||||
|
|
||||||
clusno = 0
|
clusno = 0
|
||||||
for (j = 1; j <= NbClust; j++) {
|
for (j = 1; j <= NbClust; j++) {
|
||||||
if ((Entry[i]["from"] >= Clust[j]["from"]) && (Entry[i]["to"] <= Clust[j]["to"]))
|
if ((Entry[i]["from"]+0 >= Clust[j]["from"]+0) && (Entry[i]["to"]+0 <= Clust[j]["to"]+0)) {
|
||||||
clusno = j
|
clusno = j
|
||||||
|
}
|
||||||
}
|
}
|
||||||
valid = (clusno != 0)
|
valid = (clusno != 0)
|
||||||
if (! valid) continue
|
if (! valid) continue
|
||||||
|
|
||||||
score = Entry[i]["score"]
|
score = Entry[i]["score"]
|
||||||
if (score > Clust[clusno]["score"]+0) {
|
pfrom = Entry[i]["from"]
|
||||||
|
if (score > Clust[clusno]["score"]+0 ||
|
||||||
|
(score == Clust[clusno]["score"]+0 && pfrom < Clust[clusno]["from"]+0)) {
|
||||||
Clust[clusno]["score"] = score
|
Clust[clusno]["score"] = score
|
||||||
Clust[clusno]["strand"] = Entry[i]["strand"]
|
Clust[clusno]["strand"] = Entry[i]["strand"]
|
||||||
Clust[clusno]["entry"] = i
|
Clust[clusno]["entry"] = i
|
||||||
@ -115,7 +122,7 @@ END {
|
|||||||
|
|
||||||
NbClustOk=0
|
NbClustOk=0
|
||||||
for (i = 1 ; i <= NbClust ; i++) {
|
for (i = 1 ; i <= NbClust ; i++) {
|
||||||
if (Clust[i]["score"] >= ClustScoreMax * 0.95)
|
if (Clust[i]["score"]+0 >= ClustScoreMax * 0.95)
|
||||||
NbClustOk++
|
NbClustOk++
|
||||||
else
|
else
|
||||||
Clust[i]["score"]=0
|
Clust[i]["score"]=0
|
||||||
@ -126,14 +133,14 @@ END {
|
|||||||
# print cluster info
|
# print cluster info
|
||||||
print "c nclust", NbClustOk+0
|
print "c nclust", NbClustOk+0
|
||||||
for (i = 1 ; i <= NbClust ; i++) {
|
for (i = 1 ; i <= NbClust ; i++) {
|
||||||
if (Clust[i]["score"] == 0) continue
|
if (Clust[i]["score"]+0 == 0) continue
|
||||||
print "c cluster", i, "from", Clust[i]["from"], "to", Clust[i]["to"],\
|
print "c cluster", i, "from", Clust[i]["from"], "to", Clust[i]["to"],\
|
||||||
"strand", Clust[i]["strand"], "score", Clust[i]["score"]
|
"strand", Clust[i]["strand"], "score", Clust[i]["score"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# print best clusters
|
# print best clusters
|
||||||
for (i = 1 ; i <= NbClust ; i++) {
|
for (i = 1 ; i <= NbClust ; i++) {
|
||||||
if (Clust[i]["score"] == 0) continue
|
if (Clust[i]["score"]+0 == 0) continue
|
||||||
j = Clust[i]["entry"]
|
j = Clust[i]["entry"]
|
||||||
s = Clust[i]["strand"]
|
s = Clust[i]["strand"]
|
||||||
n = Entry[j]["nbline"]
|
n = Entry[j]["nbline"]
|
||||||
|
Reference in New Issue
Block a user