Skip to content

Commit

Permalink
- #1348 - fixed cases when all pdbs are missing
Browse files Browse the repository at this point in the history
  • Loading branch information
boriskovar-m2ms committed Apr 17, 2024
1 parent 49f0ae8 commit 6074d79
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 9 deletions.
4 changes: 2 additions & 2 deletions docker-compose.dev.vector.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,10 @@ services:
start_period: 10s
web:
container_name: web_dock
# image: xchem/fragalysis-stack:latest
image: xchem/fragalysis-stack:latest
# image: alanbchristie/fragalysis-backend:1187.3
# image: boriskovarm2ms/fragalysis-stack:experiment2
image: kaliif/fragalysis-backend:latest
# image: kaliif/fragalysis-backend:latest
command: /bin/bash /code/launch-stack.sh
volumes:
- ../data/logs:/code/logs/
Expand Down
19 changes: 14 additions & 5 deletions js/components/datasets/datasetMoleculeList.js
Original file line number Diff line number Diff line change
Expand Up @@ -487,9 +487,18 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {

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

const isSelectedTypeOn = typeList => {
const isSelectedTypeOn = (typeList, isLHSReference) => {
if (typeList) {
return typeList.some(molId => allMolecules.some(mol => mol.id === molId));
if (!isLHSReference) {
return typeList.some(molId => allMolecules.some(mol => mol.id === molId));
} else {
const molsWithLHSReference = allMolecules.filter(mol => mol.site_observation_code);
return typeList.some(molId =>
molsWithLHSReference.some(
mol => mol.site_observation_code === allMoleculesList.find(m => m.id === molId)?.code
)
);
}
}
return false;
};
Expand All @@ -498,9 +507,9 @@ const DatasetMoleculeList = ({ title, datasetID, url }) => {
return typeList && typeList.length > 0;
};

let isLigandOn = isSelectedTypeOn(ligandList);
let isProteinOn = isSelectedTypeOn(proteinList) || isSelectedTypeOn(proteinListDataset);
let isComplexOn = isSelectedTypeOn(complexList) || isSelectedTypeOn(complexListDataset);
let isLigandOn = isSelectedTypeOn(ligandList, false);
let isProteinOn = isSelectedTypeOn(proteinList, true) || isSelectedTypeOn(proteinListDataset, false);
let isComplexOn = isSelectedTypeOn(complexList, true) || isSelectedTypeOn(complexListDataset, false);

let areArrowsVisible =
isTypeOn(ligandList) ||
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ const DatasetMoleculeView = memo(
// #1249 dataset molecules currently could use side observation molecule for some renders
const allMolecules = useSelector(state => state.apiReducers.all_mol_lists);
const [pdbData, setPdbData] = useState(null);
const isPdbAvailable = !!(data && (data.pdb_info || pdbData));
const isPdbAvailable = !!(data && (data.pdb_info || data.site_observation_code));

useEffect(() => {
if (data.site_observation_code) {
Expand Down
2 changes: 1 addition & 1 deletion js/components/nglView/generatingObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const assignRepresentationArrayToComp = (representations, comp) => {

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

0 comments on commit 6074d79

Please sign in to comment.