Source code for schrodinger.ui.sequencealignment.msv_menu

"""
Holds the list of all menu information including menu names, menu option names,
slots, tool tips, short cuts, and child lists. ::

    [
        ['menu name',
            ['action label', 'slot method name', 'tool tip', 'shortcut',
             'set checkable', 'icon'],
            ['label2', 'slot', 'tool tip', 'shortcut', 'checkable', 'icon'],
            ['separator'], <-- if want a separator in the menu, put here
            [.... ],
        ['2nd menu name',
            ['action label', ....],
            ['label for sub list'],
            ['sub-action label', ....],
            ['sub-action label',....],
            [...]
        ],
        ['3rd menu name',
            [..],
            [...]
        ]
    ]

This list will be used in msv's viewer.py to then create a dictionary of
label: actions and creates all the menus.
"""

from schrodinger import get_maestro

maestro = get_maestro()

SEPARATOR = "separator"

# MAESTRO_MENU_LIST = the modified MENU_LIST for if maestro (created at end)

MENU_LIST = [
    #Menu names
    #File Menu [0]
    [
        "&File",  #labels are the dictionary keys
        # label, slot, tooltip, shortcut, checkable, icon
        ["New Query", "viewerNewSet", "", "", "", ""],
        ["Rename Query", "queryRename", "", "", "", ""],
        ["Duplicate Query", "viewerDuplicateSet", "", "", "", ""],
        ["Delete Query", "queryDelete", "", "", "", ""],
        [SEPARATOR],
        [
            "Open...", "loadProject", "Load project from a file", "Ctrl+Alt+O",
            "", ""
        ],
        [
            "Save", "saveProject", "Save current project", "", "",
            ":/icons/icon_save_file.png"
        ],
        [
            "Save As...", "saveProjectAs",
            "Save current project to a specified file", "", "",
            ":/icons/icon_save_file.png"
        ],
        [SEPARATOR],
        [
            "Import Sequences...", "open", "Import sequences from a file",
            "Ctrl+O", "", ":/icons/icon_import_sequences.png"
        ],
        [
            "&Export Sequences...", "saveAs", "Export the sequences to file",
            "Ctrl+S", "", ":/icons/icon_save_file.png"
        ],
        ["Send Back to &Knime", "backToKnime", "", "", "", ""],
        [SEPARATOR],
        ["&Save Image...", "saveImageAs", "Save image", "Ctrl+I", "", ""],
        [SEPARATOR],
        ["E&xit", "close", "Exit the application", "Ctrl+Q", "", ""]
    ],
    #Edit Menu [1]
    [
        "&Edit",
        # label, slot, tooltip, shortcut, checkable, icon
        [
            "&Undo", "viewerUndo", "Undo last editing operation", "Ctrl+Z", "",
            ":/icons/icon_undo.png"
        ],
        [
            "&Redo", "viewerRedo", "Redo last editing operation", "Ctrl+Y", "",
            ":/icons/icon_redo.png"
        ],
        [SEPARATOR],
        [
            "New Sequence...", "viewerCreateSequence", "Create a new sequence",
            "", "", ""
        ],
        [
            "Edit Sequence...", "viewerEditSequence", "Edit a sequence", "", "",
            ""
        ],
        [
            "Paste in FASTA Format...", "viewerPasteFasta",
            "Paste text in FASTA format", "", "", ""
        ],
        [
            "&Duplicate Selected Sequences", "viewerDuplicate",
            "Duplicate selected sequences", "Ctrl+D", "", ""
        ],
        [SEPARATOR],
        ["Find Pattern...", "viewerFindPattern", "", "Ctrl+F", "", ""],
        [SEPARATOR],
        [
            "Renumber Residues...", "viewerRenumberResidues", "", "Ctrl+R", "",
            ""
        ],
        [SEPARATOR],
        ["&Delete Selection", "viewerDeleteSelected", "", "", "", ""],
        [
            "Remove Redundant Sequences...", "viewerRemoveRedundancy", "", "",
            "", ""
        ]
    ],
    #Sequences Menu [2]
    [
        "&Sequences",
        # label, slot, tool tip, shortcut, checkable, icon
        [
            "Clear All", "newFile", "Delete all sequences", "Ctrl+C", "",
            ":/icons/icon_new.png"
        ],
        [SEPARATOR],
        ["Select All", "viewerSelectAllSequences", "", "", "", ""],
        ["Deselect All", "viewerUnselectAllSequences", "", "", "", ""],
        ["Invert Selection", "viewerInvertSequenceSelection", "", "", "", ""],
        [SEPARATOR],
        [
            "&Hide Selected", "viewerHideSelected", "Hide Selected Sequences",
            "", "", ""
        ],
        ["Show All", "viewerShowAll", "", "", "", ""],
        [SEPARATOR],
        [
            "&Collapse All", "viewerCollapseAll", "Collapse All Sequences", "",
            "", ""
        ],
        ["&Expand All", "viewerExpandAll", "Expand All Sequences", "", "", ""],
        [
            "Set Color of Sequence Name", "viewerSetSequenceColor", "", "", "",
            ""
        ],
        [SEPARATOR],
        #SUBLIST of Sequences: [2][14]
        [
            "Sort &Ascending",
            # label, slot, tool tip, shortcut, checkable, icon
            ["by Name", "sortByName", "", "", "", ""],
            ["by Chain ID", "sortByChain", "", "", "", ""],
            ["by Length", "sortByLength", "", "", "", ""],
            ["by Number Of Gaps", "sortByGaps", "", "", "", ""],
            [SEPARATOR],
            ["by Sequence Identity", "sortByIdentity", "", "", "", ""],
            ["by Sequence Similarity", "sortBySimilarity", "", "", "", ""],
            ["by Sequence Homology", "sortByHomology", "", "", "", ""],
            ["by Sequence Score", "sortByScore", "", "", "", ""]
        ],
        #SUBLIST of sequences: [2][15]
        [
            "Sort &Descending",
            # label, slot, tool tip, shortcut, checkable, icon
            ["by Name", "sortByNameReverse", "", "", "", ""],
            ["by Chain", "sortByChainReverse", "", "", "", ""],
            ["by Length", "sortByLengthReverse", "", "", "", ""],
            ["by Number Of Gaps", "sortByGapsReverse", "", "", "", ""],
            [SEPARATOR],
            ["by Sequence Identity", "sortByIdentityReverse", "", "", "", ""],
            [
                "by Sequence Similarity", "sortBySimilarityReverse", "", "", "",
                ""
            ],
            ["by Sequence Homology", "sortByHomologyReverse", "", "", "", ""],
            ["by Sequence Score", "sortByScoreReverse", "", "", "", ""]
        ],
        ["Sort by &Tree Order", "sortByTreeOrder", "", "", "True", ""],
        [SEPARATOR],
        ["&Move Up", "viewerMoveUp", "", "", "", ""],
        ["&Move Down", "viewerMoveDown", "", "", "", ""],
        ["&Move to Top", "viewerMoveTop", "", "", "", ""],
        ["&Move to Bottom", "viewerMoveBottom", "", "", "", ""],
        [SEPARATOR],
        ["Get PDB Structures", "viewerDownloadPDB", "", "", "", ""]
    ],
    #Alignment Menu: [3]
    [
        "&Alignment",
        # label, slot, tool tip, shortcut, checkable, icon
        [
            "Multiple Alignment", "viewerRunClustal", "Run multiple sequence "
            "alignment algorithm on selected sequences or on selected columns",
            "", "", ":/icons/icon_multiple_align.png"
        ],
        [SEPARATOR],
        [
            "Pairwise Alignment", "viewerPairwiseAlignment", "Align selected "
            "sequence(s) with a query sequence using pairwise alignment", "",
            "", ":/icons/icon_pairwise_align.png"
        ],
        [
            "Align and Merge", "viewerAlignMerge",
            "Iteratively align and merge "
            "selected sequences without destroying the existing alignment", "",
            "", ""
        ],
        [
            "Align By Residue Numbers", "viewerAlignByResidueNumbers",
            "Align sequences by residue numbers", "", "", ""
        ],
        [
            "Use Constraints", "viewerSetConstraints",
            "Enable pairwise alignment "
            "constraints", "", "True", ""
        ],
        [
            "Clear Constraints", "viewerClearConstraints", "Clear alignment "
            "constraints", "", "", ""
        ],
        ["Alignment Settings...", "viewerAlignmentSettings", "", "", "", ""],
        [SEPARATOR],
        [
            "&Lock Gaps", "viewerLockGaps", "Lock Gaps In Alignment", "", "",
            ":/icons/icon_lock.png"
        ],
        [
            "&Unlock Gaps", "viewerUnlockGaps", "Unlock Gaps In Alignment", "",
            "", ":/icons/icon_unlock.png"
        ],
        [SEPARATOR],
        ["&Select Identities", "viewerSelectIdentities", "", "", "", ""],
        ["&Select Aligned Blocks", "viewerSelectBlocks", "", "", "", ""],
        [
            "&Select Columns with Structure", "viewerSelectStructure", "", "",
            "", ""
        ],
        [
            "Expand Selection", "viewerExpandSelection",
            "Expand selection to entire"
            " columns", "", "", ""
        ],
        [
            "Expand Selection from Query", "viewerExpandSelectionRef", "Expand "
            "selection to entire columns", "", "", ""
        ],
        [SEPARATOR],
        ["Hide Selected Columns", "viewerHideColumns", "", "", "", ""],
        [
            "Hide Un-selected Columns", "viewerHideUnselectedColumns", "", "",
            "", ""
        ],
        ["Show All Columns", "viewerShowColumns", "", "", "", ""],
        [SEPARATOR],
        ["Select All", "viewerSelectAll", "Selects All Residues", "", "", ""],
        [
            "Invert Selection", "viewerInvertSelection",
            "Inverts Residue Selection", "", "", ""
        ],
        [
            "Deselect All", "viewerDeselectAll", "Deselects All Residues", "",
            "", ""
        ],
        ["Delete", "viewerDeleteSelectedResidues", "", "", "", ""],
        ["Crop", "viewerCropSelectedResidues", "", "", "", ""],
        [SEPARATOR],
        ["Remove Empty Columns", "viewerMinimizeAlignment", "", "", "", ""],
        ["&Fill with Gaps", "viewerFillGaps", "", "", "", ""],
        ["&Remove Gaps", "viewerRemoveGaps", "", "", "", ""],
        [SEPARATOR],
        ["Track Changes", "viewerAddHistory", "", "", "True", ""],
        ["Reset History", "viewerResetHistory", "", "", "", ""]
    ],
    # Color menu: [4]
    [
        "Color",
        # label, slot, tool tip, shortcut, checkable, icon
        ["Residue Type", "viewerColorResidueType", "", "", "", ""],
        ["Residue Similarity", "viewerColorSimilarity", "", "", "", ""],
        [
            "Hydrophobicity (Kyte-Doolittle)", "viewerColorKyteDoolittle", "",
            "", "", ""
        ],
        ["Hydrophilicity (Hopp-Woods)", "viewerColorHoppWoods", "", "", "", ""],
        ["Taylor Scheme", "viewerColorTaylor", "", "", "", ""],
        ["Residue Position", "viewerColorPosition", "", "", "", ""],
        #Color submenu- Constant color: [4][7]
        [
            "Constant Color", ["Red", "viewerColorResidues", "", "", "", ""],
            ["Green", "viewerColorResidues", "", "", "", ""],
            ["Blue", "viewerColorResidues", "", "", "", ""],
            ["Cyan", "viewerColorResidues", "", "", "", ""],
            ["Magenta", "viewerColorResidues", "", "", "", ""],
            ["Yellow", "viewerColorResidues", "", "", "", ""],
            ["Orange", "viewerColorResidues", "", "", "", ""],
            ["Teal", "viewerColorResidues", "", "", "", ""],
            ["Black", "viewerColorResidues", "", "", "", ""],
            ["Dark Gray", "viewerColorResidues", "", "", "", ""],
            ["Light Gray", "viewerColorResidues", "", "", "", ""],
            ["White", "viewerColorResidues", "", "", "", ""], [SEPARATOR],
            ["Custom...", "viewerConstantColorCustom", "", "", "", ""]
        ],
        [SEPARATOR],
        ["Secondary Structure", "viewerColorSecondary", "", "", "", ""],
        ["B factor", "viewerColorBfactor", "", "", "", ""],
        [SEPARATOR],
        #Color sub menu- Residue Propensities: [4][12]
        [
            "Residue Propensities",
            ["&Helix Propensity", "viewerColorHelixPropensity", "", "", "", ""],
            [
                "&Strand Propensity", "viewerColorStrandPropensity", "", "", "",
                ""
            ],
            ["&Turn Propensity", "viewerColorTurnPropensity", "", "", "", ""],
            [
                "Exposure Tendency", "viewerColorExposureTendency", "", "", "",
                ""
            ], ["&Steric Group", "viewerColorStericGroup", "", "", "", ""],
            [
                "Sidechain Chemistry", "viewerColorSidechainChemistry", "", "",
                "", ""
            ]
        ],
        [SEPARATOR],
        #Color sub menu - Mark Residues [4][14]
        [
            "Mark Residues",
            # label, slot, tool tip, shortcut, checkable, icon
            ["Red", "viewerMarkResidues", "", "", "", ""],
            ["Green", "viewerMarkResidues", "", "", "", ""],
            ["Blue", "viewerMarkResidues", "", "", "", ""],
            ["Cyan", "viewerMarkResidues", "", "", "", ""],
            ["Magenta", "viewerMarkResidues", "", "", "", ""],
            ["Yellow", "viewerMarkResidues", "", "", "", ""],
            ["Orange", "viewerMarkResidues", "", "", "", ""],
            ["Teal", "viewerMarkResidues", "", "", "", ""],
            ["Black", "viewerMarkResidues", "", "", "", ""],
            ["Dark Gray", "viewerMarkResidues", "", "", "", ""],
            ["Light Gray", "viewerMarkResidues", "", "", "", ""],
            ["White", "viewerMarkResidues", "", "", "", ""],
            [SEPARATOR],
            ["Custom...", "viewerMarkColorCustom", "", "", "", ""],
            [SEPARATOR],
            [
                "Unmark Residues", "viewerClearMarkedResidues",
                "Clears the marked "
                "residues", "", "", ""
            ]
        ],
        [SEPARATOR],
        ["Adjust Color Range...", "viewerWeightColorsSettings", "", "", "", ""],
        [SEPARATOR],
        #Color sub menu - Background Color [4][18]
        [
            "Background Color",
            ["Black", "viewerBackgroundColor", "", "", "", ""],
            ["Dark Gray", "viewerBackgroundColor", "", "", "", ""],
            ["Light Gray", "viewerBackgroundColor", "", "", "", ""],
            ["White", "viewerBackgroundColor", "", "", "", ""], [SEPARATOR],
            ["Custom...", "viewerBackgroundColorCustom", "", "", "", ""]
        ],
        [SEPARATOR],
        [
            "Color Matching Residues Only", "viewerWeightColorsIdentity",
            "Color "
            "Matching Residues Only", "", "True",
            ":/icons/icon_mark_identities.png"
        ],
        [
            "Color Different Residues Only", "viewerWeightColorsDifference",
            "Color "
            "Different Residues Only", "", "True",
            ":/icons/icon_mark_differences.png"
        ],
        [
            "&Weight Colors by Alignment Quality", "viewerWeightColors",
            "Weight "
            "Colors by Alignment Quality", "", "True",
            ":/icons/icon_weight_colors.png"
        ],
        [
            "&Average Colors In Columns", "viewerAverageColumns",
            "Average Colors In "
            "Columns", "", "True", ":/icons/icon_average_colors.png"
        ],
        [
            "Color Sequences", "viewerToggleColors", "Toggle sequence coloring",
            "", "True", ""
        ],
        ["Adjust Text Contrast", "viewerToggleAutoColor", "", "", "True", ""]
    ],
    #Annotation Menu: [5]
    [
        "&Annotations",
        # label, slot, tool tip, shortcut, checkable, icon
        ["Consensus Sequence", "viewerAddConsensus", "", "", "True", ""],
        ["Consensus Symbols", "viewerAddSymbols", "", "", "True", ""],
        ["Sequence Logo", "viewerAddSequenceLogo", "", "", "True", ""],
        [
            "Mean Hydrophobicity", "viewerAddMeanHydrophobicity", "", "",
            "True", ""
        ],
        ["Mean Isoelectric Point", "viewerAddMeanPI", "", "", "True", ""],
        [SEPARATOR],
        ["Add Global Annotations", "viewerAddGlobal", "", "", "", ""],
        ["Remove Global Annotations", "viewerRemoveGlobal", "", "", "", ""],
        [SEPARATOR],
        ["Residue Numbers", "viewerAddResnumAnnotation", "", "", "True", ""],
        ["Secondary Structure Assignment", "viewerAddSSA", "", "", "True", ""],
        ["B factor", "viewerAddBFactorAnnotation", "", "", "True", ""],
        ["Disulfide Bonds", "viewerAddSSBondAnnotation", "", "", "True", ""],
        [
            "Hydrophobicity", "viewerAddHydrophobicityAnnotation", "", "",
            "True", ""
        ],
        ["Isoelectric Point", "viewerAddPIAnnotation", "", "", "True", ""],
        [SEPARATOR],
        #Annotation sub menu - Color Blocks [5][17]
        [
            "Color Blocks",
            ["All Color Blocks", "viewerAddAllColorBlocks", "", "", "", ""],
            [
                "Remove Color Blocks", "viewerRemoveAllColorBlocks", "", "", "",
                ""
            ],
            [SEPARATOR],
            [
                "&Helix Propensity", "viewerAddHelixPropensityAnnotation", "",
                "", "True", ""
            ],
            [
                "&Strand Propensity", "viewerAddStrandPropensityAnnotation", "",
                "", "True", ""
            ],
            [
                "&Turn Propensity", "viewerAddTurnPropensityAnnotation", "", "",
                "True", ""
            ],
            [
                "Helix Termination", "viewerAddHelixTerminatorsAnnotation", "",
                "", "True", ""
            ],
            [
                "Exposure Tendency", "viewerAddExposureTendencyAnnotation", "",
                "", "True", ""
            ],
            [
                "&Steric Group", "viewerAddStericGroupAnnotation", "", "",
                "True", ""
            ],
            [
                "Side-Chain Chemistry", "viewerAddSidechainChemistryAnnotation",
                "", "", "True", ""
            ],
        ],
        [SEPARATOR],
        #ANNOTATION sub menu - User Annotations [5][19]
        [
            "User Annotations",
            [
                "Mark Alignment Region", "viewerUserAddAlignmentRegion", "", "",
                "", ""
            ],
            [
                "Mark Rectangular Region", "viewerUserAddRectangle", "", "", "",
                ""
            ],
            [
                "Add Custom Annotation", "viewerUserAddCustomAnnotation", "",
                "", "", ""
            ], [SEPARATOR],
            ["Remove All", "viewerUserRemoveAll", "", "", "", ""]
        ],
        [SEPARATOR],
        ["Clear Annotations", "viewerDeleteAnnotations", "", "", "", ""]
    ],
    #Tools Menu [6]
    [
        "&Tools",
        # label, slot, tool tip, shortcut, checkable, icon
        [
            "Find Homologs (BLAST)...", "viewerRunBlast", "Run Blast search",
            "", "", ""
        ],  #BLAST SEARCH DOES NOT NEED TO BE IN NEW ONE.
        [
            "Show Results of BLAST Search", "viewerShowBlast",
            "Displays a BLAST results dialog.", "", "", ""
        ],
        [SEPARATOR],
        [
            "Find Family (Pfam)", "viewerRunPfam", "Generate Pfam annotation",
            "", "", ""
        ],
        [SEPARATOR],
        #Tools submenu - Predict [6][6]
        [
            "Predict",
            [
                "Run All Predictions", "viewerRunAllPredictions",
                "Run All Predictions", "", "", ""
            ], [SEPARATOR],
            [
                "Secondary Structure", "viewerRunSSP", "Secondary Structure",
                "", "", ""
            ],
            [
                "Solvent Accessibility", "viewerRunACCpro",
                "Solvent Accessibility", "", "", ""
            ],
            [
                "Domain Arrangement", "viewerRunDOMpro", "Domain Arrangement",
                "", "", ""
            ],
            [
                "Disordered Regions", "viewerRunDISpro", "Disordered Regions",
                "", "", ""
            ],
            [
                "Disulfide Bridges", "viewerRunDIpro", "Disulfide Bridges", "",
                "", ""
            ],
            [
                "Beta Strand Contacts", "viewerRunBETApro",
                "Beta Strand Contacts", "", "", ""
            ]
        ],
        #back to Tools:
        ["Clear Predictions", "viewerDeletePredictions", "", "", "", ""],
        [SEPARATOR],
        [
            "Build Homology Model", "viewerBuildModel",
            "Build Homology Model of "
            "Query Sequence", "", "", ":/icons/icon_3d_model.png"
        ],
        [SEPARATOR],
        ["Analyze Binding Site...", "viewerAnalyzeBindingSite", "", "", "", ""],
        ["Compare Sequences...", "viewerCompareSequences", "", "", "", ""],
        [SEPARATOR],
        ["Show Job Settings...", "viewerShowJobSettings", "", "", "", ""],
        ["Show Job Log...", "viewerShowJobLog", "", "", "", ""]
    ],
    #Settings Menu
    [
        "Sett&ings",
        [
            "&Wrap Sequences", "viewerWrapSequences", "", "", "True",
            ":/icons/icon_wrap.png"
        ],
        [
            "Group Annotations by Type", "viewerGroupAnnotations", "", "",
            "True", ""
        ],
        #Settings sub menu- Font Size
        [
            "&Font Size",  #Currently these belong to an action group...
            ["4", "connectNoSlot", "", "", "True", ""],
            ["6", "connectNoSlot", "", "", "True", ""],
            ["8", "connectNoSlot", "", "", "True", ""],
            ["10", "connectNoSlot", "", "", "True", ""],
            ["12", "connectNoSlot", "", "", "True", ""],
            ["14", "connectNoSlot", "", "", "True", ""],
            ["16", "connectNoSlot", "", "", "True", ""],
            ["18", "connectNoSlot", "", "", "True", ""],
            ["20", "connectNoSlot", "", "", "True", ""],
            ["22", "connectNoSlot", "", "", "True", ""],
            ["24", "connectNoSlot", "", "", "True", ""],
        ],
        [SEPARATOR],
        ["&Display Ruler", "viewerToggleRuler", "", "", "True", ""],
        [
            "&Display Alignment Tooltips", "viewerToggleTooltips", "", "",
            "True", ""
        ],
        ["&Display Header Row", "viewerToggleHeaderRow", "", "", "True", ""],
        [
            "&Replace Identities With Dots", "viewerToggleUseDots", "", "",
            "True", ""
        ],
        ["&Pad Alignment with Gaps", "viewerPadAlignment", "", "", "True", ""],
        ["Hide Empty Lines", "viewerHideEmptyLines", "", "", "True", ""],
        [SEPARATOR],
        [
            "&Display Sequence Boundaries", "viewerToggleDisplayBoundaries", "",
            "", "True", ""
        ],
        [SEPARATOR],
        [
            "&Display Percentage Identity", "viewerToggleDisplayIdentity", "",
            "", "True", ""
        ],
        [
            "&Display Percentage Similarity", "viewerToggleDisplaySimilarity",
            "", "", "True", ""
        ],
        [
            "&Display Percentage Homology", "viewerToggleDisplayHomology", "",
            "", "True", ""
        ],
        ["&Display Score", "viewerToggleDisplayScore", "", "", "True", ""],
        [
            "Include Gaps in Sequence Identity Calculations",
            "viewerConsiderGaps", "", "", "True", ""
        ],
        [
            "Calculate Sequence Identity Only in Selected Columns",
            "viewerToggleIdentityInColumns", "", "", "True", ""
        ],
        [SEPARATOR],
        [
            "Update Sequence Profile", "viewerComputeSequenceProfile", "", "",
            "", ""
        ],
        [
            "Automatically Update Sequence Profile",
            "viewerAutoComputeSequenceProfile", "", "", "True", ""
        ],
        [
            "Ask Before Accessing a Remote Server", "viewerSetAlwaysAsk", "",
            "", "True", ""
        ],
        [SEPARATOR],
        ["Return to Default Settings", "viewerResetSettings", "", "", "", ""]
    ]
]

# List of sublists where sublist[0] is path before sublist[2] will insert!
# sublist[1] = insert after separator (because separator has no clear path)
IF_MAESTRO_INSERT = [
    [
        "&Annotations/Isoelectric Point", "",
        ["Ligand Contacts", "viewerShowLigands", "", "", "True", ""]
    ],
    [
        "&Annotations/Ligand Contacts", "separator between!",
        ["&Antibody CDRs", "viewerRenumberToAntibody", "", "", "True", ""]
    ],
    [
        "&Annotations/&Antibody CDRs", "",
        ["Select Antibody CDRs", "viewerSelectAntibodyRegions", "", "", "", ""]
    ],
    [
        "&Annotations/Select Antibody CDRs",
        "",
        #sub menu:
        [
            "Antibody Numbering Scheme",
            ["Chothia", "viewerRenumberToAntibody", "", "", "True", ""],
            [
                "Enhanced Chothia", "viewerRenumberToAntibody", "", "", "True",
                ""
            ], ["Kabat", "viewerRenumberToAntibody", "", "", "True", ""],
            ["IMGT", "viewerRenumberToAntibody", "", "", "True", ""],
            ["AHo", "viewerRenumberToAntibody", "", "", "True", ""],
            [SEPARATOR]
        ],  #out of sub menu
    ],
    [
        "&Tools",
        "",
        #adding menu maestro after Tools:
        [
            "&Maestro",
            # label, slot, tool tip, shortcut, checkable, icon
            [
                "Incorporate Entries from Workspace",
                "viewerIncorporateIncluded", "", "", "", ""
            ],
            [
                "Incorporate Selected Entries from Project Table",
                "viewerIncorporateSelected", "", "", "", ""
            ],
            [
                "Include Incorporated Entries in Workspace", "connectNoSlot",
                "", "", "True", ""
            ],
            [
                "Associate Maestro Entries...", "viewerAssociateMaestroEntries",
                "", "", "", ""
            ],
            [SEPARATOR],
            [
                "Superimpose Structures According to Sequence Alignment",
                "viewerMaestroSuperposition", "", "", "", ""
            ],
            [
                "Protein Structure Alignment", "viewerAlignStructures",
                "Aligns protein structures.", "", "", ""
            ],
            [
                "Align Sequences According to Structure Superposition",
                "viewerGetStructureAlignment", "", "", "", ""
            ],
            [SEPARATOR],
            [
                "Get Colors from Maestro Workspace", "viewerColorMaestro", "",
                "", "", ""
            ],
            [
                "Apply Colors to Workspace", "viewerPropagateColors", "", "",
                "", ""
            ],
            [
                "Color Entry Surface", "viewerColorEntrySurface",
                "Colors surface of the entry using MSV colors.", "", "", ""
            ],
            [SEPARATOR],
            [
                "Update from Maestro", "viewerSynchronizeWithMaestro", "", "",
                "", ""
            ],
            [
                "Update Maestro Workspace Selection from MSV",
                "viewerPassSelectionToMaestro", "", "", "", ""
            ],
            [
                "&Update Automatically from Maestro",
                "viewerAutoSynchronizeWithMaestro", "", "", "True", ""
            ],
            [
                "Allow Structural Changes", "viewerMutateWhileTyping", "", "",
                "True", ""
            ]
        ]
    ]
]


[docs]def insertSublistAfterPath(path, sub_list, main_list): """ Given the path of the action AFTER which you wish to insert the sublist, inserts it into main_list. For example, given path: "Color/Mark Residues/Red", and sub_list ["HELLO"], inserts:: [Mark Residues, ['Red', 'viewerMarkResidues', '', '', '', ''], ['HELLO'], ...] """ path_list = path.split("/") menu = main_list for sub_menu_name in path_list[:len(path_list) - 1]: index_of_sub_menu = indexOfMenuList(sub_menu_name, menu) menu = menu[index_of_sub_menu] insert_after_index = indexOfMenuList(path_list[-1], menu) menu.insert(insert_after_index + 1, sub_list)
[docs]def insertSublistOneAfterPath(path, sub_list, main_list): """ just like insertSublistAfterPath, but used when separator between """ path_list = path.split("/") menu = main_list for sub_menu_name in path_list[:len(path_list) - 1]: index_of_sub_menu = indexOfMenuList(sub_menu_name, menu) menu = menu[index_of_sub_menu] insert_after_index = indexOfMenuList(path_list[-1], menu) menu.insert(insert_after_index + 2, sub_list)
[docs]def indexOfMenuList(string_name, list): """ Get the index of the list containing a specific menu """ for sub_list_index in range(len(list)): if list[sub_list_index][0] == string_name: return sub_list_index
#Calculates MAESTRO_MENU_LIST: maestro_menu_list = MENU_LIST for lst in IF_MAESTRO_INSERT: if lst[1]: #if separator between path and insert insertSublistOneAfterPath(lst[0], lst[2], maestro_menu_list) else: #if insert right after path insertSublistAfterPath(lst[0], lst[2], maestro_menu_list) MAESTRO_MENU_LIST = maestro_menu_list