Add function for notes in tables
Please write a function to add a note to tables.
Something like this:
# notes
NOTE='Note: '
cols = mr_table.columns
mr_table =\
pd.concat([mr_table, pd.DataFrame(
{cols[0] : 'The `Weights` column indicates how the variants were weighted '+\
'in the Mendelian randomisation (MR) analysis. The point estimates and ' +\
'and 95% confidance interval (CI) either reflect an odds ratio or mean ' +\
'difference, indicated by the `Unit` column. All effects are coded towards '+\
'a lower CETP concentration. The `Heterogeneity` columns ' +\
'reflect the Q-test of between variant Heterogeneity. Abbreviations: ' +\
'LDL-C, low-density lipoprotein cholesterol; IDL-C, intermediate-density '+\
'lipoprotein cholesterol; very low-density lipoprotein cholesterol; HDL-C, '+\
'high-density lipoprotein cholesterol; Lp[a], lipoprotein a; TG, total '+\
'triglycerides; SBP, systolic blood pressure; DBP, diastolic blood pressure; '+\
'vol., volume; CHD, coronary heart disease; AF, atrial fibrillation; HF, '+\
'heart failure; AAA, abdominal aortic aneurysm; PD, Parkinson\'s disease.'
},index=[NOTE],
)], axis=0)
mr_table.loc[NOTE,:] = mr_table.loc[NOTE,:].fillna('').copy()
or without an index:
cols = annotation_proteins.columns
annotation_proteins =\
pd.concat([annotation_proteins, pd.DataFrame(
{cols[0] : 'Note: ', cols[1]:'The `CETP associated protein` column records the CSF or brain '+\
'plasma CETP concentration associates with. The Druggability status is based '+\
'on the presence of a drug compound with affinity to the protein '+\
'(`Druggable`), which is referred to as `Drugged` if the compound as ' +\
'received marketing approval - based on ChEMBL and BNF look-ups. Similarly, '+\
'BNF and ChEMBL were consulted to identify drug compounds with a reported '+\
'neurodegeneration related indication or side-effect. GWAS Catalog was '+\
'consulted to identify protein encoding genes with author assigned hits for '+\
'Neurodegeneration related traits. Pubmed was automatically searched using '+\
'Ensembl extracted gene synonyms to identify publications relating the '+\
'protein coding genes to neurodegeneration. An Poisson based enrichment test ' +\
'was subsequently applied to identify proteins with an above average research '+\
'interest. The `Neurodegeneration prioritised protein` column summarizes the '+\
'preceding information.'
},index=[NOTE],
)], axis=0)
annotation_proteins.loc[NOTE,:] = annotation_proteins.loc[NOTE,:].fillna('').copy()