Skip to content

Commit

Permalink
Add RNACentral ID column to gene result table
Browse files Browse the repository at this point in the history
  • Loading branch information
kimrutherford committed Jun 27, 2024
1 parent 50e3e04 commit b27c642
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/pombase/api/query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,7 @@ impl Query {
let mut reference_uniquenames = HashSet::new();
let mut tmm = None;
let mut pdb_ids = HashSet::new();
let mut rnacentral_id = None;
let mut gocam_ids = HashSet::new();
let mut molecular_weight = None;
let mut protein_length = None;
Expand Down Expand Up @@ -1103,6 +1104,7 @@ impl Query {
go_function = gene_data.go_function.clone(),
"tmm" => tmm = gene_data.tmm.clone(),
"pdb_ids" => pdb_ids = gene_data.pdb_ids.clone(),
"rnacentral_id" => rnacentral_id = gene_data.rnacentral_urs_identifier.clone(),
"gocam_ids" => gocam_ids = gene_data.gocam_ids.clone(),
"molecular_weight" =>
molecular_weight = gene_data.molecular_weight,
Expand All @@ -1125,7 +1127,7 @@ impl Query {
&gene_uniquename);
gene_expression.extend(results_measurements);
} else {
eprintln!("warning - no such option field: {}", field_name);
eprintln!("warning - no such field: {}", field_name);
}
}
}
Expand Down Expand Up @@ -1165,6 +1167,7 @@ impl Query {
unspliced_rna_length,
reference_uniquenames,
pdb_ids,
rnacentral_id,
gocam_ids,
subsets,
gene_expression,
Expand Down
2 changes: 2 additions & 0 deletions src/pombase/api/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ pub struct ResultRow {
pub reference_uniquenames: HashSet<ReferenceUniquename>,
#[serde(skip_serializing_if="HashSet::is_empty", default)]
pub pdb_ids: HashSet<PdbId>,
#[serde(skip_serializing_if="Option::is_none")]
pub rnacentral_id: Option<FlexStr>,
#[serde(skip_serializing_if="HashSet::is_empty", default)]
pub gocam_ids: HashSet<GoCamId>,
#[serde(skip_serializing_if="HashSet::is_empty", default)]
Expand Down
2 changes: 2 additions & 0 deletions src/pombase/data_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2229,6 +2229,8 @@ pub struct GeneQueryData {
pub subset_termids: HashSet<TermId>,
#[serde(skip_serializing_if="HashSet::is_empty", default)]
pub pdb_ids: HashSet<PdbId>,
#[serde(skip_serializing_if="Option::is_none")]
pub rnacentral_urs_identifier: Option<FlexStr>,
#[serde(skip_serializing_if="HashSet::is_empty", default)]
pub gocam_ids: HashSet<GoCamId>,
}
Expand Down
2 changes: 2 additions & 0 deletions src/pombase/web/data_build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5126,6 +5126,7 @@ phenotypes, so just the first part of this extension will be used:
let pdb_ids = gene_details.pdb_entries.iter()
.map(|pdb_entry| pdb_entry.pdb_id.clone())
.collect();
let rnacentral_urs_identifier = gene_details.rnacentral_urs_identifier.clone();
let gocam_ids =
gene_details.gocams.iter().map(|gocam| gocam.gocam_id.clone()).collect();

Expand All @@ -5147,6 +5148,7 @@ phenotypes, so just the first part of this extension will be used:
unspliced_rna_length,
reference_uniquenames,
pdb_ids,
rnacentral_urs_identifier,
gocam_ids,
subset_termids: gene_details.subset_termids.clone(),
};
Expand Down
3 changes: 3 additions & 0 deletions tests/test_query.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,7 @@ async fn test_output_options() {
gaf_lines: None,
reference_uniquenames: HashSet::new(),
pdb_ids: HashSet::new(),
rnacentral_id: None,
gocam_ids: HashSet::new(),
subsets: HashSet::new(),
gene_expression: vec![],
Expand All @@ -205,6 +206,7 @@ async fn test_output_options() {
gaf_lines: None,
reference_uniquenames: HashSet::new(),
pdb_ids: HashSet::new(),
rnacentral_id: None,
gocam_ids: HashSet::new(),
subsets: HashSet::new(),
gene_expression: vec![],
Expand Down Expand Up @@ -232,6 +234,7 @@ async fn test_output_options() {
gaf_lines: None,
reference_uniquenames: HashSet::new(),
pdb_ids: HashSet::new(),
rnacentral_id: None,
gocam_ids: HashSet::new(),
subsets: HashSet::new(),
gene_expression: vec![],
Expand Down

0 comments on commit b27c642

Please sign in to comment.