Package schrodinger :: Package application :: Package matsci :: Module amorphous :: Class Moieties
[hide private]
[frames] | no frames]

Class Moieties

object --+
         |
        Moieties

A holder and manager for the various moieties that make up the polymer

Instance Methods [hide private]
 
__init__(self, filename, logger, structs=[])
Create a Moieties object
bool
hasCascader(self)
Has a cascader been defined?
bool
hasBrancher(self)
Has a brancher been defined?
bool
hasRings(self)
Do any moieties have rings?
Monomer
getMonomer(self, letter)
Get the monomer with the given one-letter code
Monomer, Initiator, Cascader, or Terminator
getMoiety(self, letter)
Get the get one single moiety based on 'INI', 'TRM', 'CAS' or monomer one-letter code.
list
getOneLetterCodes(self)
Get all the allowed one-letter codes
bool
checkValidOneLetterCodes(self, codes)
Check that all the codes in the given string are valid
bool
checkValidWeights(self, weights)
Validate the given weights
int
getCascadeGenerations(self)
Get the number of cascade generations
list
getAllMoietyNames(self)
Get the names of all Moieties - initiator, terminator, monomers, etc.

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filename, logger, structs=[])
(Constructor)

 

Create a Moieties object

Parameters:
  • filename (str) - The path to the file that holds the moiety structures
  • logger (logging.Logger) - The logger for this builder
Overrides: object.__init__

hasCascader(self)

 

Has a cascader been defined?

Returns: bool
Whether a cascader was defined

hasBrancher(self)

 

Has a brancher been defined?

Returns: bool
Whether a brancher was defined

hasRings(self)

 

Do any moieties have rings?

Returns: bool
Whether any of the moieties have rings

getMonomer(self, letter)

 

Get the monomer with the given one-letter code

Parameters:
  • letter (str) - The one-letter code for the desired monomer
Returns: Monomer
The monomer with the given one-letter code

getMoiety(self, letter)

 

Get the get one single moiety based on 'INI', 'TRM', 'CAS' or monomer one-letter code.

Parameters:
  • letter (str) - The one-letter code for the desired monomer
Returns: Monomer, Initiator, Cascader, or Terminator
the initiator, cascader, terminat or one nonomer find by the one letter code

getOneLetterCodes(self)

 

Get all the allowed one-letter codes

Returns: list
All the defined one-letter codes

checkValidOneLetterCodes(self, codes)

 

Check that all the codes in the given string are valid

Parameters:
  • codes (str) - A string with a series of one-letter codes
Returns: bool
Whether all the one-letter codes are associated with a Monomer

checkValidWeights(self, weights)

 

Validate the given weights

Parameters:
  • weights (dict) - Keys are one-letter codes, values are integer weights for that monomer in a random copolymer
Returns: bool
Whether all the one-letter codes in weights are valid

getCascadeGenerations(self)

 

Get the number of cascade generations

Returns: int
The number of cascade generations (0 if none)

getAllMoietyNames(self)

 

Get the names of all Moieties - initiator, terminator, monomers, etc.

Returns: list
A list of all moiety names. Monomers first, then initiator, terminator and cascader (if defined)