ligning.characterization

Charaterization funcions

class ligning.characterization.Characterize(P: Polymer)

polymer characterization object

cal_MW() float

calculate the molecular weight

Returns

Molecular weight of the polymer

Return type

float

cal_all(cal_MW=False, print_flag=True)

Main count function

Parameters
  • cal_MW (bool, optional) – flag to calculate molecular weight, by default False

  • print_flag (bool, optional) – flag to print all properties, by default True

cal_branching() float

calculate the branching coefficient

Returns

branching_coeff – the branching coefficient: ratio of branched monomers to total monomers

Return type

float

count_OCH3() float

count the number of -OCH3 group

Returns

OCH3_count – -OCH3 counts

Return type

float

count_OH() float

count the number of available -OH3 group

Returns

OH_count – -OH counts

Return type

float

count_connections() dict

Count the number of connections of each monomer

Returns

connections_count – the number of connections

Return type

dict

count_linkages() dict

count the type of linkages

Returns

linkages_count – the linkage type counts

Return type

dict

count_monomers() int

count the total number of monomers, i.e. the polymer size

Returns

monomer_count – the polymer size

Return type

float

count_types() dict

count the monomer types

Returns

mtype_count – the monomer type counts

Return type

dict

get_counts(additional: Optional[bool] = False, cal_MW: Optional[bool] = False) nparray

Get the count array for a polymer

Parameters

additional (Optional[bool], optional) – include additional metrics, by default False

Returns

counts – counts array

Return type

nparray

get_metrics(additional: Optional[bool] = False, cal_MW: Optional[bool] = False) nparray

Get the metrics array for a polymer

Parameters

additional (Optional[bool], optional) – include additional metrics, by default False

Returns

metrics – metrics array

Return type

nparray

class ligning.characterization.CharacterizeGraph(G: nxgraph)

polymer charaterization object

cal_MW() float

calculate the molecular weight

Returns

Molecular weight of the polymer

Return type

float

cal_all(cal_MW=False, print_flag=True)

Main count function

Parameters
  • cal_MW (bool, optional) – flag to calculate molecular weight, by default False

  • print_flag (bool, optional) – flag to print all properties, by default True

cal_metrics(cal_MW: Optional[bool] = False) nparray

calculate the 10 by 1 metrics array

Returns

metrics – metrics array

Return type

nparray

count_OCH3() float

count the number of -OCH3 group

Returns

OCH3_count – -OCH3 counts

Return type

float

count_OH() float

count the number of available -OH3 group

Returns

OH_count – -OH counts

Return type

float

count_linkages() dict

count the type of linkages

Returns

linkages_count – the linkage type counts

Return type

dict

count_monomers() float

count the total number of monomers, i.e. the polymer size

Returns

monomer_count – the polymer size

Return type

float

count_types() dict

count the monomer types

Returns

mtype_count – the monomer type counts

Return type

dict

class ligning.characterization.Population(population: List[Polymer], name: Optional[str] = 'lignin_x', InputPath: Optional[str] = '/home/docs/checkouts/readthedocs.org/user_builds/ligningraphs/checkouts/latest/docs/source', ResultsName: Optional[str] = 'results', TrialIndex: Optional[str] = None)

Characterize a population of polymers

analyze()

Analyze the population Output the data and stats both in csv files

characterize_all()

Characterize each individual polymer

get_counts(additional: Optional[bool] = False)

Get the metrics matrix for the entire population

Parameters

additional (Optional[bool], optional) – include additional metrics, by default False

Returns

metrics – metrics matrix

Return type

nparray

get_metrics_mean(additional: Optional[bool] = False)

Get the metrics matrix for the entire population

Parameters

additional (Optional[bool], optional) – include additional metrics, by default False

Returns

metrics – metrics mean array

Return type

nparray

ligning.characterization.get_counts_polymer(P: Polymer, additional: Optional[bool] = False, cal_MW: Optional[bool] = False) Tuple[nparray, int, float]

Get the counts array for a polymer

Parameters
  • P (Polymer) – polymer object

  • additional (Optional[bool], optional) – include additional metrics, by default False

  • cal_MW (bool, optional) – flag to calculate molecular weight, by default False

Returns

  • counts_P (nparray) – the counts array

  • monomer_count (int) – the number of monomers

  • MW (float) – the molecular weight

ligning.characterization.get_metrics_polymer(P: Polymer, additional: Optional[bool] = False, cal_MW: Optional[bool] = False) Tuple[nparray, int, float]

Get the metrics and count for a polymer

Parameters
  • P (Polymer) – polymer object

  • additional (Optional[bool], optional) – include additional metrics, by default False

  • cal_MW (bool, optional) – flag to calculate molecular weight, by default False

Returns

  • metrics_P (nparray) – the metrics array

  • monomer_count (int) – the number of monomers

  • MW (float) – the molecular weight