Skip to content

Commit 06b27a0

Browse files
committed
Add pri and prf prefix in convertblastdb
1 parent 4341f08 commit 06b27a0

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/util/convertblastdb.cpp

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,8 +1237,27 @@ static void parseSeqidList(const unsigned char *b, size_t n, size_t nodePos, std
12371237
}
12381238
}
12391239

1240-
// rank order: 0 = accession+version, 1 = accession, 2 = db|tag, 3 = gi|..., 4 = name, 5 = empty
1240+
// rank order: accession+version, pir|..., prf||..., accession, db|tag, gi|..., name, empty
12411241
static std::pair<int, std::string> formatId(const SeqId &sid) {
1242+
if (sid.which == 6 /* PIR */ && !sid.accession.empty()) {
1243+
std::string s = "pir|";
1244+
s += sid.accession;
1245+
s += "|";
1246+
if (!sid.name.empty()) {
1247+
s += sid.name;
1248+
}
1249+
return std::make_pair(1, s);
1250+
}
1251+
1252+
if (sid.which == 13 /* PRF */) {
1253+
if (!sid.name.empty()) {
1254+
return {4, std::string("prf||") + sid.name};
1255+
}
1256+
if (!sid.accession.empty()) {
1257+
return {1, std::string("prf||") + sid.accession};
1258+
}
1259+
}
1260+
12421261
if (!sid.accession.empty()) {
12431262
if (!sid.version.empty()) {
12441263
size_t dot = sid.accession.rfind('.');

0 commit comments

Comments
 (0)