コード例 #1
0
            voxel = (refside / movrho.shape)[0]
            halfside = refside / 2
            n = int(refside / voxel)
            dx = refside / n
            x_ = np.linspace(-halfside, halfside, n)
            x, y, z = np.meshgrid(x_, x_, x_, indexing='ij')
            xyz = np.column_stack((x.ravel(), y.ravel(), z.ravel()))
            pdb = saxs.PDB(args.ref)
            if args.center:
                pdb.coords -= pdb.coords.mean(axis=0)
                pdb.write(filename=refoutput)
            #use the new fastgauss function
            #refrho = saxs.pdb2map_gauss(pdb,xyz=xyz,sigma=args.resolution)
            refrho = saxs.pdb2map_fastgauss(pdb,
                                            x=x,
                                            y=y,
                                            z=z,
                                            sigma=args.resolution,
                                            r=args.resolution * 2)
            refrho = refrho * np.sum(movrho) / np.sum(refrho)
            saxs.write_mrc(refrho, side, filename=refbasename + '_pdb.mrc')
        if args.ref.endswith('.mrc'):
            refrho, refside = saxs.read_mrc(args.ref)
        if (not args.ref.endswith('.mrc')) and (not args.ref.endswith('.pdb')):
            print(
                "Invalid reference filename given. .mrc or .pdb file required")
            sys.exit(1)

    aligned = saxs.principal_axis_alignment(refrho, rho)

    saxs.write_mrc(aligned, side, output + '.mrc')
    print("%s.mrc written. " % (output, ))
コード例 #2
0
            halfside = refside / 2
            n = int(refside / voxel)
            dx = refside / n
            x_ = np.linspace(-halfside, halfside, n)
            x, y, z = np.meshgrid(x_, x_, x_, indexing='ij')
            xyz = np.column_stack((x.ravel(), y.ravel(), z.ravel()))
            pdb = saxs.PDB(args.ref)
            if args.center:
                pdb.coords -= pdb.coords.mean(axis=0)
                pdb.write(filename=refoutput)
            #use the new fastgauss function
            #refrho = saxs.pdb2map_gauss(pdb,xyz=xyz,sigma=args.resolution)
            refrho = saxs.pdb2map_fastgauss(pdb,
                                            x=x,
                                            y=y,
                                            z=z,
                                            sigma=args.resolution,
                                            r=args.resolution * 2,
                                            ignore_waters=args.ignore_waters)
            refrho = refrho * np.sum(allrhos[0]) / np.sum(refrho)
            saxs.write_mrc(refrho, sides[0], filename=refbasename + '_pdb.mrc')
        if args.ref.endswith('.mrc'):
            refrho, refside = saxs.read_mrc(args.ref)
        if (not args.ref.endswith('.mrc')) and (not args.ref.endswith('.pdb')):
            print(
                "Invalid reference filename given. .mrc or .pdb file required")
            sys.exit(1)

    if args.enan:
        print(" Selecting best enantiomer(s)...")
        try: