Commit 6c3162f7 authored by Fabrice Allain's avatar Fabrice Allain
Browse files

merging not fully functionnal

parent 912fc3b2
......@@ -27,19 +27,4 @@ $Revision: 1.1.1.1 $
$Date: 2010/03/23 15:27:24 $
"""
__all__ = ["Analyser", "ariabase", "AriaPeak", "AriaXML", "Assignment",
"AssignmentFilter", "Atom", "Calibrator", "ccpn2top",
"ccpn_conversion", "Chain", "ChemicalShiftFilter", "Cluster",
"ChemicalShiftList", "cns", "Contribution", "ContributionAssigner",
"conversion", "ConversionTable", "CovalentDistances", "CrossPeak",
"CrossPeakFilter", "DataContainer", "Datum", "Experiment",
"exportToCcpn", "Factory", "FloatFile", "importFromCcpn",
"Infrastructure", "Iteration", "JobManager", "mathutils", "Merger",
"Molecule", "MolMol", "Molprobity", "Network", "NOEModel",
"NOESYSpectrum", "NOESYSpectrumFilter" "OrderedDict", "PDBReader",
"PeakAssigner", "Project", "Protocol", "Relaxation", "Report",
"Residue", "RmsReport", "Settings", "ShiftAssignment",
"ShiftAssignmentFilter", "Singleton", "SpinPair",
"StructureEnsemble", "SuperImposer", "tools", "Topology",
"TypeChecking", "ViolationAnalyser", "WhatifProfile", "xmlparser",
"xmlutils"]
from core import *
\ No newline at end of file
......@@ -4,26 +4,26 @@ Created on 4/7/17
@author: fallain
"""
import re
import os
import logging
import matplotlib.pyplot as plt
import numpy as np
import os
import re
import seaborn as sns
import matplotlib.pyplot as plt
from glob import glob
from collections import OrderedDict
from Bio.PDB import PDBParser, PDBIO
from sklearn.decomposition import PCA
from aria.AriaXML import AriaXMLPickler
from ..core.AriaXML import AriaXMLPickler
from ..core.DataContainer import DATA_SEQUENCE
from ..core.SuperImposer import SuperImposer
from collections import OrderedDict
from glob import glob
from matplotlib.colors import ListedColormap
from matplotlib.lines import Line2D
from mpl_toolkits.mplot3d import Axes3D
from aria.SuperImposer import SuperImposer
from .converter import AriaEcXMLConverter
from .common import NotDisordered, Capturing
from matplotlib.colors import ListedColormap
from aria.DataContainer import DATA_SEQUENCE
from aria.StructureEnsemble import StructureEnsemble, StructureEnsembleSettings
from sklearn.decomposition import PCA
from ..core.StructureEnsemble import StructureEnsemble, StructureEnsembleSettings
from .common import NotDisordered, Capturing
from .converter import AriaEcXMLConverter
LOG = logging.getLogger(__name__)
......
......@@ -177,8 +177,8 @@ class AriaEcCommands(object):
group = parser.add_argument_group('required arguments')
group.add_argument("seq", action=ReadableFile,
help="sequence file [FASTA]")
group.add_argument("sspred", action=ReadableFile,
help="secondary structure prediction file")
# group.add_argument("sspred", action=ReadableFile,
# help="secondary structure prediction file")
group.add_argument("infiles", nargs="+", metavar="infile",
action=ReadableFile,
help="contact or pdb file(s) used to build aria "
......@@ -189,6 +189,12 @@ class AriaEcCommands(object):
"use distances in the given file as "
"target distance to build distance "
"restraints")
group.add_argument("-s", "--ssfile", dest="sspred", action=ReadableFile,
help="secondary structure prediction file")
group.add_argument("-p", "--ariaproject", dest="ariaproject",
action=ReadableFile,
help="ARIA project file. This file will be used as"
"an initialization file if")
group.add_argument("-t", "--type", required=True,
nargs="+", dest="contact_types",
choices=self.contact_types, help="Infile(s) contact "
......@@ -201,6 +207,10 @@ class AriaEcCommands(object):
default=False, help="Use secondary structure index")
group.add_argument("--no-filter", dest="no_filter", action="store_true",
default=False, help="Do not filter contact map.")
group.add_argument("--extract-all", dest="extractall", action="store_true",
default=False, help="Extract data or all data and"
"parameters if an ARIA project"
"is defined with -p option")
return parser
def _bbconv_argparser(self, desc=None):
......@@ -272,12 +282,17 @@ class AriaEcCommands(object):
parser.add_argument("--onlyreport", dest="onlyreport",
action="store_true",
default=False, help="Generate only report file")
parser.add_argument("--no-filter", dest="no_filter", action="store_true",
default=False, help="Do not filter contact map.")
parser.add_argument("--ssidx", dest="ssidx", action="store_true",
default=False,
help="Use secondary structure index")
parser.add_argument("--prefix", dest="prefix", default=False,
action="store_true",
help="Add specific prefix to generated file names")
parser.add_argument("--prefix", dest="prefix", action="store_true",
default="",
help="Generate prefix for file names")
parser.add_argument("--prefixname", dest="prefixname",
default="",
help="Prefix name for file names")
return parser
@staticmethod
......
......@@ -62,7 +62,6 @@ class TqdmToLogger(io.StringIO):
"""
self.logger.log(self.level, self.buf)
# Code below adapated from an answer of klaus se on stackoverflow
# (http://stackoverflow.com/a/16071616)
def worker(f, task_queue, done_queue):
......
......@@ -31,10 +31,11 @@ clashlist_executable:
; Contact definition section used to define maplot from pdb file.
; Decrease this threshold if using other cutoff (e.g. 5.0)
default_cutoff: 8.0
; Add contact cutoff folowwing the syntax atm1_atm2
;ca_ca: 7.0
;cb_cb: 7.0
;sc_sc: 5.0
; Add contact cutoff folowwing the syntax all, atm1_atm2 or sc_sc for side chains
;all:
;ca_ca:
;cb_cb:
;sc_sc:
[setup]
; ------------------------------ TBL parameters ------------------------------ #
......@@ -68,10 +69,6 @@ hb_dplus: 0.5
; neighborhood_contact : True, False [False]
; Generate restraints for neighbors foreach
; contact in the contact map
; pair_list : all, heavy, min [min]
; use all, heavy atms or from a minimized
; list (CA, CB, SC) for contribution list for
; each distance restraint
; atoms_type : all, heavy, min [min]
; use all, heavy atms or from a minimized
; list (CA, CB, SC) for contribution list for
......
......@@ -4,35 +4,38 @@
"""
from __future__ import absolute_import, division, print_function
import logging
import math
import random
import collections
import itertools
import datetime
import os
import sys
import itertools
import json
import re
import textwrap
import pickle
import pandas as pd
import logging
import math
import numpy as np
import os
import pandas as pd
import pickle
import pkg_resources as pkgr
import aria.legacy.AminoAcid as AminoAcid
import random
import re
import sys
import textwrap
from ..core.AriaXML import AriaXMLPickler
from ..core.ConversionTable import ConversionTable
from ..core.DataContainer import DATA_TYPES, DATA_SEQUENCE, DATA_RDCS, \
DATA_ANNEALING_RDC
from ..core.Molecule import Molecule
from ..core.PDBReader import PDBReader
from ..core.conversion import Converter, SequenceList, MoleculeSettings
from ..core.tools import string_to_segid
from future.utils import iteritems
from mako.template import Template
from tqdm import tqdm
from .common import get_filename
from ..core.legacy import AminoAcid as AminoAcid
from .common import get_filename, TqdmToLogger
from .protein import Protein
from .reader import MapFileListReader, TblDistFile
from .protmap import (ResAtmMap, ResMap, SsAaAtmMap)
from mako.template import Template
from aria.Molecule import Molecule
from aria.tools import string_to_segid
from aria.AriaXML import AriaXMLPickler
from aria.PDBReader import PDBReader
from aria.ConversionTable import ConversionTable
from future.utils import iteritems
from aria.conversion import Converter, SequenceList, MoleculeSettings
from .reader import MapFileListReader, TblDistFile
LOG = logging.getLogger(__name__)
......@@ -209,7 +212,7 @@ class AriaXMLConverter(Converter, object):
self._mol_set['output'] = os.path.join(self.settings.infra["xml"],
self.outprefix + ".xml")
self._mol_set['type'] = 'PROTEIN'
self._mol_set['segid'] = ' '
self._mol_set['segid'] = ' A'
self._mol_set['first_residue_number'] = 1
self._mol_set['naming_convention'] = ''
self._mol_set['name'] = self.outprefix
......@@ -344,10 +347,11 @@ reliable="{reliable}" list_name="{list_name}">
for contrib_id in dist_restraints[restraint_id]["contrib"]:
res_id = dist_restraints[restraint_id]["contrib"][contrib_id][
"spin_pair"].keys()
# TODO: Get segids from molecule file instead
segids = dist_restraints[restraint_id]["contrib"][contrib_id][
"meta"].get("segids")
segid1 = segids[res_id[0]] if segids else " "
segid2 = segids[res_id[1]] if segids else " "
segid1 = segids[res_id[0]] if segids else " A"
segid2 = segids[res_id[1]] if segids else " A"
xml_file.write('''\
<contribution id="{id}" weight="{weight:.8f}">
<spin_pair>
......@@ -484,7 +488,8 @@ assign (resid {res1} and name o) (resid {res2} and name hn) 1.8 {dminus} {dplus
outfile.write('''\
assign (resid {res1} and name o) (resid {res2} and name n) 2.8 {dminus} {dplus}
assign (resid {res1} and name o) (resid {res2} and name hn) 1.8 {dminus} {dplus}
'''.format(res1=res1, res2=res2, dminus=dminus, dplus=dplus)) # , dist=dist))
'''.format(res1=res1, res2=res2, dminus=dminus,
dplus=dplus)) # , dist=dist))
LOG.info("Writing %d hbonds from hbmap in %s", len(donors),
outfile.name)
......@@ -517,9 +522,10 @@ assign (resid {res1} and name o) (resid {res2} and name hn) 1.8 {dminus} {dplus
"""
with open(outfile, 'w') as outfile:
# Write short range hbond tbl restraints
self._write_helix_hb_tbl(protein.sec_struct.ss_matrix, outfile,
dminus,
dplus)
if protein.sec_struct:
self._write_helix_hb_tbl(protein.sec_struct.ss_matrix, outfile,
dminus,
dplus)
if hbmap:
# TODO: add another flag in order to generate hbmap xml
# ambig. Tbl pseudoatoms is probably not the best way to use
......@@ -865,7 +871,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
"""
return AminoAcid.AminoAcid(res)[0]
atms1, atms2 = self.atm_list(idx1, res1, idx2, res2, list_type=list_type)
atms1, atms2 = self.atm_list(idx1, res1, idx2, res2,
list_type=list_type)
if adr_flag and product_type == "same":
# We return here only minimized list with equal atoms
......@@ -878,7 +885,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
atm1 not in ('CA', 'CB')
and atm2 not in ('CA', 'CB')
) or (atm1, atm2) == self.settings.scsc_min[
resname(res1)][resname(res2)]], ] if list_type == 'min'\
resname(res1)][resname(res2)]], ] if list_type == 'min' \
else [[(atm1, atm2) for (atm1, atm2) in
list(itertools.product(atms1, atms2))
if atm1 == atm2], ]
......@@ -907,7 +914,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
atm1 not in ('CA', 'CB')
and atm2 not in (
'CA', 'CB')) or (atm1, atm2) == self.settings.scsc_min[
resname(res1)][resname(res2)]] if list_type == 'min' else [
resname(res1)][
resname(res2)]] if list_type == 'min' else [
(atm1, atm2) for (atm1, atm2) in
list(itertools.product(atms1, atms2))
if atm1 == atm2]
......@@ -923,6 +931,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
# TODO: use precision level, actually we only use SsAaAtmMaps
precision_level = self.settings.setup.config.get(
"pdbdistance_level", "ss")
atom_types = self.settings.setup.config.get("atoms_type", "min")
# TODO: Do the same for heavy matrices, it is actually hard coded to min
# matrices sinces we only have this kind of information in data/pdbdists
......@@ -939,7 +948,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
for pdbstasts_group in pdbstasts_groups:
path = self.settings.main.config.get(pdbstasts_group[1])
pkgpath = getattr(self.settings, pdbstasts_group[0])
targetmap = SsAaAtmMap(scsc_min=True)
# TODO: ONLY MIN PAIR ATOMS FOR TARGET PDB DIST
targetmap = SsAaAtmMap(atom_types=atom_types)
if path and not os.path.exists(path) or not path:
with pkgr.resource_stream(__name__, pkgpath) as pkgfile:
......@@ -953,6 +963,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
pdbdistmap = pickle.load(pkgfile)
pdbdistmap = pd.DataFrame.from_dict(pdbdistmap)
# We do not want 0. values here ...
pdbdistmap.replace(0., np.NaN, inplace=True)
pdbdistmap.columns.set_names(
['SecStruct', 'AminoAcid', 'Atom'], inplace=True)
pdbdistmap.index.set_names(
......@@ -1072,9 +1084,11 @@ class AriaEcXMLConverter(AriaXMLConverter):
elif distype == "fixed":
# Fixed distances with bound in aria_ec.ini
# retourne ResAtmMap (20 aa)
targetmap = ResAtmMap(sequence)
targetmap[:] = self.settings.setup.config["restraint_distance"]
targetmaps['INTERTARGET'] = targetmap
# targetmap = ResAtmMap(sequence)
# targetmap[:] = self.settings.setup.config["restraint_distance"]
# targetmaps['INTERTARGET'] = targetmap
targetmaps['INTERTARGET'] = self.settings.setup.config[
"restraint_distance"]
elif distype == "pdbstat":
# TODO: pdbstats a partir d'une matrice pickle (faire une
# fonction qui genere la matrice en dehors et la sauvegarde
......@@ -1098,6 +1112,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
def get_dist(self, distmap, contribs, defaultdist, protein,
groupby=None):
"""
Get target distance from distance map
Parameters
----------
......@@ -1111,6 +1126,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
-------
"""
def resname(res):
"""
......@@ -1127,19 +1143,46 @@ class AriaEcXMLConverter(AriaXMLConverter):
"""
return AminoAcid.AminoAcid(res)[1]
distype = self.settings.setup.config.get("distance_type", "fixed")
groupby = groupby if groupby else self.settings.setup.config[
"groupby_method"]
# TODO: Avoid reduce call if possible (slow)
if distype != "fixed":
distmap = distmap if protein.sec_struct else distmap.reduce(
groupby=groupby)
# Definir le type de la carte Puis
# Calculer l'index relatif a la paire ou la liste de paires d'atomes
dist_list = []
if type(distmap) == ResAtmMap and \
distmap.sequence == protein.aa_sequence.sequence:
distmap.sequence == protein.aa_sequence.sequence:
for contrib in contribs:
mapidx_x = distmap.index.levels[0][contrib[0][0]]
mapidx_y = distmap.index.levels[0][contrib[1][0]]
dist_list.append(distmap.loc[
mapidx_x, contrib[0][1]][mapidx_y, contrib[1][1]])
mapidx_x, contrib[0][1]][
mapidx_y, contrib[1][1]])
elif type(distmap) == SsAaAtmMap and not protein.sec_struct:
# TODO: Actually only inter distances used
# TODO: Works only with minimal target map (with CA, CB, SC indexes)
for contrib in contribs:
residx1 = contrib[0][0]
res1 = resname(protein.aa_sequence.sequence[residx1])
atm1 = contrib[0][1]
atm1 = atm1 if atm1 in ('CA', 'CB') else 'SC'
residx2 = contrib[1][0]
res2 = resname(protein.aa_sequence.sequence[residx2])
atm2 = contrib[1][1]
atm2 = atm2 if atm2 in ('CA', 'CB') else 'SC'
idx1 = res1, atm1
idx2 = res2, atm2
dist = distmap.sort_index().loc[idx1][idx2]
dist = dist if pd.notnull(dist) and dist != 0. else \
distmap.sort_index().loc[idx2][idx1]
if pd.notnull(dist) and dist != 0.:
dist_list.append(dist)
else:
dist_list.append(defaultdist)
elif type(distmap) == SsAaAtmMap:
# TODO: Actually only inter distances used
# TODO: Works only with minimal target map (with CA, CB, SC indexes)
......@@ -1159,16 +1202,19 @@ class AriaEcXMLConverter(AriaXMLConverter):
idx1 = ss1, res1, atm1
idx2 = ss2, res2, atm2
dist = distmap.sort_index().loc[idx1][idx2]
dist = dist if pd.notnull(dist) and dist != 0. else distmap.sort_index().loc[idx2][idx1]
dist = dist if pd.notnull(dist) and dist != 0. else \
distmap.sort_index().loc[idx2][idx1]
if pd.notnull(dist) and dist != 0.:
dist_list.append(dist)
else:
dist_list.append(defaultdist)
elif type(distmap) == ResMap and \
distmap.sequence == protein.aa_sequence.sequence:
distmap.sequence == protein.aa_sequence.sequence:
for contrib in contribs:
dist_list.append("%.2f" % distmap.iat[
contrib[0][0], contrib[1][0]])
elif type(distmap) == float:
return distmap
else:
return defaultdist
......@@ -1227,8 +1273,9 @@ class AriaEcXMLConverter(AriaXMLConverter):
# contacts) => utiliser tout les contact de ce set ou def des
# poids pour selectionner l * f contacts de ce set
if nb_c < len(contactmap.contactset()):
LOG.info("Initialize sampling for contact selection with seed %s",
self.settings.setup.config['seed'])
LOG.info(
"Initialize sampling for contact selection with seed %s",
self.settings.setup.config['seed'])
random.seed(self.settings.setup.config['seed'])
contacts = random.sample(contactmap.contactset(), nb_c)
else:
......@@ -1241,7 +1288,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
' '.join(["(%2d, %2d)" % pair for pair in hum_list]), width=80)))
weight_list = list(float(10.0 / (x + 1)) for x, v in enumerate(
contacts)) if \
contacts)) if \
self.settings.setup.config['evfold_weight'] and \
scoremap is not None else list(1.0 for _ in contacts)
......@@ -1250,6 +1297,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
contribs_type = self.settings.setup.config["contributions_type"]
atms_type = self.settings.setup.config["atoms_type"]
default_target_dist = self.settings.setup.config["restraint_distance"]
# TODO: Lower bound and upper bound matrix not used actually...
targetdistmap = targetdists.get('INTERTARGET')
nat_reliable = self.settings.setup.config["native_reliable"]
......@@ -1273,8 +1321,9 @@ class AriaEcXMLConverter(AriaXMLConverter):
restraint_dict = collections.OrderedDict()
rest_id = 0
contrib_id = 0
for contactidx, subcontacts in enumerate(tqdm(contacts)):
tqdm_out = TqdmToLogger(LOG, level=logging.INFO)
for contactidx, subcontacts in enumerate(
tqdm(contacts, file=tqdm_out, mininterval=1.)):
LOG.debug("Writing restraint related to contact %s" %
str((subcontacts[0] + 1, subcontacts[1] + 1)))
......@@ -1284,7 +1333,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
# Define Residue lists for the contact. Those lists contains
# normally only one element by default except if we introduce
# neighbors with neigh_flag triggered
subcontacts = self.neighcontact(subcontacts, max_seqidx - 1) if neigh_flag \
subcontacts = self.neighcontact(subcontacts,
max_seqidx - 1) if neigh_flag \
else [subcontacts]
# Define list of atom pairs
......@@ -1298,7 +1348,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
# We have a unique atmpair list, trick to have a unique loop for
# all kind of restraints in the following
contribs_lists = [contribs_lists, ] if not adr_flag else contribs_lists
contribs_lists = [
contribs_lists, ] if not adr_flag else contribs_lists
# If ADR, build a restraint with contributions containing
# all atom pair in atmpairs => Get 1 target distance related to
......@@ -1321,17 +1372,20 @@ class AriaEcXMLConverter(AriaXMLConverter):
# Increment contribution id if adr else reset to 1
contrib_id = contrib_id + 1 if contrib_idx != 0 and adr_flag else 1
lower_bound = self.settings.setup.config["lower_bound"]
targetdist = self.get_dist(targetdistmap, contribs_list,
default_target_dist, protein) if\
adr_flag else self.get_dist(targetdistmap, [contrib],
default_target_dist,
protein)
upper_bound = self.settings.setup.config["ca_upper_bound"] if \
lower_bound = float(
self.settings.setup.config["lower_bound"])
targetdist = float(
self.get_dist(targetdistmap, contribs_list,
default_target_dist, protein)) if \
adr_flag else float(
self.get_dist(targetdistmap, [contrib],
default_target_dist, protein))
upper_bound = float(
self.settings.setup.config["ca_upper_bound"]) if \
(atm1, atm2) == ("CA", "CA") and not adr_flag else \
self.settings.setup.config["cb_upper_bound"] if \
(atm1, atm2) == ("CB", "CB") and not adr_flag else \
self.settings.setup.config["def_upper_bound"]
float(self.settings.setup.config["cb_upper_bound"]) if \
(atm1, atm2) == ("CB", "CB") and not adr_flag else \
float(self.settings.setup.config["def_upper_bound"])
# TODO: Better way to define upper_bound if target > upper ???
upper_bound = upper_bound if targetdist <= upper_bound else \
......@@ -1421,20 +1475,27 @@ class AriaEcXMLConverter(AriaXMLConverter):
"_hbond.tbl")
ssdist_file = os.path.join(self.settings.infra["tbl"], self.outprefix +
"_ssdist.tbl")
LOG.info(" Dihedral restraints (%s)", dihed_file)
self.write_dihedral_tbl(protein.sec_struct.ss_matrix, dihed_file)
LOG.info(" Helix bond restraints (%s)", hb_file)
self.write_hb_tbl(protein, hb_file,
hbmap=hbmap, n_hb=n_hb,
lr_type=self.settings.setup.config[
'longrange_hbtype'],
dminus=self.settings.setup.config['hb_dminus'],
dplus=self.settings.setup.config['hb_dplus'])
LOG.info(" Secondary structure restraints (%s)",
ssdist_file)
self.write_ssdist_tbl(protein.sec_struct.ss_matrix,
protein.sec_struct.ssdist,
ssdist_file)
if protein.sec_struct:
LOG.info(" Dihedral restraints for secondary structures (%s)",
dihed_file)
self.write_dihedral_tbl(protein.sec_struct.ss_matrix, dihed_file)
LOG.info(" Secondary structure restraints (%s)",
ssdist_file)
self.write_ssdist_tbl(protein.sec_struct.ss_matrix,
protein.sec_struct.ssdist,
ssdist_file)
LOG.info(" Helix bond restraints (%s)", hb_file)
self.write_hb_tbl(protein, hb_file,
hbmap=hbmap, n_hb=n_hb,
lr_type=self.settings.setup.config[
'longrange_hbtype'],
dminus=self.settings.setup.config['hb_dminus'],
dplus=self.settings.setup.config['hb_dplus'])
else:
dihed_file = None
ssdist_file = None
if not hbmap:
hb_file = None
return {'hbond': hb_file, 'dihed': dihed_file, 'ssdist': ssdist_file}
def write_ariaproject(self, aria_template, seqfile, dist_files, tbl_files,
......@@ -1459,6 +1520,7 @@ class AriaEcXMLConverter(AriaXMLConverter):
-------
None
"""
# TODO: Use aria API to build project in the future
LOG.info("Loading aria template file %s", aria_template)
molecule = self.molecule.getName()
......@@ -1479,12 +1541,12 @@ class AriaEcXMLConverter(AriaXMLConverter):
aria_project_dict = {}
# Check if ratio cool1 / cool2 is 5:4 ... (relevant ?)
steps_1 = float(self.settings.setup.config['md_parameters_steps_cool1'])
steps_2 = float(self.settings.setup.config['md_parameters_steps_cool2'])
if steps_1 / steps_2 != float(5) / int(4):
sys.exit(
'Length of first and second cooling stages must be fixed in '
'the ratio %.2f:%.2f' % (steps_1, steps_2))
# steps_1 = float(self.settings.setup.config['md_parameters_steps_cool1'])
# steps_2 = float(self.settings.setup.config['md_parameters_steps_cool2'])
# if steps_1 / steps_2 != float(5) / int(4):
# sys.exit(
# 'Length of first and second cooling stages must be fixed in '
# 'the ratio %.2f:%.2f' % (steps_1, steps_2))
aria_project_dict.update(self.settings.setup.config)
......@@ -1521,18 +1583,19 @@ class AriaEcXMLConverter(AriaXMLConverter):
am_dict = dict()
# SS dist tbl restraint
un_dict['ss'] = {
'file': tbl_files["ssdist"],
'format': self.settings.setup.config['ss_dist_format'],
'ccpn_id': '',
'enabled': self.settings.setup.config['ss_dist_enabled'],
'add_to_network': self.settings.setup.config[
'ss_dist_add_to_network'],
'calibrate': self.settings.setup.config['ss_dist_calibrate'],
'run_network_anchoring': self.settings.setup.config[
'ss_dist_run_network_anchoring'],
'filter_contributions': self.settings.setup.config[
'ss_dist_filter_contributions']}
if tbl_files["ssdist"]:
un_dict['ss'] = {
'file': tbl_files["ssdist"],
'format': self.settings.setup.config['ss_dist_format'],
'ccpn_id': '',
'enabled': self.settings.setup.config['ss_dist_enabled'],
'add_to_network': self.settings.setup.config[
'ss_dist_add_to_network'],
'calibrate': self.settings.setup.config['ss_dist_calibrate'],
'run_network_anchoring': self.settings.setup.config[
'ss_dist_run_network_anchoring'],
'filter_contributions': self.settings.setup.config[
'ss_dist_filter_contributions']}
if self.settings.setup.config["ambiguous_distance_restraint"]:
# Ajout dist_files a am_dict
......@@ -1549,7 +1612,8 @@ class AriaEcXMLConverter(AriaXMLConverter):
'dist_run_network_anchoring'],
'filter_contributions': self.settings.setup.config[
'dist_filter_contributions'],
'avg_exponent': self.settings.setup.config['dist_avg_exponent']
'avg_exponent': self.settings.setup.config[
'dist_