Skip to content

Commit

Permalink
Make JsonAnnotation.strand optional
Browse files Browse the repository at this point in the history
The previous error message code indicated the possibility that this
property is unset. Express that directly in the type annotation and
simplify the error message code.
  • Loading branch information
victorlin committed Nov 21, 2024
1 parent 37da370 commit 2d3a331
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/entropyCreateStateFromJsons.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ interface JsonAnnotation {
end?: number
start?: number
segments?: JsonSegmentRange[]
strand: Strand
strand?: Strand
gene?: string
color?: string
display_name?: string
Expand Down Expand Up @@ -225,7 +225,7 @@ function cdsFromAnnotation(
* which are represented by augur as '?' and null, respectively. (null comes from `None` in python.)
* In both cases it's not a good idea to make an assumption of strandedness, or to assume it's even a CDS. */
console.error(`[Genome annotation] ${cdsName} has strand ` +
(Object.prototype.hasOwnProperty.call(annotation, "strand") ? String(annotation.strand) : '(missing)') +
(annotation.strand !== undefined ? annotation.strand : '(missing)') +
". This CDS will be ignored.");
return invalidCds;
}
Expand Down

0 comments on commit 2d3a331

Please sign in to comment.