From 001c1dcac1aa901dbc4aad4225617857e1b682b8 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 Former-commit-id: cfdc6fcd37a4036d8bcca27bc7e120e60a94998d Former-commit-id: f45bb7922f28165fd3baa1bc67bf815a759d1590 --- detectors/cds/lib/bestclust.awk | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 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 } } - # print cluster info - print "c nclust", NbClust+0 + + # 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", 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"] }