Skip to content

Commit

Permalink
Query is_obsolete from Chado
Browse files Browse the repository at this point in the history
Not used for anything yet

Refs pombase/pombase-chado#1054
  • Loading branch information
kimrutherford committed Jan 17, 2023
1 parent 426796b commit f474203
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/pombase/db/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ pub struct Cvtermpath {
pub struct Feature {
pub uniquename: FlexStr,
pub name: Option<FlexStr>,
pub is_obsolete: bool,
pub feat_type: Rc<Cvterm>,
pub organism: Rc<ChadoOrganism>,
pub residues: Option<FlexStr>,
Expand Down Expand Up @@ -473,16 +474,18 @@ impl Raw {
}

for row in &conn.query(
"SELECT feature_id, uniquename, name, type_id, organism_id, residues FROM feature", &[]).await? {
"SELECT feature_id, uniquename, name, is_obsolete, type_id, organism_id, residues FROM feature", &[]).await? {
let feature_id = row.get(0);
let type_id: i32 = row.get(3);
let organism_id: i32 = row.get(4);
let residues: Option<String> = row.get(5);
let type_id: i32 = row.get(4);
let organism_id: i32 = row.get(5);
let residues: Option<String> = row.get(6);
let uniquename: String = row.get(1);
let name: Option<String> = row.get(2);
let is_obsolete: bool = row.get(3);
let feature = Feature {
uniquename: uniquename.to_shared_str(),
name: name.map(|s| s.to_shared_str()),
is_obsolete,
feat_type: get_cvterm(&mut cvterm_map, type_id),
organism: organism_map[&organism_id].clone(),
residues: residues.map(|s| s.to_shared_str()),
Expand Down
1 change: 1 addition & 0 deletions tests/test_db_json.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ ATGCTGATGCTAGATAGTGCATGTAGCTGTATTTATATCCGGATTAGCTACGTAGTGGCCTAATATATCGCAT"
organism: organism.clone(),
uniquename: uniquename.to_shared_str(),
name: name,
is_obsolete: false,
feat_type: type_cvterm.clone(),
residues: Some(residues.into()),
featurelocs: RefCell::new(vec![]),
Expand Down

0 comments on commit f474203

Please sign in to comment.