Skip to content

Commit

Permalink
1.5.0: Rank now based on score, evalue and profile name
Browse files Browse the repository at this point in the history
  • Loading branch information
erikrikarddaniel committed Feb 19, 2022
1 parent 9863253 commit 7ab062d
Show file tree
Hide file tree
Showing 14 changed files with 67,117 additions and 14 deletions.
2 changes: 1 addition & 1 deletion conda/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% set version = "1.4.3" %}
{% set version = "1.5.0" %}

package:
name: hmmrank
Expand Down
8 changes: 7 additions & 1 deletion src/R-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CHECK = if [ ` $(DIFF) | wc -l ` -eq 0 ]; then echo "*** $@ OK ***"; else echo "

all: hmmrank

hmmrank: hmmrank.00 hmmrank.01 hmmrank.02 hmmrank.03 hmmrank.04 hmmrank.05 hmmrank.06 hmmrank.07 hmmrank.08 #hmmrank.09
hmmrank: hmmrank.00 hmmrank.01 hmmrank.02 hmmrank.03 hmmrank.04 hmmrank.05 hmmrank.06 hmmrank.07 hmmrank.08 hmmrank.10

hmmrank.00:
../R/hmmrank.r --outfile=$@.out $@.d/*.tblout
Expand Down Expand Up @@ -46,6 +46,12 @@ hmmrank.08:
@$(CHECK)

# I was missing entries with the classical accept score table
# NOT FINISHED -- DOESN'T WORK
hmmrank.09:
../R/hmmrank.r --annottable=$@.annottable.tsv --minscore=30 --maxscore=100 --scorefile=$@.d/profile_accept_scores.tsv --outfile=$@.out $@.d/*.tblout
@$(CHECK)

# Duplicate bitscores
hmmrank.10:
../R/hmmrank.r --only_best_scoring --outfile=$@.out $@.d/*.tblout
@$(CHECK)
6 changes: 3 additions & 3 deletions src/R-test/hmmrank.06.expect
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ envision.uc0.99_ENV3_S3_k141_286858_3_1 PF06180 3.2e-6 34.3 26.2 1 All CbiK 4.99
envision.uc0.99_ENV3_S6_k141_296524_2_1 PF06180 2.5e-5 31.4 26.2 1 All CbiK 4.99.1.3 T
envision.uc0.99_ENV3_S6_k141_343739_1_1 PF02572 3.8e-57 200.9 25.7 1 All BtuR 2.5.1.17 T
testing_presence_in_all_TIGRFAMS TIGR01466 & TIGR01467 1e-10 200 200 1 All CobIJ 2.1.1.130 & 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 100 3 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 100 2 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01467 1e-10 100 100 3 All CobJ 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 3 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 3 All CobA 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 4 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 4 All CobA 2.1.1.107 F
6 changes: 3 additions & 3 deletions src/R-test/hmmrank.07.expect
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ envision.uc0.99_ENV3_S3_k141_286858_3_1 PF06180 3.2e-6 34.3 26.2 1 All CbiK 4.99
envision.uc0.99_ENV3_S6_k141_296524_2_1 PF06180 2.5e-5 31.4 26.2 1 All CbiK 4.99.1.3 T
testing_presence_in_all_TIGRFAMS TIGR01466 & TIGR01467 1e-10 200 200 1 Bacteria CobIJ 2.1.1.130 & 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01466 & TIGR01467 1e-10 200 200 1 Archaea CobIJ 2.1.1.130 & 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 100 3 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 100 2 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01467 1e-10 100 100 3 All CobJ 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 3 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 3 All CobA 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 4 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 100 4 All CobA 2.1.1.107 F
6 changes: 3 additions & 3 deletions src/R-test/hmmrank.08.expect
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ envision.uc0.99_ENV3_S3_k141_286858_3_1 PF06180 3.2e-6 34.3 26.2 1 All CbiK 4.99
envision.uc0.99_ENV3_S6_k141_296524_2_1 PF06180 2.5e-5 31.4 26.2 1 All CbiK 4.99.1.3 T
testing_presence_in_all_TIGRFAMS TIGR01466 & TIGR01467 1e-10 200 409.6 1 Bacteria CobIJ 2.1.1.130 & 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01466 & TIGR01467 1e-10 200 409.6 1 Archaea CobIJ 2.1.1.130 & 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 246.35 3 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01466 1e-10 100 246.35 2 All CobI 2.1.1.130 T
testing_presence_in_all_TIGRFAMS TIGR01467 1e-10 100 163.25 3 All CobJ 2.1.1.131 T
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 185 3 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 185 3 All CobA 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 185 4 All CysG 2.1.1.107 F
testing_presence_in_all_TIGRFAMS TIGR01469 1e-10 100 185 4 All CobA 2.1.1.107 F
10,236 changes: 10,236 additions & 0 deletions src/R-test/hmmrank.10.d/BtuB.tblout

Large diffs are not rendered by default.

13,379 changes: 13,379 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB00.tblout

Large diffs are not rendered by default.

3,739 changes: 3,739 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB02.tblout

Large diffs are not rendered by default.

3,334 changes: 3,334 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB03.tblout

Large diffs are not rendered by default.

3,075 changes: 3,075 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB04.tblout

Large diffs are not rendered by default.

5,336 changes: 5,336 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB05.tblout

Large diffs are not rendered by default.

10,655 changes: 10,655 additions & 0 deletions src/R-test/hmmrank.10.d/FPBtuB06.tblout

Large diffs are not rendered by default.

17,336 changes: 17,336 additions & 0 deletions src/R-test/hmmrank.10.expect

Large diffs are not rendered by default.

13 changes: 10 additions & 3 deletions src/R/hmmrank.r
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ suppressPackageStartupMessages(library(tidyr))
suppressPackageStartupMessages(library(data.table))
suppressPackageStartupMessages(library(stringr))

SCRIPT_VERSION = '1.4.3'
SCRIPT_VERSION = '1.5.0'

# Get arguments
# For interactive testing:
Expand All @@ -25,6 +25,9 @@ SCRIPT_VERSION = '1.4.3'
#
# TC06:
# opt <- list('options' = list('verbose' = TRUE, qfromfname = TRUE, minscore = 30, maxscore=100, scorefile = 'hmmrank.06.profile_scores.tsv', annottable = 'hmmrank.06.annottable.tsv'), 'args' = Sys.glob('hmmrank.06.d/*.tblout'))
#
# TC10 (ties):
# opt <- list('options' = list('verbose' = TRUE, qfromfname = FALSE, minscore = 0), 'args' = Sys.glob('hmmrank.10.d/*.tblout'))
option_list = list(
make_option(
'--annottable', type = "character",
Expand Down Expand Up @@ -175,14 +178,18 @@ if ( length(opt$options$annottable) > 0 ) {
filter(identical(sort(strsplit(profilecomb, '\\s*&\\s*')[[1]]), sort(strsplit(profiles, '\\s*&\\s*')[[1]]))) %>%
ungroup() %>%
group_by(accno) %>%
mutate(rank = rank(desc(score))) %>%
arrange(desc(score), evalue, profiles) %>%
mutate(rank = row_number()) %>%
ungroup() %>%
transmute(accno, profile = profilecomb, evalue, score, min_score, rank) %>%
inner_join(annottable, by = 'profile')
} else {
# We didn't have an annotation table, just calculate ranks
tblout <- lazy_dt(tblout) %>%
group_by(accno) %>% mutate(rank = rank(desc(score))) %>% ungroup() %>%
group_by(accno) %>%
arrange(desc(score), evalue, profile) %>%
mutate(rank = row_number()) %>%
ungroup() %>%
as_tibble()
}

Expand Down

0 comments on commit 7ab062d

Please sign in to comment.