Skip to content

Commit

Permalink
Check if user selected a variant set before exporting flapjack
Browse files Browse the repository at this point in the history
IBP-5656
  • Loading branch information
mderamos committed Sep 20, 2022
1 parent ddce619 commit dde1527
Showing 1 changed file with 23 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -172,28 +172,30 @@ export class GenotypingPaneComponent implements OnInit {
}

selectVariantsetOnChange() {
this.isExportingFlapjack = true;
const exportFlapjackRequest = new ExportFlapjackRequest([], [], 'FLAPJACK', [this.genotypingGermplasm.germplasmName], true,
100, this.selectedVariantSet.referenceSetDbId);
this.genotypingBrapiService.exportFlapjack(exportFlapjackRequest).subscribe((response) => {
this.isExportingFlapjack = false;
let file = response.replace('.fjzip', '');
file = this.extractHostName(this.cropGenotypingParameter.baseUrl) + file;

const flapjackDiv = '#flapjack-div';
const renderer = flapjack.default();
renderer.renderGenotypesUrl({
domParent: flapjackDiv,
width: document.querySelector(flapjackDiv).getBoundingClientRect().width,
height: 250,
mapFileURL: file + '.map',
genotypeFileURL: file + '.genotype',
phenotypeFileURL: file + '.phenotype',
overviewWidth: document.querySelector(flapjackDiv).getBoundingClientRect().width,
overviewHeight: 25,
dataSetId: this.cropGenotypingParameter.programId,
if (this.selectedVariantSet) {
this.isExportingFlapjack = true;
const exportFlapjackRequest = new ExportFlapjackRequest([], [], 'FLAPJACK', [this.genotypingGermplasm.germplasmName], true,
100, this.selectedVariantSet.referenceSetDbId);
this.genotypingBrapiService.exportFlapjack(exportFlapjackRequest).subscribe((response) => {
this.isExportingFlapjack = false;
let file = response.replace('.fjzip', '');
file = this.extractHostName(this.cropGenotypingParameter.baseUrl) + file;

const flapjackDiv = '#flapjack-div';
const renderer = flapjack.default();
renderer.renderGenotypesUrl({
domParent: flapjackDiv,
width: document.querySelector(flapjackDiv).getBoundingClientRect().width,
height: 250,
mapFileURL: file + '.map',
genotypeFileURL: file + '.genotype',
phenotypeFileURL: file + '.phenotype',
overviewWidth: document.querySelector(flapjackDiv).getBoundingClientRect().width,
overviewHeight: 25,
dataSetId: this.cropGenotypingParameter.programId,
});
});
});
}
}

extractHostName(baseUrl) {
Expand Down

0 comments on commit dde1527

Please sign in to comment.