示例#1
0
def phenix_prep(xyzin, phenix_tlsin_list, phenix_tlsout):
    """PHENIX input file. Tells 'phenix.refine' what the TLS groups are.
    """
    ## load structure
    struct = FileIO.LoadStructure(fil=xyzin)

    ## load and construct TLS groups
    tls_group_list = []
    tls_file = TLS.TLSFile()
    tls_file.set_file_format(TLS.TLSFileFormatPHENIX())
    tls_file_format = TLS.TLSFileFormatPHENIX()
    for tlsin in phenix_tlsin_list:
        tls_desc_list = tls_file_format.load(open(tlsin, "r"))
        for tls_desc in tls_desc_list:
            tls_file.tls_desc_list.append(tls_desc)
            tls_group = tls_desc.construct_tls_group_with_atoms(struct)
            tls_group.tls_desc = tls_desc
            tls_group_list.append(tls_group)

    ## now save the PHENIX file in phenix.refine format
    tls_file.save(open(phenix_tlsout, "w"))