hms-dbmi / chromoscope

Interactive multiscale visualization for structural variation in human genomes
https://chromoscope.bio/
MIT License
60 stars 6 forks source link

Make the CNV file optional #127

Closed sehilyi closed 6 months ago

sehilyi commented 7 months ago

Currently, SV and CNV files are required. But, we want to make the CNV files optional.

sehilyi commented 6 months ago

These are several things that need to be changed in order to address this GitHub issue.

  1. Editing TypeScript types, make the cnv field in the JSON data config optional (i.e., csv: stringcnv?: string)

https://github.com/hms-dbmi/chromoscope/blob/e24b7a8318ca476c1c50ffb3fadb81b051eac43d/src/data/samples.ts#L23

  1. Add an if statement to exclude GAIN and LOH tracks if the cnv field is undefined, e.g.,
- tracks.gain(id, cnv, width, 40, 'top', cnFields),
+ ...(cnv ? [tracks.gain(id, cnv, width, 40, 'top', cnFields)] : [])

https://github.com/hms-dbmi/chromoscope/blob/e24b7a8318ca476c1c50ffb3fadb81b051eac43d/src/main-spec.ts#L318-L320

  1. In the documentation, change the description that CNV files are optional: https://github.com/hms-dbmi/chromoscope/blob/master/docs/docs/loading-data/through-data-config.md