Skip to content

Commit 51bc009

Browse files
committed
Add kraken taxreports to CF api
1 parent be5055c commit 51bc009

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

backend/worker.go

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -807,9 +807,10 @@ USE_ENV="$8"
807807
USE_TEMPLATES="$9"
808808
FILTER="${10}"
809809
TAXONOMY="${11}"
810-
M8OUT="${12}"
811-
GPU="${13}"
812-
GPUSERVER="${14}"
810+
TAXONOMYREPORT="${12}"
811+
M8OUT="${13}"
812+
GPU="${14}"
813+
GPUSERVER="${15}"
813814
EXPAND_EVAL=inf
814815
ALIGN_EVAL=10
815816
DIFF=3000
@@ -869,6 +870,13 @@ if [ "${TAXONOMY}" = "1" ] && [ -e "${DB1}_taxonomy" ]; then
869870
awk 'BEGIN { printf("%c%c%c%c",8,0,0,0); exit; }' > "${BASE}/res_exp_realign_tax.dbtype"
870871
MMSEQS_FORCE_MERGE=1 "${MMSEQS}" filtertaxdb "${DB1}" "${BASE}/res_exp_realign_tax" "${BASE}/res_exp_realign_tax_filt" --taxon-list '!12908&&!28384'
871872
tr -d '\000' < "${BASE}/res_exp_realign_tax_filt" | sort -u > "${BASE}/uniref_tax.tsv"
873+
"${MMSEQS}" rmdb "${BASE}/res_exp_realign_tax_filt"
874+
"${MMSEQS}" rmdb "${BASE}/res_exp_realign_tax"
875+
fi
876+
if [ "${TAXONOMYREPORT}" = "1" ] && [ -e "${DB1}_taxonomy" ]; then
877+
"${MMSEQS}" taxonomyreport "${DB1}.idx" "${BASE}/res_exp_realign_filter" "${BASE}/res_exp_realign_taxreport" --report-mode 3
878+
"${MMSEQS}" createtsv "${BASE}/qdb" "${BASE}/res_exp_realign_taxreport" "${BASE}/uniref_taxreport.tsv" --db-load-mode 2
879+
"${MMSEQS}" rmdb "${BASE}/res_exp_realign_taxreport"
872880
fi
873881
"${MMSEQS}" rmdb "${BASE}/res_exp_realign_filter"
874882
`)
@@ -937,6 +945,7 @@ rm -rf -- "${BASE}/tmp1" "${BASE}/tmp2" "${BASE}/tmp3"
937945
useTemplates := isIn("notemplates", modes) == -1
938946
useFilter := isIn("nofilter", modes) == -1
939947
taxonomy := isIn("taxonomy", modes) == 1
948+
taxonomyreport := isIn("taxonomyreport", modes) == 1
940949
m8out := isIn("m8output", modes) == 1
941950
var b2i = map[bool]int{false: 0, true: 1}
942951

@@ -961,6 +970,7 @@ rm -rf -- "${BASE}/tmp1" "${BASE}/tmp2" "${BASE}/tmp3"
961970
strconv.Itoa(b2i[useTemplates]),
962971
strconv.Itoa(b2i[useFilter]),
963972
strconv.Itoa(b2i[taxonomy]),
973+
strconv.Itoa(b2i[taxonomyreport]),
964974
strconv.Itoa(b2i[m8out]),
965975
gpuEnabled,
966976
gpuServerEnabled,
@@ -1065,6 +1075,14 @@ rm -rf -- "${BASE}/tmp1" "${BASE}/tmp2" "${BASE}/tmp3"
10651075
os.Remove(path)
10661076
}
10671077

1078+
if taxonomyreport {
1079+
path = filepath.Join(resultBase, "uniref_taxreport.tsv")
1080+
if err := addFile(tw, path); err != nil {
1081+
return err
1082+
}
1083+
os.Remove(path)
1084+
}
1085+
10681086
if useTemplates {
10691087
path = filepath.Join(resultBase, "pdb70.m8")
10701088
if err := addFile(tw, path); err != nil {

0 commit comments

Comments
 (0)