Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit fdb43f7

Browse files
committedFeb 20, 2024·
-feat: update SampleType, make cnv optional
-feat: exclude GAIN and LOH tracks if cnv field is undefined -chore: update cnv item in docs -feat: update cnv input
1 parent e24b7a8 commit fdb43f7

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed
 

‎docs/docs/loading-data/through-data-config.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ For each sample, you need to prepare the following information in a JSON object.
2323
| `cancer` | `string` | Required. Type of a cancer. |
2424
| `assembly` | `'hg38'` or `'hg19'` | Required. Assembly. |
2525
| `sv` | `string` | Required. An URL of the SV bedpe file (`.bedpe`). |
26-
| `cnv` | `string` | Required. An URL of the CNV text file (`.tsv`). |
26+
| `cnv` | `string` | Optional. An URL of the CNV text file (`.tsv`). |
2727
| `drivers` | `string` | Optional. An URL of a file that contains drivers (`.tsv` or `.json`). |
2828
| `vcf` | `string` | Optional. An URL of the point mutation file (`.vcf`). |
2929
| `vcfIndex` | `string` | Optional. An URL of the point mutation index file (`.tbi`). |

‎src/data/samples.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export type SampleType = {
2020
cancer: string; // cancer type
2121
assembly: Assembly; // hg19 or 38
2222
sv: string; // URL of bedpe
23-
cnv: string; // URL of txt
23+
cnv?: string; // URL of txt
2424
drivers?: { [k: string]: string | number }[] | string;
2525
bam?: string;
2626
bai?: string;

‎src/main-spec.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -315,9 +315,9 @@ function getOverviewSpec(option: SpecOption): View[] {
315315
},
316316
tracks.driver(id, driversToTsvUrl(drivers), width, 40, 'top'),
317317
tracks.boundary('driver', 'top'),
318-
tracks.gain(id, cnv, width, 40, 'top', cnFields),
318+
cnv ? [tracks.gain(id, cnv, width, 40, 'top', cnFields)] : [],
319319
tracks.boundary('gain', 'top'),
320-
tracks.loh(id, cnv, width, 40, 'top', cnFields),
320+
cnv ? [tracks.loh(id, cnv, width, 40, 'top', cnFields)] : [],
321321
tracks.boundary('loh', 'top'),
322322
tracks.sv(id, sv, width, 80, 'top', selectedSvId)
323323
]

‎src/ui/sample-config-form.tsx

+2-3
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ const testOkay = {
2424
id: (_: SampleConfig) => _.id,
2525
cancer: (_: SampleConfig) => _.cancer,
2626
sv: (_: SampleConfig) => isValidUrl(_.sv),
27-
cnv: (_: SampleConfig) => isValidUrl(_.cnv),
2827
// optional
28+
cnv: (_: SampleConfig) => !_.cnv || isValidUrl(_.cnv),
2929
drivers: (_: SampleConfig) => !_.drivers || isValidUrl(_.drivers),
3030
vcf: (_: SampleConfig) => !_.vcf || isValidUrl(_.vcf),
3131
vcfIndex: (_: SampleConfig) => !_.vcfIndex || isValidUrl(_.vcfIndex),
@@ -155,14 +155,13 @@ export default function SampleConfigForm(props: { onAdd: (config: ValidSampleCon
155155
/>
156156

157157
<div className="menu-subtitle">
158-
CNV<sup>*</sup> <small>(.txt)</small>
158+
CNV <small>(.txt)</small>
159159
</div>
160160
{/* <span className="menu-subtitle-right">Required</span> */}
161161
<input
162162
type="text"
163163
className={testOkay.cnv(sampleConfig) ? 'menu-text-input' : 'menu-text-input-invalid'}
164164
placeholder="https://..."
165-
required
166165
onChange={e => setSampleConfig({ ...sampleConfig, cnv: e.currentTarget.value })}
167166
value={sampleConfig.cnv}
168167
/>

0 commit comments

Comments
 (0)
Please sign in to comment.