aboutsummaryrefslogtreecommitdiff
path: root/reproduce/analysis/make
diff options
context:
space:
mode:
authorMohammad Akhlaghi <mohammad@akhlaghi.org>2020-03-23 03:16:06 +0000
committerMohammad Akhlaghi <mohammad@akhlaghi.org>2020-03-23 03:16:06 +0000
commit48e61df320e7571e527049cd3eef5cf96b8cb491 (patch)
tree61a207722f8d005fb091da080facc725889e15a6 /reproduce/analysis/make
parent716b56b71b8513faa617acb38e2a841b59910b44 (diff)
Analysis and configuration file sections complete
With this commit a description of these two important parts have been added to the project, along with several figures showing various parts of the files that are discussed. I also done some other restructuring of the figures and files to make things fit better into the the description of the paper.
Diffstat (limited to 'reproduce/analysis/make')
-rw-r--r--reproduce/analysis/make/demo-plot.mk59
-rw-r--r--reproduce/analysis/make/format.mk (renamed from reproduce/analysis/make/analysis-1.mk)25
-rw-r--r--reproduce/analysis/make/top-make.mk5
3 files changed, 71 insertions, 18 deletions
diff --git a/reproduce/analysis/make/demo-plot.mk b/reproduce/analysis/make/demo-plot.mk
new file mode 100644
index 0000000..caf77af
--- /dev/null
+++ b/reproduce/analysis/make/demo-plot.mk
@@ -0,0 +1,59 @@
+# Second step of analysis:
+# Data for plot of number/fraction of tools per year.
+#
+# Copyright (C) 2020 Mohammad Akhlaghi <mohammad@akhlaghi.org>
+#
+# This Makefile is free software: you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by the
+# Free Software Foundation, either version 3 of the License, or (at your
+# option) any later version.
+#
+# This Makefile is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+# Public License for more details. See <http://www.gnu.org/licenses/>.
+
+
+
+
+# Directory to host outputs
+# -------------------------
+a2dir = $(texdir)/tools-per-year
+$(a2dir):; mkdir $@
+
+
+
+
+
+# Table for Figure 1C of Menke+20
+# -------------------------------
+a2mk20f1c = $(a2dir)/tools-per-year.txt
+$(a2mk20f1c): $(mk20tab3) | $(a2dir)
+
+ # Remove the (possibly) produced figure that is created from this
+ # table: it is created by LaTeX's TiKZ package, and includes
+ # multiple files with a fixed prefix.
+ rm -f $(tikzdir)/figure-tools-per-year*
+
+ # Find the maximum number of papers.
+ awk '!/^#/{all[$$1]+=$$2; id[$$1]+=$$3} \
+ END{ for(year in all) \
+ print year, 100*id[year]/all[year], all[year] \
+ }' $< \
+ > $@
+
+
+
+
+
+# Final LaTeX macro
+$(mtexdir)/demo-plot.tex: $(a2mk20f1c) $(pconfdir)/menke-demo-year.conf
+
+ # Find the first year (first column of first row) of data.
+ v=$$(awk 'NR==1{print $$1}' $(a2mk20f1c))
+ echo "\newcommand{\menkefirstyear}{$$v}" > $@
+
+ # Find the number of papers in 1996.
+ v=$$(awk '$$1==$(menke-demo-year){print $$3}' $(a2mk20f1c))
+ echo "\newcommand{\menkenumpapersdemocount}{$$v}" >> $@
+ echo "\newcommand{\menkenumpapersdemoyear}{$(menke-demo-year)}" >> $@
diff --git a/reproduce/analysis/make/analysis-1.mk b/reproduce/analysis/make/format.mk
index f739306..868c411 100644
--- a/reproduce/analysis/make/analysis-1.mk
+++ b/reproduce/analysis/make/format.mk
@@ -1,7 +1,10 @@
-# Use the data from Menke 2020 (DOI:10.1101/2020.01.15.908111) as a
-# demonstration analysis for this paper. This is a relevant paper because
-# it provides good statistics about the status of reproducibility in
-# scientific publications.
+# First step of analysis:
+# Prepare the data, return basic values.
+#
+# As a demonstration analysis to go with the paper, we use the data from
+# Menke 2020 (DOI:10.1101/2020.01.15.908111). This is a relevant paper
+# because it provides interesting statistics about tools and methods used
+# in scientific papers.
#
# Copyright (C) 2020 Mohammad Akhlaghi <mohammad@akhlaghi.org>
#
@@ -20,7 +23,7 @@
# Save the "Table 3" spreadsheet from the downloaded `.xlsx' file into a
# simple plain-text file that is easy to use.
-a1dir = $(BDIR)/analysis-1
+a1dir = $(BDIR)/analysis1
mk20tab3 = $(a1dir)/menke20-table-3.txt
$(a1dir):; mkdir $@
$(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
@@ -61,19 +64,9 @@ $(mk20tab3): $(indir)/menke20.xlsx | $(a1dir)
-############################
-# Recreate Figure 1C of Menke+20.
-############################
-
-# awk '!/^#/{all[$1]+=$2; id[$1]+=$3} END{for(year in all){print year, id[year]/all[year]}}' menke20-table-3.txt.tmp
-############################
-
-
-
-
# Main LaTeX macro file
-$(mtexdir)/analysis-1.tex: $(mk20tab3) | $(mtexdir)
+$(mtexdir)/format.tex: $(mk20tab3)
# Count the total number of papers in their study.
v=$$(awk '!/^#/{c+=$$2} END{print c}' $(mk20tab3))
diff --git a/reproduce/analysis/make/top-make.mk b/reproduce/analysis/make/top-make.mk
index 6dd322f..000c1fd 100644
--- a/reproduce/analysis/make/top-make.mk
+++ b/reproduce/analysis/make/top-make.mk
@@ -112,8 +112,9 @@ endif
# wild-card like the configuration Makefiles).
makesrc = initialize \
download \
+ format \
+ demo-plot \
verify \
- analysis-1 \
paper
@@ -132,5 +133,5 @@ makesrc = initialize \
# But before that, we need to identify the phase for the Makefiles that are
# run both in `./project prepare' and `./project make'.
project-phase = make
-include reproduce/analysis/config/*.mk
+include reproduce/analysis/config/*.conf
include $(foreach s,$(makesrc), reproduce/analysis/make/$(s).mk)