#!/usr/bin/python
import os,sys
from process import process
import common


class matthews(process):
  name="estimation of Matthews coefficient, solvent content and number of monomers"
  short_name="Matthews estimation"
  supported_progs=["gcx"]

  def RunPostprocess(self,restore=True,*args,**kwargs):
    # let's copy the determined values to input sequence object (which must exist for matthews est.)
    self.inp.Get('sequence').solvent_content=self.GetProg().GetStat('solvent_content')
    self.inp.Get('sequence').monomers_asym=self.GetProg().GetStat('monomers_asym')
    self.inp.Get('sequence').residues_mon=self.GetProg().GetStat('residues_mon')
    process.RunPostprocess(self,restore,*args,**kwargs)

  def TreatInOutPar(self, set_all_par=False):
    if not self.GetProg(supported=True):
      self.AddProg('gcx')
    process.TreatInOutPar(self,set_all_par)
