Skip to content

Commit 6074d79

Browse files
- #1348 - fixed cases when all pdbs are missing
1 parent 49f0ae8 commit 6074d79

File tree

4 files changed

+18
-9
lines changed

4 files changed

+18
-9
lines changed

docker-compose.dev.vector.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ services:
5353
start_period: 10s
5454
web:
5555
container_name: web_dock
56-
# image: xchem/fragalysis-stack:latest
56+
image: xchem/fragalysis-stack:latest
5757
# image: alanbchristie/fragalysis-backend:1187.3
5858
# image: boriskovarm2ms/fragalysis-stack:experiment2
59-
image: kaliif/fragalysis-backend:latest
59+
# image: kaliif/fragalysis-backend:latest
6060
command: /bin/bash /code/launch-stack.sh
6161
volumes:
6262
- ../data/logs:/code/logs/

js/components/datasets/datasetMoleculeList.js

+14-5
Original file line numberDiff line numberDiff line change
@@ -487,9 +487,18 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
487487

488488
const compoundColors = useSelector(state => state.datasetsReducers.compoundColorByDataset[datasetID]) ?? {};
489489

490-
const isSelectedTypeOn = typeList => {
490+
const isSelectedTypeOn = (typeList, isLHSReference) => {
491491
if (typeList) {
492-
return typeList.some(molId => allMolecules.some(mol => mol.id === molId));
492+
if (!isLHSReference) {
493+
return typeList.some(molId => allMolecules.some(mol => mol.id === molId));
494+
} else {
495+
const molsWithLHSReference = allMolecules.filter(mol => mol.site_observation_code);
496+
return typeList.some(molId =>
497+
molsWithLHSReference.some(
498+
mol => mol.site_observation_code === allMoleculesList.find(m => m.id === molId)?.code
499+
)
500+
);
501+
}
493502
}
494503
return false;
495504
};
@@ -498,9 +507,9 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
498507
return typeList && typeList.length > 0;
499508
};
500509

501-
let isLigandOn = isSelectedTypeOn(ligandList);
502-
let isProteinOn = isSelectedTypeOn(proteinList) || isSelectedTypeOn(proteinListDataset);
503-
let isComplexOn = isSelectedTypeOn(complexList) || isSelectedTypeOn(complexListDataset);
510+
let isLigandOn = isSelectedTypeOn(ligandList, false);
511+
let isProteinOn = isSelectedTypeOn(proteinList, true) || isSelectedTypeOn(proteinListDataset, false);
512+
let isComplexOn = isSelectedTypeOn(complexList, true) || isSelectedTypeOn(complexListDataset, false);
504513

505514
let areArrowsVisible =
506515
isTypeOn(ligandList) ||

js/components/datasets/datasetMoleculeView/datasetMoleculeView.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ const DatasetMoleculeView = memo(
463463
// #1249 dataset molecules currently could use side observation molecule for some renders
464464
const allMolecules = useSelector(state => state.apiReducers.all_mol_lists);
465465
const [pdbData, setPdbData] = useState(null);
466-
const isPdbAvailable = !!(data && (data.pdb_info || pdbData));
466+
const isPdbAvailable = !!(data && (data.pdb_info || data.site_observation_code));
467467

468468
useEffect(() => {
469469
if (data.site_observation_code) {

js/components/nglView/generatingObjects.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const assignRepresentationArrayToComp = (representations, comp) => {
2525

2626
export const generateProteinObject = data => {
2727
// Now deal with this target
28-
const prot_to_load = window.location.protocol + '//' + window.location.host + data.template_protein;
28+
const prot_to_load = data.template_protein;
2929
if (JSON.stringify(prot_to_load) !== JSON.stringify(undefined)) {
3030
return {
3131
name: OBJECT_TYPE.PROTEIN + '_' + data.id.toString(),

0 commit comments

Comments
 (0)