Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions app/apis/catalog/hprc-data-explorer/common/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@ export type HPRCDataExplorerRawSequencingData = WithAbsentValues<{
}>;

export type HPRCDataExplorerAssembly = WithAbsentValues<{
assemblyDate: string;
assemblyFai: string;
assemblyGzi: string;
assemblyMethod: string;
assemblyMethodVersion: string;
assemblyName: string;
awsFasta: string;
biosampleAccession: string;
contributors: string;
Expand All @@ -71,7 +77,9 @@ export type HPRCDataExplorerAssembly = WithAbsentValues<{
fastaSha256: string;
filename: string;
fileSize: number;
genbankAccession: string;
haplotype: string;
phasing: string;
populationAbbreviation: string;
populationDescriptor: string;
project: string;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,84 @@ export const buildAlternativeId = (
};
};

/**
* Build props for the assembly date cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyDate = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.assemblyDate,
};
};

/**
* Build props for the assembly FAI cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyFai = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.TypographyNoWrap> => {
return {
value: assembly.assemblyFai,
};
};

/**
* Build props for the assembly GZI cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyGzi = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.TypographyNoWrap> => {
return {
value: assembly.assemblyGzi,
};
};

/**
* Build props for the assembly method cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyMethod = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.assemblyMethod,
};
};

/**
* Build props for the assembly method version cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyMethodVersion = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.assemblyMethodVersion,
};
};

/**
* Build props for the assembly name cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildAssemblyName = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.assemblyName,
};
};

/**
* Build props for the alignment cell.
* @param alignment - Alignment entity.
Expand Down Expand Up @@ -352,6 +430,19 @@ export const buildFiletype = (
};
};

/**
* Build props for the genbank accession cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildGenbankAccession = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.genbankAccession,
};
};

/**
* Build props for the generator contact cell.
* @param rawSequencingData - Raw sequencing data entity.
Expand Down Expand Up @@ -495,6 +586,19 @@ export const buildPaternalId = (
};
};

/**
* Build props for the phasing cell.
* @param assembly - Assembly entity.
* @returns Props to be used for the cell.
*/
export const buildPhasing = (
assembly: HPRCDataExplorerAssembly
): React.ComponentProps<typeof C.BasicCell> => {
return {
value: assembly.phasing,
};
};

/**
* Build props for the path cell.
* @param rawSequencingData - Raw sequencing data entity.
Expand Down
8 changes: 8 additions & 0 deletions catalog/build/ts/build-catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,12 @@ async function buildAssemblies(
missingSamples
);
return {
assemblyDate: parseStringOrAbsent(row.assembly_date),
assemblyFai: parseStringOrAbsent(row.assembly_fai),
assemblyGzi: parseStringOrAbsent(row.assembly_gzi),
assemblyMethod: parseStringOrAbsent(row.assembly_method),
assemblyMethodVersion: parseStringOrAbsent(row.assembly_method_version),
assemblyName: parseStringOrAbsent(row.assembly_name),
awsFasta: parseStringOrAbsent(row.assembly),
biosampleAccession: sample.biosampleAccession,
contributors: sample.contributors,
Expand All @@ -222,7 +228,9 @@ async function buildAssemblies(
fastaSha256: parseStringOrAbsent(row.fasta_sha256),
fileSize: parseNumberOrAbsent(row.file_size),
filename: parseStringOrAbsent(row.assembly, getFileNameFromPath),
genbankAccession: parseStringOrAbsent(row.genbank_accession),
haplotype: parseStringOrAbsent(row.haplotype),
phasing: parseStringOrAbsent(row.phasing),
populationAbbreviation: sample.populationAbbreviation,
populationDescriptor: sample.populationDescriptor,
project: sample.project,
Expand Down
Loading
Loading