Describe the bug
The find()
method doesn't use the Query
seqid
property to search against the seq_id
column, but rather, looks it up as an alias
.
To Reproduce
A Query
object like the below won't return any alias records:
let sr = SeqRepo::new("/usr/local/share/seqrepo", "latest").unwrap();
let alias_db = sr.alias_db();
let query = Query{
namespace: Some(Namespace::new("%")),
alias: Some("%".to_string()),
seqid: Some("yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl".to_string()),
current_only: false,
};
let _ = alias_db.find(&query, |record| {
println!("{:?}", record.unwrap());
});
The following, however, will work -- because alias
entries prefix GA4GH IDs with GS_
:
let sr = SeqRepo::new("/usr/local/share/seqrepo", "latest").unwrap();
let alias_db = sr.alias_db();
let query = Query{
namespace: Some(Namespace::new("%")),
alias: Some("%".to_string()),
seqid: Some("GS_yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl".to_string()),
current_only: false,
};
let _ = alias_db.find(&query, |record| {
println!("{:?}", record.unwrap());
});
Expected behavior
The above snippet should print this record when the givenseqid
arg is "yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl"
:
AliasDbRecord { seqalias_id: 9349420, seqid: "yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl", alias: "GS_yVj-SzT0jvX2CBlpieemKnZe9FTd1zQl", added: 2017-07-19T03:33:58, is_current: true, namespace: Namespace { value: "VMC" } }
Additional context
I'm guessing this was just a typo?