Skip to content

Commit

Permalink
Merge pull request #58 from gf-dcc/patch/filter-cleanup
Browse files Browse the repository at this point in the history
Patch/filter cleanup
  • Loading branch information
anngvu authored Nov 28, 2023
2 parents 8a2b615 + 614b2b6 commit 080b6fd
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 70 deletions.
5 changes: 0 additions & 5 deletions components/ExploreSummary.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,6 @@ export const ExploreSummary: React.FunctionComponent<IExploreSummaryProps> = (
props.getGroupsByPropertyFiltered[AttributeNames.AtlasName]
).length;

const organCount = _.keys(
props.getGroupsByPropertyFiltered[AttributeNames.TissueorOrganofOrigin]
).length;

const cancerTypeCount = _.keys(
props.getGroupsByPropertyFiltered[AttributeNames.PrimaryDiagnosis]
).length;
Expand All @@ -43,7 +39,6 @@ export const ExploreSummary: React.FunctionComponent<IExploreSummaryProps> = (
</div>

<div>{pluralize('Team', atlasCount, true)}</div>
<div>{pluralize('Organ', organCount, true)}</div>
<div>{pluralize('Cancer Type', cancerTypeCount, true)}</div>
<div>{pluralize('Case', props.filteredCaseCount, true)}</div>
<div>
Expand Down
15 changes: 2 additions & 13 deletions components/FileTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -389,22 +389,11 @@ export default class FileTable extends React.Component<IFileTableProps> {
wrap: true,
sortable: true,
},
{
name: 'Organ',
selector: (file: Entity) => {
return _.uniq(
file.diagnosis.map((d) => d.TissueorOrganofOrigin)
).join(', ');
},
cell: truncatedTableCell,
wrap: true,
sortable: true,
},
{
name: 'Diagnosis',
selector: (file: Entity) => {
return _.uniq(
file.diagnosis.map((d) => d.TissueorOrganofOrigin)
file.diagnosis.map((d) => d.PrimaryDiagnosis) // this should probably be repurposed to "Breast Cancer Risk Group" & "Ovarian Cancer Risk Group" unless we get more cancer patients
).join(', ');
},
cell: truncatedTableCell,
Expand Down Expand Up @@ -630,7 +619,7 @@ export default class FileTable extends React.Component<IFileTableProps> {
};

const listSelectors: any = {
HTANParentDataFileID: {
ParentDataFileID: {
pluralName: 'Files',
},
};
Expand Down
33 changes: 2 additions & 31 deletions components/filter/FilterControls.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@ const FilterControls: React.FunctionComponent<IFilterControlsProps> = observer(

const selectOptions = [
AttributeNames.AtlasName,
AttributeNames.TissueorOrganofOrigin,
AttributeNames.PrimaryDiagnosis,
AttributeNames.assayName,
AttributeNames.Level,
Expand Down Expand Up @@ -125,34 +124,6 @@ const FilterControls: React.FunctionComponent<IFilterControlsProps> = observer(
</div>
</div>

<div>
<div style={{ width: 120 }}>
<FilterPanel
placeholder={
AttributeMap[
AttributeNames.TissueorOrganofOrigin
].displayName
}
>
<FilterPropertyColumnShell
title={
AttributeMap[
AttributeNames.TissueorOrganofOrigin
].displayName
}
>
<FilterCheckList
setFilter={props.setFilter}
filters={props.selectedFiltersByGroupName}
options={options(
AttributeNames.TissueorOrganofOrigin
)}
/>
</FilterPropertyColumnShell>
</FilterPanel>
</div>
</div>

<div>
<div style={{ width: 164 }}>
<FilterPanel
Expand Down Expand Up @@ -201,7 +172,7 @@ const FilterControls: React.FunctionComponent<IFilterControlsProps> = observer(
<div className={'filter-checkbox-list-container'}>
<FilterPropertyColumnShell
title={
AttributeMap[AttributeNames.Gender]
AttributeMap[AttributeNames.Sex]
.displayName
}
>
Expand All @@ -210,7 +181,7 @@ const FilterControls: React.FunctionComponent<IFilterControlsProps> = observer(
filters={
props.selectedFiltersByGroupName
}
options={options(AttributeNames.Gender)}
options={options(AttributeNames.Sex)}
/>
</FilterPropertyColumnShell>
<FilterPropertyColumnShell
Expand Down
3 changes: 2 additions & 1 deletion data/export_syn_data.clj
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@
{:ParticipantID (:ParticipantID x)
:Race (or (:Race x) "NA")
:Ethnicity (or (:Ethnicity x) "NA")
:Sex (or (:Sex x) "NA")
:atlas_id (:inAtlas x)}}) data))

(defn transform-diagnosis [data]
Expand Down Expand Up @@ -245,7 +246,7 @@

(def placeholder_P
{:NA_Participant {:Component "Demographics" :ParticipantID "NA_Participant"
:Race "NA" :Ethnicity "NA" :atlas_id "" :atlas_name ""}})
:Race "NA" :Ethnicity "NA" :Sex "NA" :atlas_id "" :atlas_name ""}})

(def clinical-demographics (conj (transform-demographics clinical-participants) placeholder_P))

Expand Down
6 changes: 2 additions & 4 deletions lib/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,7 @@ export interface BaseSerializableEntity {
BiospecimenID: string;
DataFileID: DataFileID; // this is used as the stable UID
ParentBiospecimenID: string;
HTANParentDataFileID: string;
TissueorOrganofOrigin: string;
ParentDataFileID: string;
PrimaryDiagnosis: string;
AgeatDiagnosis: number;
fileFormat: string;
Expand All @@ -48,8 +47,7 @@ export interface BaseSerializableEntity {
AssayType?: string;
Race: string;
Ethnicity: string;
CountryofResidence: string;
Gender: string;
Sex: string;

// Derived or attached in frontend
atlas_id: string;
Expand Down
21 changes: 5 additions & 16 deletions lib/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,10 @@ export type ExploreSelectedFilter = {

export enum AttributeNames {
// Synapse attribute names
TissueorOrganofOrigin = 'TissueorOrganofOrigin',
PrimaryDiagnosis = 'PrimaryDiagnosis',
Gender = 'Gender',
Sex = 'Sex',
Race = 'Race',
Ethnicity = 'Ethnicity',
CountryofResidence = 'CountryofResidence',
Component = 'Component',
Biospecimen = 'Biospecimen',
AtlasName = 'AtlasName',
Expand Down Expand Up @@ -53,11 +51,7 @@ function getCaseValues(propName: keyof Entity) {
}

export const AttributeMap: { [attr in AttributeNames]: IAttributeInfo } = {
[AttributeNames.TissueorOrganofOrigin]: {
getValues: getCaseValues('TissueorOrganofOrigin'),
displayName: 'Organ',
caseFilter: true,
},

[AttributeNames.PrimaryDiagnosis]: {
getValues: getCaseValues('PrimaryDiagnosis'),
displayName: 'Disease Type',
Expand All @@ -73,14 +67,9 @@ export const AttributeMap: { [attr in AttributeNames]: IAttributeInfo } = {
displayName: 'Ethnicity',
caseFilter: true,
},
[AttributeNames.CountryofResidence]: {
getValues: getCaseValues('CountryofResidence'),
displayName: 'Country of Residence',
caseFilter: true,
},
[AttributeNames.Gender]: {
getValues: getCaseValues('Gender'),
displayName: 'Gender',
[AttributeNames.Sex]: {
getValues: getCaseValues('Sex'),
displayName: 'Sex',
caseFilter: true,
},
[AttributeNames.Component]: {
Expand Down
Binary file modified public/processed_syn_data.json.gz
Binary file not shown.

0 comments on commit 080b6fd

Please sign in to comment.