def return_molecule(n_clicks, filename):
    molstyles_dict = {
        "representations": ["cartoon", "axes+box"],
        "chosenAtomsColor": "red",
        "chosenAtomsRadius": 1,
        "molSpacingXaxis": 100,
    }

    data_list = [
        ngl_parser.get_data(data_path=data_path,
                            pdb_id='1BNA',
                            color='red',
                            reset_view=True,
                            local=False)
    ]

    imageParameters = {
        "antialias": True,
        "transparent": True,
        "trim": True,
        "defaultFilename": filename
    }

    downloadImage = False

    if n_clicks > 0:
        downloadImage = True

    return data_list, molstyles_dict, downloadImage, imageParameters
def return_molecule(value, color):
    if (value is None):
        raise PreventUpdate

    molstyles_dict = {
        "representations": ["cartoon", "axes+box"],
        "chosenAtomsColor": color,
        "chosenAtomsRadius": 1,
        "molSpacingXaxis": 100,
    }
    data_list = [ngl_parser.get_data(data_path=data_path, pdb_id=value, color="red",
                            reset_view=True, local=False)]

    return data_list, molstyles_dict
Esempio n. 3
0
def return_molecule(height, width):
    molstyles_dict = {
        "representations": ["cartoon", "axes+box"],
        "chosenAtomsColor": "red",
        "chosenAtomsRadius": 1,
        "molSpacingXaxis": 100,
    }

    data_list = [
        ngl_parser.get_data(data_path=data_path,
                            pdb_id='1BNA',
                            color='red',
                            reset_view=True,
                            local=False)
    ]

    return data_list, molstyles_dict, height, width
def return_molecule(style, sidebyside):
    molstyles_dict = {
        "representations": style,
        "chosenAtomsColor": "red",
        "chosenAtomsRadius": 1,
        "molSpacingXaxis": 100,
        "sideByside": sidebyside
    }

    data_list = [
        ngl_parser.get_data(data_path=data_path,
                            pdb_id=molecule,
                            color='red',
                            reset_view=True,
                            local=False) for molecule in ['NSP2', 'NSP4']
    ]

    return data_list, molstyles_dict
def return_molecule(color, quality, camera):
    molstyles_dict = {
        "representations": ["cartoon", "axes+box"],
        "chosenAtomsColor": "white",
        "chosenAtomsRadius": 1,
        "molSpacingXaxis": 100,
    }

    stage_params = {
        "quality": quality,
        "backgroundColor": color,
        "cameraType": camera
    }

    data_list = [ngl_parser.get_data(data_path=data_path, pdb_id=molecule, color='red',
                            reset_view=True, local=False)
                 for molecule in ['1BNA', 'PLPR']]

    return data_list, molstyles_dict, stage_params