imp.find_module('matplotlib') matplotlib_found = True import matplotlib.pyplot as plt from matplotlib.colors import colorConverter as cc import matplotlib.gridspec as gridspec except ImportError: matplotlib_found = False #have to run parser twice, first just to get filename for loadProfile #then have to run it after deciding what the correct dmax should be #so that the voxel size, box size, nsamples, etc are set correctly initparser = argparse.ArgumentParser( description= " A tool for refining an electron density map from solution scattering data", formatter_class=argparse.RawTextHelpFormatter) initargs = dopts.parse_arguments(initparser, gnomdmax=None) q, I, sigq, dmax, isout = saxs.loadProfile(initargs.file, units=initargs.units) if not initargs.force_run: if min(q) != 0.0: print("CAUTION: Minimum q value = %f " % min(q)) print("is not 0.0. It is STRONGLY recommended to include") print("I(q=0) in your given scattering profile. You can use") print("denss.fit_data.py to calculate a scattering profile fit") print("which will include I(q=0), or you can also use the GNOM") print("program from ATSAS to create a .out file.") print() print("If you are positive you would like to continue, ") print("rerun with the --force_run option.") sys.exit()
import saxstats.denssopts as dopts import numpy as np import sys, argparse, os import logging import imp try: imp.find_module('matplotlib') matplotlib_found = True import matplotlib.pyplot as plt from matplotlib.colors import colorConverter as cc import matplotlib.gridspec as gridspec except ImportError: matplotlib_found = False parser = argparse.ArgumentParser(description="DENSS: DENsity from Solution Scattering.\n A tool for calculating an electron density map from solution scattering data", formatter_class=argparse.RawTextHelpFormatter) args = dopts.parse_arguments(parser) if args.rho_start is None: print(" denss.refine.py requires a .mrc file to be given to the --rho_start option.") sys.exit() basename, ext = os.path.splitext(args.rho_start) args.output = basename + '_refine' args.rho_start, rho_side = saxs.read_mrc(args.rho_start) rho_nsamples = args.rho_start.shape[0] rho_voxel = rho_side/rho_nsamples args.side = args.dmax*args.oversampling
matplotlib_found = True import matplotlib.pyplot as plt from matplotlib.colors import colorConverter as cc import matplotlib.gridspec as gridspec except ImportError: matplotlib_found = False ### 引数の設定(python denss.py --option_a value_a --option_b value_bというように引数を渡す設定) #have to run parser twice, first just to get filename for loadProfile #then have to run it after deciding what the correct dmax should be #so that the voxel size, box size, nsamples, etc are set correctly initparser = argparse.ArgumentParser( description= " DENSS: DENsity from Solution Scattering.\n A tool for calculating an electron density map from solution scattering data", formatter_class=argparse.RawTextHelpFormatter) initargs = dopts.parse_arguments(initparser, gnomdmax=None) ### doptsは引数設定関数 q, I, sigq, dmax, isout = saxs.loadProfile(initargs.file, units=initargs.units) if not initargs.force_run: if min(q) != 0.0: print "CAUTION: Minimum q value = %f " % min(q) print "is not 0.0. It is STRONGLY recommended to include" print "I(q=0) in your given scattering profile. You can use" print "denss.fit_data.py to calculate a scattering profile fit" print "which will include I(q=0), or you can also use the GNOM" print "program from ATSAS to create a .out file." print print "If you are positive you would like to continue, " print "rerun with the --force_run option." sys.exit()