pyamr.core.table package
Submodules
pyamr.core.table.acronym module
Classes:
Functions:
|
This method created the acronym for a given string |
- class pyamr.core.table.acronym.AcronymBuilder[source]
Bases:
object
Methods:
fit
(values, acronyms)This method creates a dictionary with the acronyms
inverse_transform
(acronyms)This method returns the values for given acronyms.
transform
(values)This method returns the acronyms for given values
update
()- fit(values, acronyms)[source]
This method creates a dictionary with the acronyms
TODO: Instead of just checking whether there are acronym conflicts or not ensure that always unique acronyms are created. Note that the implemented approach to create acronyms does not ensure they are always unique.
- Parameters:
values (array-like (contains strings)) – The array with the possible values
acronyms (array-like (contains strings)) – The array with the corresponding acronyms.
- inverse_transform(acronyms)[source]
This method returns the values for given acronyms.
- Parameters:
values (array-like)
- Return type:
array with acronyms
- pyamr.core.table.acronym.acronym(name, length=3, prefix='A_')[source]
This method created the acronym for a given string
- Parameters:
name (string-like) – The string to construct the acronym
length (int-like) – The number of letters used for the first word of the acronym
prefix (string-like) – The prefix to add to the acronym for identification purposes
- Return type:
string
pyamr.core.table.antibiotic module
Classes:
|
|
- class pyamr.core.table.antibiotic.AntibioticTable(to_lowercase=None, to_uppercase=None, delete_spaces=None, delete_parenthesis=None)[source]
Bases:
object
Methods:
fit
(dataframe)
- class pyamr.core.table.antibiotic.AntibioticsTable[source]
Bases:
object
Attributes:
Methods:
compute
(input_path, output_path)This method computes/updates a table from data.
create_table
(data_path)This method creates the table from input data
fit
(values, acronym)merge_table
(df1, df2, on, conflicts)This function merges the two basic columns name and code.
show_information
(df, dfc, pathname)This method shows important information.
update
()- codeF = 'antibioticCode'
- codeO = 'antibioticCodeOrig'
- compute(input_path, output_path)[source]
This method computes/updates a table from data.
- Parameters:
input_path (the path with the data.)
output_path (the path to store the table.)
- l = 8
- merge_table(df1, df2, on, conflicts)[source]
This function merges the two basic columns name and code.
- Parameters:
df1 (the old dataframe with name and code.)
df2 (the new dataframe with name and code.)
- Returns:
df_m (merged dataframe.)
df_c (conflicts dataframe.)
- nameF = 'antibioticName'
- nameO = 'antibioticNameOrig'
- usecols = ['antibioticNameOrig', 'antibioticCodeOrig']
pyamr.core.table.organism module
Classes:
- class pyamr.core.table.organism.OrganismsTable[source]
Bases:
object
Attributes:
Methods:
compute
(input_path, output_path)This method computes/updates a table from data.
create_table
(data_path)This method creates the table from input data
merge_table
(df1, df2, on, conflicts)This function merges the two basic columns name and code.
show_information
(df, dfc, pathname)This method shows important information.
- codeF = 'organismCode'
- codeO = 'organismCodeOrig'
- codeS = 'specieCode'
- compute(input_path, output_path)[source]
This method computes/updates a table from data.
- Parameters:
input_path (the path with the data.)
output_path (the path to store the table.)
- len_sp = 8
- len_tp = 8
- merge_table(df1, df2, on, conflicts)[source]
This function merges the two basic columns name and code.
- Parameters:
df1 (the old dataframe with name and code.)
df2 (the new dataframe with name and code.)
- Returns:
df_m (merged dataframe.)
df_c (conflicts dataframe.)
- nameF = 'organismName'
- nameO = 'organismNameOrig'
- nameS = 'specieName'
- usecols = ['organismNameOrig', 'organismCodeOrig']
pyamr.core.table.utils module
Functions:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
This function rename codes (i.e. |