Open Fede112 opened 7 months ago
I tried another strategy, which involved adding a component to data
. Additionally, by using State('viewer', 'data')
, I managed to append more than one protein.
target=molstar_helper.get_targets(chain="A", residue=sResidues)
component=molstar_helper.create_component(f"{protein_name}/{sStart}-{sEnd}", target, 'cartoon')
data = molstar_helper.parse_url(f'{pdb_url}', component=component)
data_viewer.append(data)
However, with this approach, I encountered a strange behavior where the components were not applied to each protein, but rather to the last one. As a result, both proteins were displayed as the same component, Polymer, with the two components created only for the last element of data_viewer.
Thank you for liking this tool. The current version does not support showing part of a structure, but it has been planned. When loading a structure, molstar will add default representations for the whole structure. This can be controlled in the 1.2.0 release. By then you will need to create a component with the partition you would like to show.
Your additional quesitons:
Is there I way to submit a range of residues: [1:15]?
To submit a range of residues, you can use an iterator like list(range(1,15))
.
Do you have any example on how to do a superposition between two proteins?
I haven't investigated how to do this with code. But maybe you can toggle the control panel of molstar and do superposition manually?
I tried another strategy, which involved adding a component to
data
. Additionally, by usingState('viewer', 'data')
, I managed to append more than one protein.target=molstar_helper.get_targets(chain="A", residue=sResidues) component=molstar_helper.create_component(f"{protein_name}/{sStart}-{sEnd}", target, 'cartoon') data = molstar_helper.parse_url(f'{pdb_url}', component=component) data_viewer.append(data)
However, with this approach, I encountered a strange behavior where the components were not applied to each protein, but rather to the last one. As a result, both proteins were displayed as the same component, Polymer, with the two components created only for the last element of data_viewer.
Thank you for reporting this issue. I have fixed it in the 1.1.2-dev branch.
Hi, First of all, thanks a lot for the tool, it is really useful! I wanted to ask if there is a way to download a protein from AFDB but only display a range of residues, all within a single callback. I am trying the following but it is not working. Initially I see the selection but it gets erased automatically:
Two additional quesitons: 1) Is there I way to submit a range of residues: [1:15]? 2) Do you have any example on how to do a superposition between two proteins?
Thanks in advance!