${this.show_directory_checkbox
? html`
`
: ''}
${this.renderSelectedFiles()}
`;
}
handleFileChanges(event: InputEvent) {
event.preventDefault();
this.selectedFiles = Array.from(
(event.currentTarget as HTMLInputElement).files
).filter((file: File) => {
for (const ext of SUPPORTED_EXTENSIONS) {
if (file.name.endsWith(ext)) {
return true;
}
}
return false;
});
worker.postMessage({
files: this.selectedFiles,
options: {
num: this.num,
ksize: this.ksize,
is_protein: this.is_protein,
dayhoff: this.dayhoff,
hp: this.hp,
seed: this.seed,
scaled: this.scaled,
track_abundance: this.track_abundance,
},
});
this.dispatchEvent(
new CustomEvent('change', {
bubbles: true,
detail: {
selectedFiles: this.selectedFiles,
},
})
);
this.requestUpdate();
}
}
declare global {
interface HTMLElementTagNameMap {
'mgnify-sourmash-component': MGnifySourmash;
}
}