Skip to content

Commit

Permalink
Merge pull request #93 from hlasimpk/master
Browse files Browse the repository at this point in the history
A few small updates
  • Loading branch information
hlasimpk committed Nov 19, 2018
2 parents 0293d9f + da97d1b commit 7df89c2
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions simbad/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@
"simbad", "static")
LATTICE_DB = os.path.join(SIMBAD_SHARE_STATIC_DIR, "niggli_database.npz")
CONTAMINANT_MODELS = os.path.join(SIMBAD_SHARE_STATIC_DIR, 'contaminants')
MORDA_MODELS = os.path.join(SIMBAD_SHARE_STATIC_DIR, 'morda')
2 changes: 1 addition & 1 deletion simbad/command_line/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ def _argparse_contaminant_options(p):
def _argparse_morda_options(p):
"""Morda search specific options"""
sg = p.add_argument_group('Morda search specific options')
sg.add_argument('-morda_db', type=lambda x: is_valid_dir(sg, x),
sg.add_argument('-morda_db', type=lambda x: is_valid_dir(sg, x), default=simbad.MORDA_MODELS,
help='Path to local copy of the MoRDa database')
sg.add_argument('-max_morda_results', type=int, default=200,
help="The maximum number of contaminant results to return")
Expand Down
3 changes: 2 additions & 1 deletion simbad/command_line/simbad_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,8 @@ def create_db_argparse():
type=str,
default='info',
help='The console verbosity level < notset | info | debug | warning | error | critical > ')
pc.add_argument('simbad_db', type=str, help='Path to local copy of the SIMBAD database')
pc.add_argument('simbad_db', type=str, default=simbad.MORDA_MODELS,
help='Path to local copy of the SIMBAD database')

pd = sp.add_parser('ensemble', help='ensemble database')
pd.set_defaults(which="ensemble")
Expand Down
5 changes: 3 additions & 2 deletions simbad/mr/anomalous_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,5 +141,6 @@ def anode(self, input_model):

def cleanup(self):
for i in ["{0}_fa.hkl", "{0}_fa.ins", "{0}_fa.res", "{0}.hkl", "{0}.pha", "{0}.sca"]:
os.remove(os.path.join(self.work_dir, i.format(self.name)))

f = os.path.join(self.work_dir, i.format(self.name))
if os.path.isfile(f):
os.remove(f)
8 changes: 6 additions & 2 deletions simbad/util/mtz_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,12 +208,16 @@ def run(self, mtz_file):
else:
msg = "Unexpected number of columns found in anomalous miller array"
logging.critical(msg)
elif m_a.is_xray_intensity_array():
elif m_a.is_xray_intensity_array() and len(m_a.info().labels) == 2:
if not self.i:
self.i, self.sigi = m_a.info().labels
elif m_a.is_xray_amplitude_array():
elif m_a.is_xray_amplitude_array() and len(m_a.info().labels) == 2:
if not self.f:
self.f, self.sigf = m_a.info().labels
# Catch for uncommon miller array that combines structure factors and DANO
elif len(m_a.info().labels) == 5:
if any(['DANO' in i.upper() for i in miller_arrays[1].info().labels]):
self.f, self.sigf, self.dano, self.sigdano, isym = m_a.info().labels
else:
pass

Expand Down
8 changes: 4 additions & 4 deletions simbad/util/reference_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def setup_references(self):
ref_fname = os.path.join(os.environ['CCP4'], "share", "simbad", "static", "simbad.bib")
if not os.path.isfile(ref_fname):
msg = "Cannot find BibTex file containing references. " \
"Please determine them yourself and cite AMPLE."
"Please determine them yourself and cite SIMBAD."
return msg
article = {}
entry = False
Expand Down Expand Up @@ -99,15 +99,15 @@ def methods_as_html(self):
"Numbers in superscript next to program/reference names refer to the number of the program reference in the overall list of references.</p>"
for section in self.SECTIONS:
if section == self.SECTIONS.GENERAL:
html += '<p>The first 2 references should be cited in all cases.</p>'
html += '<p>SIMBAD<sup>1</sup>, CCP4<sup>2</sup> and CCTBX<sup>3</sup> references should be cited in all cases.</p>'
elif section == self.SECTIONS.ROTATION and len(self.section_labels[self.SECTIONS.ROTATION]):
standfirst = '<p>The rotation searches were carried out with the following programs:</p>'
html += self._methods_section_html(self.SECTIONS.ROTATION, standfirst)
elif section == self.SECTIONS.MR and len(self.section_labels[self.SECTIONS.MR]):
standfirst = '<p>Molecular Replacement was carried out with the following programs:</p>'
html += self._methods_section_html(self.SECTIONS.MR, standfirst)
elif section == self.SECTIONS.REFINEMENT and len(self.section_labels[self.SECTIONS.REFINEMENT]):
standfirst = '<p>Refinement of the MR solutions carried out with the following programs:</p>'
standfirst = '<p>Refinement of the MR solutions was carried out with the following programs:</p>'
html += self._methods_section_html(self.SECTIONS.REFINEMENT, standfirst)
return html

Expand Down Expand Up @@ -136,7 +136,7 @@ def citations_as_html(self):

@property
def citations_as_text(self):
txt = """A number of programs and algorithms were used within the this run of AMPLE.
txt = """A number of programs and algorithms were used within the this run of SIMBAD.
The following is a list of citations for this run:
{0}
""".format(self.citation_list_as_text)
Expand Down

0 comments on commit 7df89c2

Please sign in to comment.