summaryrefslogtreecommitdiff
path: root/scripts/pa-tex-table.rb
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/pa-tex-table.rb')
-rwxr-xr-xscripts/pa-tex-table.rb30
1 files changed, 17 insertions, 13 deletions
diff --git a/scripts/pa-tex-table.rb b/scripts/pa-tex-table.rb
index 06f7b26..840df13 100755
--- a/scripts/pa-tex-table.rb
+++ b/scripts/pa-tex-table.rb
@@ -2,23 +2,23 @@
puts '
\definecolor{red}{rgb}{1,0,0}
-\definecolor{lightred}{rgb}{0.5,0,0}
+\definecolor{darkred}{rgb}{0.5,0,0}
\definecolor{green}{rgb}{0,1,0}
-\definecolor{lightgreen}{rgb}{0,0.5,0}
+\definecolor{darkgreen}{rgb}{0,0.5,0}
\definecolor{grey}{rgb}{0.5,0.5,0.5}
\tiny
\begin{longtable}{rcccccccccc}
\caption{Summary of pyrrolizidine alkaloid predictions: red: mutagen, green: non-mutagen, grey: no prediction, dark red/green: low confidence} \\\\
\label{tab:pa}
- & & \multicolumn{2}{c}{lazar} & \multicolumn{3}{c}{R} & \multicolumn{4}{c}{Tensorflow}\\\\
-ID & Measured & MP2D & PaDEL & DL & RF & SVM & LR-sgd & LR-scikit & NN & RF \\\\
+PubChem & & \multicolumn{2}{c}{lazar} & \multicolumn{3}{c}{R} & \multicolumn{4}{c}{Tensorflow}\\\\
+CID & Measured & MP2D & PaDEL & DL & RF & SVM & LR-sgd & LR-scikit & NN & RF \\\\
\hline
\renewcommand{\arraystretch}{0.075}
'
File.read(ARGV[0]).each_line do |l|
unless l.match("SMILES")
- id,cid,name,smi,cansmi,exp,lazar_MP2D,lazar_MP2D_high_confidence,lazar_PaDEL,lazar_PaDEL_high_confidence,r_DL,r_RF,r_SVM,tf_lr_sgd,tf_lr_scikit,tf_NN,tf_RF = l.chomp.split(",")
- row = id
+ id,cid,smi,cansmi,exp,lazar_MP2D,lazar_MP2D_high_confidence,lazar_PaDEL,lazar_PaDEL_high_confidence,r_DL,r_RF,r_SVM,tf_lr_sgd,tf_lr_scikit,tf_NN,tf_RF = l.chomp.split(",")
+ row = cid
if exp == "1"
row += ' & \cellcolor{red}'
elsif exp == "0"
@@ -26,17 +26,21 @@ File.read(ARGV[0]).each_line do |l|
else
row += ' & \cellcolor{grey}'
end
- if lazar_MP2D == "1"
- lazar_MP2D_high_confidence == "F" ? row += ' & \cellcolor{lightred}' : row += ' & \cellcolor{red}'
- elsif lazar_MP2D == "0"
- lazar_MP2D_high_confidence == "F" ? row += ' & \cellcolor{lightgreen}' : row += ' & \cellcolor{green}'
+ if lazar_MP2D == "1" and lazar_MP2D_high_confidence == "F"
+ row += ' & \cellcolor{darkred}'
+ elsif lazar_MP2D == "1" and lazar_MP2D_high_confidence == "T"
+ row += ' & \cellcolor{red}'
+ elsif lazar_MP2D == "0" and lazar_MP2D_high_confidence == "F"
+ row += ' & \cellcolor{darkgreen}'
+ elsif lazar_MP2D == "0" and lazar_MP2D_high_confidence == "T"
+ row += ' & \cellcolor{green}'
else
- row += '& \cellcolor{grey} '
+ row += ' & \cellcolor{grey}'
end
if lazar_PaDEL == "1"
- lazar_PaDEL_high_confidence == "F" ? row += ' & \cellcolor{lightred}' : row += ' & \cellcolor{red}'
+ lazar_PaDEL_high_confidence == "F" ? row += ' & \cellcolor{darkred}' : row += ' & \cellcolor{red}'
elsif lazar_PaDEL == "0"
- lazar_PaDEL_high_confidence == "F" ? row += ' & \cellcolor{lightgreen}' : row += ' & \cellcolor{green}'
+ lazar_PaDEL_high_confidence == "F" ? row += ' & \cellcolor{darkgreen}' : row += ' & \cellcolor{green}'
else
row += ' & \cellcolor{grey}'
end