-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
251 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
import GenericCompareSideBySidePage from '../../components/views/compareSideBySide/GenericCompareSideBySidePage.astro'; | ||
import { Organisms } from '../../types/Organism'; | ||
--- | ||
|
||
<GenericCompareSideBySidePage organism={Organisms.cchf} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
import GenericCompareToBaselinePage from '../../components/views/compareToBaseline/GenericCompareToBaselinePage.astro'; | ||
import { Organisms } from '../../types/Organism'; | ||
--- | ||
|
||
<GenericCompareToBaselinePage organism={Organisms.cchf} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
import GenericCompareVariantsPage from '../../components/views/compareVariants/GenericCompareVariantsPage.astro'; | ||
import { Organisms } from '../../types/Organism'; | ||
--- | ||
|
||
<GenericCompareVariantsPage organism={Organisms.cchf} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
--- | ||
import { Organisms } from '../../types/Organism'; | ||
import { ServerSide } from '../../views/serverSideRouting'; | ||
import { singleVariantViewKey } from '../../views/viewKeys'; | ||
return Astro.redirect( | ||
ServerSide.routing | ||
.getOrganismView(`${Organisms.cchf}.${singleVariantViewKey}`) | ||
.pageStateHandler.getDefaultPageUrl(), | ||
); | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
import GenericSequencingEffortsPage from '../../components/views/sequencingEfforts/GenericSequencingEffortsPage.astro'; | ||
import { Organisms } from '../../types/Organism'; | ||
--- | ||
|
||
<GenericSequencingEffortsPage organism={Organisms.cchf} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
import GenericAnalyzeSingleVariantPage from '../../components/views/analyzeSingleVariant/GenericAnalyzeSingleVariantPage.astro'; | ||
import { Organisms } from '../../types/Organism'; | ||
--- | ||
|
||
<GenericAnalyzeSingleVariantPage organism={Organisms.cchf} /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
import { type DateRangeOption, dateRangeOptionPresets } from '@genspectrum/dashboard-components/util'; | ||
|
||
import { type CompareSideBySideData, type DatasetAndVariantData, type Id } from './View.ts'; | ||
import { type OrganismsConfig } from '../config.ts'; | ||
import { | ||
BaseView, | ||
GenericCompareToBaselineView, | ||
GenericCompareVariantsView, | ||
GenericSequencingEffortsView, | ||
GenericSingleVariantView, | ||
} from './BaseView.ts'; | ||
import { getPathoplexusAdditionalSequencingEffortsFields, type ExtendedConstants } from './OrganismConstants.ts'; | ||
import { compareSideBySideViewConstants } from './ViewConstants.ts'; | ||
import type { LineageFilterConfig } from '../components/pageStateSelectors/LineageFilterInput.tsx'; | ||
import { organismConfig, Organisms } from '../types/Organism.ts'; | ||
import { type DataOrigin, dataOrigins } from '../types/dataOrigins.ts'; | ||
import { GenericCompareSideBySideStateHandler } from './pageStateHandlers/CompareSideBySidePageStateHandler.ts'; | ||
|
||
class CchfConstants implements ExtendedConstants { | ||
public readonly organism = Organisms.cchf; | ||
public readonly earliestDate = '1956-01-01'; | ||
public readonly defaultDateRange = dateRangeOptionPresets.lastYear; | ||
public readonly dateRangeOptions: DateRangeOption[] = [ | ||
dateRangeOptionPresets.lastMonth, | ||
dateRangeOptionPresets.last2Months, | ||
dateRangeOptionPresets.last3Months, | ||
dateRangeOptionPresets.last6Months, | ||
dateRangeOptionPresets.lastYear, | ||
{ label: 'Since 2020', dateFrom: '2020-01-01' }, | ||
{ label: '2010-2019', dateFrom: '2010-01-01', dateTo: '2019-12-31' }, | ||
{ label: '2000-2009', dateFrom: '2000-01-01', dateTo: '2009-12-31' }, | ||
{ label: 'Since 2000', dateFrom: '2000-01-01' }, | ||
{ label: 'Before 2000', dateFrom: this.earliestDate, dateTo: '1999-12-31' }, | ||
{ label: 'All times', dateFrom: this.earliestDate }, | ||
]; | ||
public readonly mainDateField: string; | ||
public readonly locationFields: string[]; | ||
public readonly lineageFilters: LineageFilterConfig[] = []; | ||
public readonly useAdvancedQuery = false; | ||
public readonly hostField: string; | ||
public readonly authorsField: string | undefined; | ||
public readonly authorAffiliationsField: string | undefined; | ||
public readonly accessionDownloadFields; | ||
|
||
public get additionalSequencingEffortsFields() { | ||
return getPathoplexusAdditionalSequencingEffortsFields(this); | ||
} | ||
|
||
public readonly additionalFilters: Record<string, string> | undefined; | ||
public readonly dataOrigins: DataOrigin[] = [dataOrigins.pathoplexus]; | ||
|
||
constructor(organismsConfig: OrganismsConfig) { | ||
this.mainDateField = organismsConfig.cchf.lapis.mainDateField; | ||
this.locationFields = organismsConfig.cchf.lapis.locationFields; | ||
this.hostField = organismsConfig.cchf.lapis.hostField; | ||
this.authorsField = organismsConfig.cchf.lapis.authorsField; | ||
this.authorAffiliationsField = organismsConfig.cchf.lapis.authorAffiliationsField; | ||
this.additionalFilters = organismsConfig.cchf.lapis.additionalFilters; | ||
this.accessionDownloadFields = organismsConfig.cchf.lapis.accessionDownloadFields; | ||
} | ||
} | ||
|
||
export class CchfAnalyzeSingleVariantView extends GenericSingleVariantView<CchfConstants> { | ||
constructor(organismsConfig: OrganismsConfig) { | ||
super(new CchfConstants(organismsConfig)); | ||
} | ||
} | ||
|
||
export class CchfCompareSideBySideView extends BaseView< | ||
CompareSideBySideData, | ||
CchfConstants, | ||
GenericCompareSideBySideStateHandler | ||
> { | ||
constructor(organismsConfig: OrganismsConfig) { | ||
const constants = new CchfConstants(organismsConfig); | ||
const defaultPageState = { | ||
filters: new Map<Id, DatasetAndVariantData>([ | ||
[ | ||
0, | ||
{ | ||
datasetFilter: { | ||
location: {}, | ||
dateRange: constants.defaultDateRange, | ||
}, | ||
variantFilter: { | ||
lineages: {}, | ||
mutations: {}, | ||
}, | ||
}, | ||
], | ||
[ | ||
1, | ||
{ | ||
datasetFilter: { | ||
location: {}, | ||
dateRange: constants.defaultDateRange, | ||
}, | ||
variantFilter: { | ||
lineages: {}, | ||
mutations: {}, | ||
}, | ||
}, | ||
], | ||
]), | ||
}; | ||
|
||
super( | ||
constants, | ||
new GenericCompareSideBySideStateHandler( | ||
constants, | ||
defaultPageState, | ||
organismConfig[constants.organism].pathFragment, | ||
), | ||
compareSideBySideViewConstants, | ||
); | ||
} | ||
} | ||
|
||
export class CchfSequencingEffortsView extends GenericSequencingEffortsView<CchfConstants> { | ||
constructor(organismsConfig: OrganismsConfig) { | ||
super(new CchfConstants(organismsConfig)); | ||
} | ||
} | ||
|
||
export class CchfCompareVariantsView extends GenericCompareVariantsView<CchfConstants> { | ||
constructor(organismsConfig: OrganismsConfig) { | ||
super(new CchfConstants(organismsConfig)); | ||
} | ||
} | ||
|
||
export class CchfCompareToBaselineView extends GenericCompareToBaselineView<CchfConstants> { | ||
constructor(organismsConfig: OrganismsConfig) { | ||
super(new CchfConstants(organismsConfig)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters