Skip to content

Commit

Permalink
Merge pull request #466 from iobio/tony_dev_460_demo_38
Browse files Browse the repository at this point in the history
#460 Discovered that QC data was hardcoded for demo data.  Altered co…
  • Loading branch information
tonydisera authored Jan 7, 2022
2 parents bf8bc00 + d11872f commit fed4745
Show file tree
Hide file tree
Showing 5 changed files with 140 additions and 92 deletions.
33 changes: 19 additions & 14 deletions src/components/pages/ClinHome.vue
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ $horizontal-dashboard-height: 140px
:cohortModel="cohortModel"
:launchedFromMosaic="launchedFromMosaic"
@custom-model-info="customModelInfo"
@setPhenotypeText="setPhenotypeText($event)"
@setGeneSet="setGeneSet($event)"
@set-ped-data="setPedData($event)"
@set-custom-case-summary="setCustomCaseSummary($event)"
Expand Down Expand Up @@ -633,12 +634,13 @@ export default {
cohortModel: null,
customData: false,
customGeneSet: [],
customPhenotypeText: "",
bedFileUrl: '',
variantsAnalyzedCounted: 0,
customSavedAnalysis: false,
passcode: '',
showPassCode: false,
buildName: 'GRCh37',
buildName: 'GRCh38',
knownGenesData: null,
byPassedGenes: [],
byPassedGenesDialog: false,
Expand Down Expand Up @@ -835,16 +837,16 @@ export default {
self.globalApp.initServices();
self.genomeBuildHelper = new GenomeBuildHelper(self.globalApp);
return self.genomeBuildHelper.promiseInit({DEFAULT_BUILD: 'GRCh37'})
return self.genomeBuildHelper.promiseInit({DEFAULT_BUILD: 'GRCh38'})
})
.then(function() {
if (self.paramBuild && self.paramBuild.length > 0) {
self.genomeBuildHelper.setCurrentBuild(self.paramBuild);
self.setBuildName(self.paramBuild);
} else {
// TODO - genome build is required
self.genomeBuildHelper.setCurrentBuild("GRCh37");
self.setBuildName("GRCh37");
self.genomeBuildHelper.setCurrentBuild("GRCh38");
self.setBuildName("GRCh38");
}
let glyph = new Glyph();
Expand Down Expand Up @@ -961,24 +963,24 @@ export default {
getDemoVcf: function() {
return {
'exome': "https://s3.amazonaws.com/iobio/samples/vcf/platinum-exome.vcf.gz",
'genome': "https://s3.amazonaws.com/iobio/gene/wgs_platinum/platinum-trio.vcf.gz"
'exome': "https://iobio.s3.amazonaws.com/samples/vcf/2021_platinum/2021_platinum_exomes_GRCh38.vcf.gz",
'genome': "https://iobio.s3.amazonaws.com/samples/vcf/2021_platinum/2021_platinum_genomes_GRCh38.vcf.gz"
}
},
getDemoBams: function() {
return {
'exome': {
'proband': 'https://s3.amazonaws.com/iobio/samples/bam/NA12878.exome.bam',
'mother': 'https://s3.amazonaws.com/iobio/samples/bam/NA12892.exome.bam',
'father': 'https://s3.amazonaws.com/iobio/samples/bam/NA12891.exome.bam',
'sibling': 'https://s3.amazonaws.com/iobio/samples/bam/NA12877.exome.bam'
'proband': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_exomes/NA12878.cram',
'mother': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_exomes/NA12892.cram',
'father': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_exomes/NA12891.cram',
'sibling': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_exomes/NA12877.cram'
},
'genome': {
'proband': 'https://s3.amazonaws.com/iobio/gene/wgs_platinum/NA12878.bam',
'mother': 'https://s3.amazonaws.com/iobio/gene/wgs_platinum/NA12892.bam',
'father': 'https://s3.amazonaws.com/iobio/gene/wgs_platinum/NA12891.bam'
'proband': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_genomes/NA12878.cram',
'mother': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_genomes/NA12892.cram',
'father': 'https://iobio.s3.amazonaws.com/samples/cram/2021_platinum/GRCh38_genomes/NA12891.cram'
}
}
Expand Down Expand Up @@ -1017,7 +1019,7 @@ export default {
else if(self.customData){
self.$ga.event('launch_type', 'Standalone', 'Custom data');
self.analysis = analysisData;
self.analysis.payload.demoTextNote = ""
self.analysis.payload.demoTextNote = self.customPhenotypeText
self.idAnalysis = self.analysis.id;
if(!self.importedCustomVariants){
self.analysis.payload.variants = [];
Expand Down Expand Up @@ -2540,6 +2542,9 @@ export default {
this.customGeneSet = geneSet;
this.setCustomGeneSet(this.customGeneSet);
},
setPhenotypeText(phenotypeText){
this.customPhenotypeText = phenotypeText;
},
setPedData(pedigree){
this.rawPedigree = pedigree;
},
Expand Down
175 changes: 110 additions & 65 deletions src/components/pages/LandingPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
clin.iobio makes it easy to review sequencing and case metrics, generate a prioritized list of genes associated with the disease/phenotype, review candidate variants, and generate a report of your findings
</span>
<br>
<v-btn v-if="!analysisInProgress" color="white" outlined x-large @click="getStarted('demo')" class="mt-8">
<v-btn v-if="!analysisInProgress" color="white" outlined x-large @click="onLoadDemoDataFromConfig()" class="mt-8">
<v-icon>explore</v-icon>
<span class="ml-2">Run with demo data</span>
</v-btn>
Expand Down Expand Up @@ -860,6 +860,21 @@ export default {
this.$ga.event('data_type', 'Custom Data', 'Files');
this.getStarted();
},
onLoadDemoDataFromConfig: function() {
let self = this;
this.promiseFetchDemoInputConfig()
.then(function() {
self.geneSet = ['PRX', 'LMNA', 'SCN8A', 'DLL4', 'ABCA3', 'MROH8', 'DVL3', 'NOTCH4']
self.$emit('setGeneSet', self.geneSet)
self.$emit("setPhenotypeText", "Charcot-Marie-Tooth disease; demyelination; Dejerine sottas disease possibly; sensory neuropathy; hammertoes; difficulty walking")
self.$ga.event('data_type', 'Custom Data', 'Config File');
self.getStarted();
})
.catch(function() {
alert("Unable to load demo data")
})
},
onLoadInputConfig: function(){
this.importConfigurationDialog = false;
if(this.genes.length && this.autocompleteGenesConfigFlag===false){
Expand Down Expand Up @@ -962,9 +977,6 @@ export default {
this.analysisInProgress = true;
this.setAnalysisInProgressStatus(this.analysisInProgress);
bus.$emit("initialize-clin");
if(e === 'demo'){
this.$ga.event('data_type', 'Demo Data', 'Demo dataset');
}
},
updateCarousel(payload) {
var currentSlide;
Expand Down Expand Up @@ -1061,81 +1073,114 @@ export default {
}
return bool;
},
promiseFetchDemoInputConfig() {
let self = this;
return new Promise(function(resolve, reject) {
let url = "https://iobio.s3.amazonaws.com/clin.iobio/example_file_config_GRCh37.csv"
fetch(url)
.then(res => {
if(!res.ok){
console.log("Unable to fetch demo config data file " + url);
reject()
}
else {
return res.text();
}
})
.then(data => {
console.log(data)
self.dataInputConfig = data
self.parseInputConfig(data)
self.validateSavedConfig = true
resolve()
})
.catch(error => {
console.log(error)
reject()
})
})
},
onInputConfig(ev) {
let self = this;
var reader = new FileReader();
if(this.dataInputConfig){
this.validationErrors = [];
this.savedInputConfig = null;
reader.readAsText(this.dataInputConfig);
reader.onload = () => {
let data = reader.result.trim();
if(this.validateHeadersOfConfigFile(data)){
let newLine = data.split('\n');
let headers = newLine.splice(0,4)
let pedData = [];
let modelInfoData = [];
let bedFileUrl = 'https://raw.githubusercontent.com/chmille4/bam.iobio.io/vue/client/data/20130108.exome.targets.bed';
let buildName = 'GRCh37';
this.caseTitle = headers[0].split('E:')[1].trim();
this.caseDescription = headers[1].split('N:')[1].trim();
let bedFile = headers[2].split('L:')[1].trim().split(",")[0];
if(bedFile !== ''){
bedFileUrl = bedFile;
}
let build = headers[3].split('D:')[1].trim();
if(build !== ''){
buildName = build;
}
let sexMap = {
"1": "male",
"2": "female",
"other": "unknown"
}
let statusMap = {
"0": false,
"1": false,
"2": true,
"-9": false
}
self.parseInputConfig(data)
}
}
},
parseInputConfig(data) {
if(this.validateHeadersOfConfigFile(data)){
let newLine = data.split('\n');
let headers = newLine.splice(0,4)
let pedData = [];
let modelInfoData = [];
let bedFileUrl = 'https://iobio.s3.amazonaws.com/clin.iobio/20130108.exome.targets.grch38.bed';
let buildName = 'GRCh38';
this.caseTitle = headers[0].split('E:')[1].trim();
this.caseDescription = headers[1].split('N:')[1].trim();
let bedFile = headers[2].split('L:')[1].trim().split(",")[0];
if(bedFile !== ''){
bedFileUrl = bedFile;
}
let build = headers[3].split('D:')[1].trim();
if(build !== ''){
buildName = build;
}
let sexMap = {
"1": "male",
"2": "female",
"other": "unknown"
}
let statusMap = {
"0": false,
"1": false,
"2": true,
"-9": false
}
if(this.validateInputConfig(data)){
for (var i = 0; i < newLine.length; i++) {
var pedLines = newLine[i].split(/\s+|\,/g).slice(0,6);
pedData.push(pedLines.join(' '));
if(this.validateInputConfig(data)){
for (var i = 0; i < newLine.length; i++) {
var pedLines = newLine[i].split(/\s+|\,/g).slice(0,6);
pedData.push(pedLines.join(' '));
var modelInfoLines = newLine[i].split(/\s+|\,/g).slice();
if(i!==0){
modelInfoLines[4] = sexMap[modelInfoLines[4]];
modelInfoLines[5] = statusMap[modelInfoLines[5]];
}
modelInfoData.push(modelInfoLines);
}
modelInfoData.shift();
let pedFile = pedData.join('\n');
this.formatCustomModelInfo(modelInfoData);
this.$emit("setBedFileUrl", bedFileUrl);
this.$emit("set-ped-data", pedFile);
this.$emit('setBuildForCustomData', buildName);
this.$emit("set-custom-case-summary", {
name: this.caseTitle,
description: this.caseDescription
})
}
else {
this.validationErrors.push("Headers do not match with the specified file format. Please check the configuration file and try again.")
this.dataInputConfig = null;
var modelInfoLines = newLine[i].split(/\s+|\,/g).slice();
if(i!==0){
modelInfoLines[4] = sexMap[modelInfoLines[4]];
modelInfoLines[5] = statusMap[modelInfoLines[5]];
}
modelInfoData.push(modelInfoLines);
}
else{
this.validationErrors.push("Headers do not match with the specified file format. Please check the configuration file and try again.")
this.dataInputConfig = null;
}
modelInfoData.shift();
let pedFile = pedData.join('\n');
this.formatCustomModelInfo(modelInfoData);
this.$emit("setBedFileUrl", bedFileUrl);
this.$emit("set-ped-data", pedFile);
this.$emit('setBuildForCustomData', buildName);
this.$emit("set-custom-case-summary", {
name: this.caseTitle,
description: this.caseDescription
})
}
else {
this.validationErrors.push("Headers do not match with the specified file format. Please check the configuration file and try again.")
this.dataInputConfig = null;
}
}
else{
this.validationErrors.push("Headers do not match with the specified file format. Please check the configuration file and try again.")
this.dataInputConfig = null;
}
},
formatCustomModelInfo(modelInfoData){
var modelInfo = [];
Expand Down
Loading

0 comments on commit fed4745

Please sign in to comment.