Skip to content

Commit

Permalink
hide genome browser tab when chromosome is absent; fix casing issue i…
Browse files Browse the repository at this point in the history
…n cCRE coordinate query
  • Loading branch information
hpratt committed Jan 27, 2022
1 parent b61c48e commit ad78d05
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion api/api/data_ws.py
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ def _coord(self, accession):
end
}
}
}""", "variables": { "assembly": self.assembly, "accession": accession }}).json()["data"]["cCREQuery"][0]["coordinates"]
}""", "variables": { "assembly": self.assembly, "accession": accession.upper() }}).json()["data"]["cCREQuery"][0]["coordinates"]
class Coord:
def __init__(self, rr):
self.chrom = rr["chromosome"]
Expand Down
23 changes: 12 additions & 11 deletions website/ui/src/apps/search/components/results_table_container.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,24 +367,25 @@ class ResultsTableContainer extends React.Component {
}
}

console.log(this.props, this.state);
const grouped = associateBy(cresWithChecks, x => x.info.accession, x => ({ ...x, ...x.info }));
return (
<div>
<Menu secondary pointing style={{ fontSize: "1em", marginTop: "0.5em" }}>
<Menu.Item active={this.state.page !== 1} onClick={() => this.setState({ page: 0 })}>Genome Browser View</Menu.Item>
{ this.props.coord_chrom && <Menu.Item active={this.state.page !== 1} onClick={() => this.setState({ page: 0 })}>Genome Browser View</Menu.Item> }
<Menu.Item active={this.state.page === 1} onClick={() => this.setState({ page: 1 })}>Table View</Menu.Item>
</Menu>
<div style={{ height: "0.5em" }} />
{ this.state.page === 0 ? (
<Browser
coordinates={{ chromosome: this.props.coord_chrom || this.state.cres[0].coord_chrom, start: this.props.coord_start || this.state.cres[0].coord_start, end: this.props.coord_end || this.state.cres[0].coord_end }}
cellType={this.props.cellType}
actions={this.props.actions}
g={grouped}
gene={this.props.search && this.props.search.parsedQuery && this.props.search.parsedQuery.genes[0] && this.props.search.parsedQuery.genes[0].approved_symbol}
assembly={this.props.assembly}
/>
{ this.state.page === 0 && this.props.coord_chrom ? (
this.state.cres[0] ? (
<Browser
coordinates={{ chromosome: this.props.coord_chrom || this.state.cres[0].coord_chrom, start: this.props.coord_start || this.state.cres[0].coord_start, end: this.props.coord_end || this.state.cres[0].coord_end }}
cellType={this.props.cellType}
actions={this.props.actions}
g={grouped}
gene={this.props.search && this.props.search.parsedQuery && this.props.search.parsedQuery.genes[0] && this.props.search.parsedQuery.genes[0].approved_symbol}
assembly={this.props.assembly}
/>
) : null
) : (
<React.Fragment>
{interpBox}
Expand Down

0 comments on commit ad78d05

Please sign in to comment.