def ProcessChainIDs():
    """Process specified chain IDs for infiles."""
    
    OptionsInfo["InfilesInfo"]["SpecifiedChainsAndLigandsInfo"] = []
    OptionsInfo["InfilesInfo"]["ChainSelections"] = []
    
    for FileIndex in range(0, len(OptionsInfo["InfilesInfo"]["InfilesNames"])):
        MiscUtil.PrintInfo("\nProcessing specified chain IDs for input file %s..." % OptionsInfo["InfilesInfo"]["InfilesNames"][FileIndex])
        
        ChainsAndLigandsInfo = OptionsInfo["InfilesInfo"]["ChainsAndLigandsInfo"][FileIndex]
        SpecifiedChainsAndLigandsInfo = PyMOLUtil.ProcessChainsAndLigandsOptionsInfo(ChainsAndLigandsInfo, "-c, --chainIDs", OptionsInfo["ChainIDs"], None, None)

        # Setup chain selections...
        ChainSelections = None
        if not OptionsInfo["AllChains"]:
            Chains = []
            for ChainID in SpecifiedChainsAndLigandsInfo["ChainIDs"]:
                Chains.append("chain %s" % ChainID)
            ChainSelections = " or ".join(Chains)
            ChainSelections = "(%s)" % ChainSelections
        
        OptionsInfo["InfilesInfo"]["SpecifiedChainsAndLigandsInfo"].append(SpecifiedChainsAndLigandsInfo)
        OptionsInfo["InfilesInfo"]["ChainSelections"].append(ChainSelections)
        
        MiscUtil.PrintInfo("Specified chain IDs: %s" % (", ".join(SpecifiedChainsAndLigandsInfo["ChainIDs"])))
Exemplo n.º 2
0
def ProcessChainIDs():
    """Process specified chain IDs for infile."""
    
    MiscUtil.PrintInfo("\nProcessing specified chain IDs for input file %s..." % OptionsInfo["Infile"])        
    ChainsAndLigandsInfo = OptionsInfo["ChainsAndLigandsInfo"]
    SpecifiedChainsAndLigandsInfo = PyMOLUtil.ProcessChainsAndLigandsOptionsInfo(ChainsAndLigandsInfo, "-c, --chainIDs", OptionsInfo["ChainIDs"], None, None)
    
    OptionsInfo["SpecifiedChainsAndLigandsInfo"] = SpecifiedChainsAndLigandsInfo
    
    MiscUtil.PrintInfo("Specified chain IDs: %s" % (", ".join(SpecifiedChainsAndLigandsInfo["ChainIDs"])))
def ProcessChainAndLigandIDs():
    """Process chain and ligand IDs"""

    MolName = OptionsInfo["InfileRoot"]
    ChainsAndLigandsInfo = PyMOLUtil.GetChainsAndLigandsInfo(
        OptionsInfo["Infile"], MolName)
    OptionsInfo["ChainsAndLigandsInfo"] = ChainsAndLigandsInfo

    MiscUtil.PrintInfo(
        "\nProcessing specified chain and ligand IDs for input file %s..." %
        OptionsInfo["Infile"])

    SpecifiedChainsAndLigandsInfo = PyMOLUtil.ProcessChainsAndLigandsOptionsInfo(
        ChainsAndLigandsInfo, "-c, --chainIDs", OptionsInfo["ChainIDs"],
        "-l, --ligandIDs", OptionsInfo["LigandIDs"])
    OptionsInfo[
        "SpecifiedChainsAndLigandsInfo"] = SpecifiedChainsAndLigandsInfo

    CheckPresenceOfValidLigandIDs(ChainsAndLigandsInfo,
                                  SpecifiedChainsAndLigandsInfo)