Skip to content

Commit

Permalink
Replace job name with query accession in downloadable pdb/png
Browse files Browse the repository at this point in the history
  • Loading branch information
milot-mirdita committed Sep 4, 2023
1 parent 017775c commit 5f8fc8c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions frontend/StructureViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,8 @@ export default {
},
makeImage() {
if (!this.stage) return
const qIndex = this.hits.query.header.indexOf(' ');
const qAccession = qIndex === -1 ? this.hits.query.header : this.hits.query.header.substring(0, qIndex);
this.stage.viewer.setLight(undefined, undefined, undefined, 0.2)
this.stage.makeImage({
trim: true,
Expand All @@ -355,7 +357,7 @@ export default {
transparent: true,
}).then((blob) => {
this.stage.viewer.setLight(undefined, undefined, undefined, this.$vuetify.theme.dark ? 0.4 : 0.2)
download(blob, this.$route.params.ticket + '-' + this.alignment.target + ".png")
download(blob, qAccession + '-' + this.alignment.target + ".png")
})
},
makePdb() {
Expand All @@ -366,8 +368,10 @@ export default {
let tPDB = new PdbWriter(this.targetRepr.repr.structure, { renumberSerial: false }).getData()
qPDB = qPDB.split('\n').filter(line => line.startsWith('ATOM')).join('\n')
tPDB = tPDB.split('\n').filter(line => line.startsWith('ATOM')).join('\n')
const qIndex = this.hits.query.header.indexOf(' ');
const qAccession = qIndex === -1 ? this.hits.query.header : this.hits.query.header.substring(0, qIndex);
let result =
`TITLE ${this.$route.params.ticket} - ${this.alignment.target}
`TITLE ${qAccession} - ${this.alignment.target}
REMARK This file was generated by the Foldseek webserver:
REMARK https://search.foldseek.com
REMARK Please cite:
Expand All @@ -382,7 +386,7 @@ ${tPDB}
ENDMDL
END
`
download(new Blob([result], { type: 'text/plain' }), this.$route.params.ticket + '-' + this.alignment.target + ".pdb")
download(new Blob([result], { type: 'text/plain' }), qAccession + '-' + this.alignment.target + ".pdb")
}
},
watch: {
Expand Down

0 comments on commit 5f8fc8c

Please sign in to comment.