当前位置: 首页>>代码示例>>Python>>正文


Python IMP.OptionParser类代码示例

本文整理汇总了Python中IMP.OptionParser的典型用法代码示例。如果您正苦于以下问题:Python OptionParser类的具体用法?Python OptionParser怎么用?Python OptionParser使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了OptionParser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: parse_args

def parse_args():
    usage = """%prog [options] <assembly name> <assembly input> <number of fits> <indexes filename>

Generate indexes of fitting solutions.
"""
    parser = OptionParser(usage)
    options, args = parser.parse_args()
    if len(args) != 4:
        parser.error("incorrect number of arguments")
    return options,args
开发者ID:apolitis,项目名称:imp,代码行数:10,代码来源:indexes.py

示例2: parse_args

def parse_args():
    usage =  """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
           <alignment.params>

Show the DOMINO merge tree to be used in the alignment procedure
"""
    parser = OptionParser(usage)

    options, args = parser.parse_args()
    if len(args) !=4:
        parser.error("incorrect number of arguments")
    return options,args
开发者ID:apolitis,项目名称:imp,代码行数:12,代码来源:merge_tree.py

示例3: parse_args

def parse_args():
    usage = """%prog [options] <asmb.input> <anchors.txt>
                                             <output:proteomics>

Generate a proteomics file automatically from the anchor graph and fitting
results. No interaction data is entered here, but the file can be modified
manually afterwards to add additional proteomics information.
"""
    parser = OptionParser(usage)
    options, args = parser.parse_args()
    if len(args) != 3:
        parser.error("incorrect number of arguments")
    return args
开发者ID:newtonjoo,项目名称:imp,代码行数:13,代码来源:proteomics.py

示例4: main

def main():
    IMP.base.set_log_level(IMP.base.SILENT)
    usage = "usage: %prog [options] <complex.pdb> <output: anchor_graph.cmm>\n Description: The script gets as input a PDB file of a complex and calculates an anchor graph,\n such that nodes corresponds to the centroids of its chains and \n edges are between chains that are close in space."
    parser = OptionParser(usage)
    (options, args) = parser.parse_args()
    if len(args) != 2:
        parser.error("incorrect number of arguments")
    pdb_fn = args[0]
    cmm_fn = args[1]
    # read the protein
    mdl = IMP.kernel.Model()
    mh = IMP.atom.read_pdb(pdb_fn, mdl, IMP.atom.CAlphaPDBSelector())
    IMP.atom.add_radii(mh)
    # find the centers of the individual chains
    chains = IMP.atom.get_by_type(mh, IMP.atom.CHAIN_TYPE)
    centers = []
    rbs = []
    for chain in chains:
        ps = IMP.core.XYZs(IMP.core.get_leaves(chain))
        centers.append(IMP.core.get_centroid(ps))
        IMP.atom.setup_as_rigid_body(chain)
    # fast calculations of which chains are close
    links = []
    sdps = IMP.core.SphereDistancePairScore(IMP.core.Linear(0, 1))
    rdps = IMP.core.RigidBodyDistancePairScore(sdps, IMP.core.LeavesRefiner(IMP.atom.Hierarchy.get_traits()))
    for id1, chain1 in enumerate(chains):
        for id2, chain2 in enumerate(chains[id1 + 1 :]):
            # check if the bounding boxes are intersecting
            if rdps.evaluate((chain1.get_particle(), chain2), None) < 0.5:
                links.append([id1, id1 + id2 + 1])
    # write the cmm file
    output = open(cmm_fn, "w")
    output.write('<marker_set name="centers_cryst">\n')
    for id, c in enumerate(centers):
        output.write(
            '<marker id="'
            + str(id)
            + '" x="'
            + str(c[0])
            + '" y="'
            + str(c[1])
            + '" z="'
            + str(c[2])
            + '" radius= "3.0" r= "0.9"  g= "0.05" b= "0.18" />'
        )
    for id1, id2 in links:
        output.write('<link id1="' + str(id1) + '" id2="' + str(id2) + '" radius="1."/>\n')
    output.write("</marker_set>\n")
开发者ID:jennystone,项目名称:imp,代码行数:48,代码来源:complex_to_anchor_graph.py

示例5: parse_args

def parse_args():
    usage = """%prog [options] <subunit> <symmetry degree>
          <transformations file> <number of models> <output models>

This script, given the structure of a single subunit and the Chimera
transformations file, applies the transformations to generate a number of
complete models.

  <subunit>               subunit PDB, the same given to MultiFit.
  <symmetry degree>       Cn degree.
  <transformations file>  MultiFit output in chimera output format.
  <number of models>      number of models to print.
  <output models>         Solutions are written as output.i.pdb."""
    parser = OptionParser(usage)
    opts, args = parser.parse_args()
    if len(args) != 5:
        parser.error("incorrect number of arguments")
    return args
开发者ID:apolitis,项目名称:imp,代码行数:18,代码来源:chimera_models.py

示例6: parse_args

def parse_args():
    usage = """%prog [options] <parameter file> <transformations file>
        <reference PDB>

This program calculates the RMSD between modeled cyclic symmetric complexes and
the reference structure. The RMSD and cross correlation of each complex is
written into a file called rmsd.output.

Notice: no structural alignment is performed!"""

    parser = OptionParser(usage)
    parser.add_option("--vec", dest="vec", default="", metavar="FILE",
                      help="output the RMSDs as a vector into the named "
                           "file, if specified")
    parser.add_option("--start", dest="start", default=0, type="int",
                      help="first model in transformations file to compare "
                           "with the reference (by default, model 0)")
    parser.add_option("--end", dest="end", default=-1, type="int",
                      help="last model in transformations file to compare "
                           "with the reference (by default, the final model)")
    (options, args) = parser.parse_args()
    if len(args) != 3:
        parser.error("incorrect number of arguments")
    return options, args
开发者ID:newtonjoo,项目名称:imp,代码行数:24,代码来源:rmsd.py

示例7: parse_args

def parse_args():
    usage =  "usage %prog [options] <asmb.input> <proteomics.input> <mapping.input> <alignment params> <combinatins> <diameter> <output combinations>\n"
    usage+="A script for clustering an ensemble of solutions"
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", type="int", dest="max", default=999999999,
                      help="maximum number of combinations to consider")
    (options, args) = parser.parse_args()
    if len(args) != 7:
        parser.error("incorrect number of arguments")
    return [options,args]
开发者ID:apolitis,项目名称:imp,代码行数:10,代码来源:cluster_coarse.py

示例8: parse_args

def parse_args():
    usage = """%prog [options] <pdb file name>

This program generates the Connolly surface for a given PDB file."""

    parser = OptionParser(usage)
    parser.add_option("--density", dest="density", default=10.0, type="float",
                      metavar="D",
                      help="density of probe points, per cubic angstrom "
                           "(default 10.0)")
    parser.add_option("--radius", dest="rp", default=1.8, type="float",
                      metavar="R",
                      help="probe radius in angstroms (default 1.8)")

    opts, args = parser.parse_args()
    if len(args) != 1:
        parser.error("incorrect number of arguments")
    return args[0], opts.density, opts.rp
开发者ID:newtonjoo,项目名称:imp,代码行数:18,代码来源:surface.py

示例9: usage

def usage():
    usage =  """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
           <alignment.params> <combinations> <output: clustered combinations>

Clustering of assembly solutions.

This program uses the Python 'fastcluster' module, which can be obtained from
http://math.stanford.edu/~muellner/fastcluster.html
"""
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", type="int", dest="max", default=999999999,
                      help="maximum solutions to consider")
    parser.add_option("-r", "--rmsd", type="float", dest="rmsd", default=5,
                      help="maximum rmsd within a cluster")
    options, args = parser.parse_args()
    if len(args) != 6:
        parser.error("incorrect number of arguments")
    return options, args
开发者ID:AljGaber,项目名称:imp,代码行数:18,代码来源:cluster.py

示例10: parse_args

def parse_args():
    usage = """%prog [options] <assembly input> <output anchors prefix>

Generate anchors for a density map."""
    parser = OptionParser(usage)
    parser.add_option("-s", "--size", type="int", dest="size", default=-1,
                      help="number of residues per bead")
    options, args = parser.parse_args()

    if len(args) != 2:
        parser.error("incorrect number of arguments")
    return options, args
开发者ID:AljGaber,项目名称:imp,代码行数:12,代码来源:anchors.py

示例11: parse_args

def parse_args():
    usage = """%prog [options] <parameter file>

This program builds cyclic symmetric complexes in their density maps."""

    parser = OptionParser(usage)
    parser.add_option("--chimera", dest="chimera", default="", metavar="FILE",
                      help="the name of the Chimera output file, if desired")
    (options, args) = parser.parse_args()
    if len(args) != 1:
        parser.error("incorrect number of arguments")
    return args[0], options.chimera
开发者ID:newtonjoo,项目名称:imp,代码行数:12,代码来源:build.py

示例12: parse_args

def parse_args():
    usage = """%prog [options] <asmb.input> <proteomics.input>
           <mapping.input> <combinations> <model prefix>

Write output models.
"""
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", type="int", dest="max", default=None,
                      help="maximum number of models to write")
    (options, args) = parser.parse_args()
    if len(args) != 5:
        parser.error("incorrect number of arguments")
    return options,args
开发者ID:apolitis,项目名称:imp,代码行数:13,代码来源:models.py

示例13: usage

def usage():
    usage = """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
           <alignment.params> <combinatins> <score combinations [output]>

Score each of a set of combinations.
"""
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", dest="max",default=999999999,
                      help="maximum number of fits considered")
    (options, args) = parser.parse_args()
    if len(args) != 6:
        parser.error("incorrect number of arguments")
    return [options,args]
开发者ID:apolitis,项目名称:imp,代码行数:13,代码来源:score.py

示例14: parse_args

def parse_args():
    usage = """%prog [options] <asmb.input> <proteomics.input>
           <mapping.input> <combinations>

Compare output models to a reference structure.
The reference structure for each subunit is read from the rightmost column
of the asmb.input file.
"""
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", type="int", dest="max", default=None, help="maximum number of models to compare")
    (options, args) = parser.parse_args()
    if len(args) != 4:
        parser.error("incorrect number of arguments")
    return options, args
开发者ID:AljGaber,项目名称:imp,代码行数:14,代码来源:reference.py

示例15: parse_args

def parse_args():
    usage =  """%prog [options] <asmb> <asmb.proteomics> <asmb.mapping>
           <alignment.params> <combinations[output]>
           <Fitting scores[output]>

Align proteomics graph with the EM map.
"""
    parser = OptionParser(usage)
    parser.add_option("-m", "--max", type="int", dest="max", default=999999999,
                      help="maximum number of fits considered")

    options, args = parser.parse_args()
    if len(args) != 6:
        parser.error("incorrect number of arguments")
    return options, args
开发者ID:newtonjoo,项目名称:imp,代码行数:15,代码来源:align.py


注:本文中的IMP.OptionParser类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。