Skip to content

Commit

Permalink
Merge branch 'main' into typeahead
Browse files Browse the repository at this point in the history
  • Loading branch information
Foxcapades authored Jun 29, 2023
2 parents 55e96b3 + 292a53d commit 83035c0
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 50 deletions.
2 changes: 1 addition & 1 deletion packages/libs/components/src/map/SemanticMarkers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function constrainLongitudeToMainWorld({
// but we need to make sure that west is slightly greater than east
// so that they "wrap around" the whole globe
// (if west was slightly less than east, it would represent a very tiny sliver)
if (newWest === newEast) newWest = newWest + 1e-8;
if (Math.abs(newEast - newWest) < 1e-8) newWest = newEast + 1e-8;

return {
southWest: { lat: south, lng: newWest },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -651,14 +651,14 @@ function LineplotViz(props: VisualizationProps<Options>) {
[options, providedOverlayVariable, providedOverlayVariableDescriptor]
);

// define showMarginalHistogram
const showMarginalHistogram = options?.showMarginalHistogram ?? false;
// check banner condition
const showIndependentAxisBanner =
vizConfig.independentAxisLogScale && vizConfig.useBinning;
const showDependentAxisBanner =
vizConfig.dependentAxisLogScale && vizConfig.showErrorBars;

const showMarginalHistogram = options?.showMarginalHistogram ?? false;

const data = usePromise(
useCallback(async (): Promise<LinePlotDataWithCoverage | undefined> => {
if (
Expand Down
4 changes: 2 additions & 2 deletions packages/libs/eda/src/lib/core/hooks/workspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -130,11 +130,11 @@ export function useStudyEntities(filters?: Filter[]) {
min:
filter.type === 'numberRange'
? filter.min
: filter.min.split('T00:00:00Z')[0],
: filter.min.split(/T00:00:00(?:\.000)?Z?/)[0],
max:
filter.type === 'numberRange'
? filter.max
: filter.max.split('T00:00:00Z')[0],
: filter.max.split(/T00:00:00(?:\.000)?Z?/)[0],
}
: undefined;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import { barplotRequest } from './plugins/barplot';
import { lineplotRequest } from './plugins/lineplot';
import { histogramRequest } from './plugins/histogram';
import { scatterplotRequest } from './plugins/scatterplot';
//TO DO import timeline SVGIcon
import LineSVG from '../../../core/components/visualizations/implementations/selectorIcons/LineSVG';

interface Props {
selectedOverlayConfig?: OverlayConfig;
Expand All @@ -40,10 +42,6 @@ export function useStandaloneVizPlugins({
return visualization.withOptions({
hideFacetInputs: true, // will also enable table-only mode for mosaic
hideShowMissingnessToggle: true,
// TODO: need to distinguish lineplot from lineplot with marginal histogram?
// perhaps need to make another function only for lineplot with marginal histogram
// or define xxx.withOptions({}) directly at corresponding visualizationPlugins below
showMarginalHistogram: false,
layoutComponent: FloatingLayout,
// why are we providing three functions to access the properties of
// one object? Because in the pre-SAM world, getOverlayVariable was already
Expand Down Expand Up @@ -108,6 +106,17 @@ export function useStandaloneVizPlugins({
vizWithOptions(lineplotVisualization),
lineplotRequest
),
// activate timeline Viz
timeseries: vizWithCustomizedGetRequest(
vizWithOptions(
lineplotVisualization
.withOptions({
showMarginalHistogram: true,
})
.withSelectorIcon(LineSVG)
),
lineplotRequest
),
},
},
'standalone-map-distributions': {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -377,9 +377,9 @@ const enhance = connect<
(stateProps, dispatchProps, ownProps) => ({
...stateProps,
...dispatchProps,
...omit(ownProps, ['question', 'recordClass']),
searchName: ownProps.question,
recordClassName: ownProps.recordClass,
...omit(ownProps, ['question', 'recordClass']),
})
);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,8 @@ const observeInitialParamData: Observer = (action$, state$, services) => {
} as Filter);
}
}
// If filters is empty, assume there is no initialParamData for this param.
if (filters.length === 0) return EMPTY;
return of(
updateParamValue({
paramValue: JSON.stringify({ filters }),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -525,4 +525,4 @@ export { SiteSearchInput } from './component-wrappers/SiteSearchInput';

export { AnswerController } from './component-wrappers/AnswerController';

export { QuestionController } from './component-wrappers/QuestionController';
// export { QuestionController } from './component-wrappers/QuestionController';
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,30 @@ import {
nullValue,
oneOf,
record,
string
string,
} from '@veupathdb/wdk-client/lib/Utils/Json';

import { DataTableColumns } from 'ortho-client/utils/dataTables';
import { TaxonUiMetadata } from 'ortho-client/utils/taxons';
import { renderAttributeValue } from '@veupathdb/wdk-client/lib/Utils/ComponentUtils';

const linkAttributeValue = record({
url: string,
displayText: string,
});

const proteomeSummaryRowDecoder = record({
clustered_sequences: string,
core_peripheral: oneOf(constant('Core'), constant('Peripheral')),
resource_version: oneOf(string, nullValue),
groups: string,
name: string,
resource_name: string,
resource_url: string,
ncbi_taxon_url_link: linkAttributeValue,
resource_url_link: linkAttributeValue,
sequences: string,
root_taxon: string,
three_letter_abbrev: string,
most_recent: string
most_recent: string,
});

type ProteomeSummaryRow = Unpack<typeof proteomeSummaryRowDecoder>;
Expand All @@ -40,99 +46,106 @@ export const RELEASE_SUMMARY_COLUMNS: DataTableColumns<
core_peripheral: {
key: 'core_peripheral',
name: 'Core/Peripheral',
helpText: 'There are 150 Core species whose proteomes were used to form the initial core groups. The remaining species on the site are Peripheral species. The Peripheral proteins were mapped into core groups if they met sequence similarity thresholds. Proteins that did not map into core groups were collected and used to form Residual groups.',
sortable: true
helpText:
'There are 150 Core species whose proteomes were used to form the initial core groups. The remaining species on the site are Peripheral species. The Peripheral proteins were mapped into core groups if they met sequence similarity thresholds. Proteins that did not map into core groups were collected and used to form Residual groups.',
sortable: true,
},
name: {
key: 'name',
name: 'Name',
helpText: 'Genus, species and strain name',
sortable: true
sortable: true,
},
ncbi_taxon_url_link: {
key: 'ncbi_taxon_url_link',
name: 'NCBI Taxon ID',
helpText: 'The URL of the NCBI site for this taxon.',
sortable: true,
renderCell: ({ value }) => renderAttributeValue(value),
},
root_taxon: {
key: 'root_taxon',
name: 'Category',
helpText: 'The taxonomic category of the organism. ALVE: Alveolata, AMOE: Amoeba, ARCH: Archaea, EUGL: Euglenozoa, FUNG: Fungi, META: Metazoa, OBAC: Other Bacteria, OEUK: Other Eukaryota, PROT: Proteobacteria, VIRI: Viridiplantae',
sortable: true
helpText:
'The taxonomic category of the organism. ALVE: Alveolata, AMOE: Amoeba, ARCH: Archaea, EUGL: Euglenozoa, FUNG: Fungi, META: Metazoa, OBAC: Other Bacteria, OEUK: Other Eukaryota, PROT: Proteobacteria, VIRI: Viridiplantae',
sortable: true,
},
three_letter_abbrev: {
key: 'three_letter_abbrev',
name: 'Abbreviation',
helpText: 'Usually, this a four-letter abbreviation for this organism at OrthoMCL. Sometimes, the name follows the format abcd-old, in which case it is a core organism that also has an updated proteome which has been added to OrthoMCL as a peripheral organism. The updated name in this case is abcd.',
sortable: true
helpText:
'Usually, this a four-letter abbreviation for this organism at OrthoMCL. Sometimes, the name follows the format abcd-old, in which case it is a core organism that also has an updated proteome which has been added to OrthoMCL as a peripheral organism. The updated name in this case is abcd.',
sortable: true,
},
clustered_sequences: {
key: 'clustered_sequences',
name: '# Grouped Sequences',
helpText: 'Number of proteins that are part of an ortholog group. A protein would not be part of a group if it was poor quality (e.g., several stop codons or very few amino acids).',
helpText:
'Number of proteins that are part of an ortholog group. A protein would not be part of a group if it was poor quality (e.g., several stop codons or very few amino acids).',
sortable: true,
makeOrder: ({ clustered_sequences }) => Number(clustered_sequences)
makeOrder: ({ clustered_sequences }) => Number(clustered_sequences),
},
groups: {
key: 'groups',
name: '# Groups',
helpText: 'Number of ortholog groups in which the organism proteins are found.',
helpText:
'Number of ortholog groups in which the organism proteins are found.',
sortable: true,
makeOrder: ({ groups }) => Number(groups)
makeOrder: ({ groups }) => Number(groups),
},
sequences: {
key: 'sequences',
name: '# Sequences',
helpText: 'Number of proteins in the organism that have been processed by OrthoMCL. This will depend on whether the gene was structurally annotated to encode a protein.',
helpText:
'Number of proteins in the organism that have been processed by OrthoMCL. This will depend on whether the gene was structurally annotated to encode a protein.',
sortable: true,
makeOrder: ({ sequences }) => Number(sequences)
makeOrder: ({ sequences }) => Number(sequences),
},
resource_name: {
key: 'resource_name',
resource_url_link: {
key: 'resource_url_link',
name: 'Resource',
helpText: 'The source of the organism proteome.',
sortable: true
},
resource_url: {
key: 'resource_url',
name: 'URL',
helpText: 'The URL of the site from which the organism proteome was obtained.',
sortable: true
sortable: true,
renderCell: ({ value }) => renderAttributeValue(value),
},
most_recent: {
key: 'most_recent',
name: 'Most recent version',
sortable: true,
helpText: 'Type most_recent in the search box to show only the most recent version.',
helpText:
'Type most_recent in the search box to show only the most recent version.',
},
resource_version: {
key: 'resource_version',
name: 'Proteome version',
sortable: true,
makeOrder: ({ resource_version }) => resource_version || '',
makeSearchableString: resource_version => resource_version || 'N/A',
makeSearchableString: (resource_version) => resource_version || 'N/A',
renderCell: ({ value }) =>
value ? value : <span className="EmptyResourceVersion">N/A</span>
}
value ? value : <span className="EmptyResourceVersion">N/A</span>,
},
};

export function makeReleaseSummaryRows(
{ species }: TaxonUiMetadata,
proteomeSummaryRows: ProteomeSummaryRows
): ProteomeSummaryRows {
return proteomeSummaryRows.map(
proteomeSummaryRow => ({
...proteomeSummaryRow,
root_taxon: species[proteomeSummaryRow.three_letter_abbrev].rootTaxon
})
);
return proteomeSummaryRows.map((proteomeSummaryRow) => ({
...proteomeSummaryRow,
root_taxon: species[proteomeSummaryRow.three_letter_abbrev].rootTaxon,
}));
}

export const RELEASE_SUMMARY_COLUMN_ORDER = [
'root_taxon',
'name',
'ncbi_taxon_url_link',
'core_peripheral',
'three_letter_abbrev',
'resource_name',
'resource_url',
'resource_url_link',
'resource_version',
'most_recent',
'sequences',
'clustered_sequences',
'groups'
'groups',
] as const;

0 comments on commit 83035c0

Please sign in to comment.