From cfdc6fcd37a4036d8bcca27bc7e120e60a94998d Mon Sep 17 00:00:00 2001 From: Eric Coissac Date: Sun, 9 Oct 2016 04:24:08 -0300 Subject: [PATCH] For a given protein consider only cluster with at list a score of 95% of the best score --- detectors/cds/lib/bestclust.awk | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/detectors/cds/lib/bestclust.awk b/detectors/cds/lib/bestclust.awk index 5354a0a..5634516 100644 --- a/detectors/cds/lib/bestclust.awk +++ b/detectors/cds/lib/bestclust.awk @@ -77,7 +77,7 @@ BEGIN { } END { - + ClustScoreMax=0 # make clusters pi = -1 for (i in Cover) { @@ -103,12 +103,29 @@ END { Clust[clusno]["score"] = score Clust[clusno]["strand"] = Entry[i]["strand"] Clust[clusno]["entry"] = i + + if (score > ClustScoreMax) + ClustScoreMax=score } } + + # Consider only cluster with at least 95% of the best score + + NbClustOk=0 + for (i = 1 ; i <= NbClust ; i++) { + if (Clust[i]["score"] >= ClustScoreMax * 0.95) + NbClustOk++ + else + Clust[i]["score"]=0 + + } + + # print cluster info - print "c nclust", NbClust+0 + print "c nclust", NbClustOk+0 for (i = 1 ; i <= NbClust ; i++) { + if (Clust[i]["score"] == 0) continue print "c cluster", i, "from", Clust[i]["from"], "to", Clust[i]["to"],\ "strand", Clust[i]["strand"], "score", Clust[i]["score"] } -- libgit2 0.26.0