Tracking environment information
Table of Contents
-
-
- Additional references +
- Getting information about your Git repository +
- Getting information about Python(3) libraries
-
-
- "Thoughts" on language/software stability -
- Controlling your software environment -
- Preservation/Archiving -
- Workflows -
- Numerical and statistical issues -
- Publication practices -
- Experimentation +
- Getting information about your system +
- Getting the list of installed packages and their version +
- How to list imported modules? +
- Saving and restoring an environment with pip +
- Installing a new package or a specific version
- - Tracking environment information +
- Getting information about R libraries @@ -39,205 +32,9 @@
Additional references
-"Thoughts" on language/software stability
--As we explained, the programming language used in an analysis has a -clear influence on the reproducibility of your analysis. It is not a -characteristic of the language itself but rather a consequence of the -development philosophy of the underlying community. For example C is a -very stable language with a very clear specification designed by a -committee (even though some compilers may not respect this norm). -
- --On the other end of the spectrum, Python had a much more organic -development based on a readability philosophy and valuing continuous -improvement over backwards-compatibility. Furthermore, Python is -commonly used as a wrapping language (e.g., to easily use C or FORTRAN -libraries) and has its own packaging system. All these design choices -tend to make reproducibility often a bit painful with Python, even -though the community is slowly taking this into account. The transition from Python 2 to the not fully backwards compatible Python 3 has been a particularly painful process, not least because the two languages are so similar that is it not always easy to figure out if a given script or module is written in Python 2 or Python 3. It isn't even rare to see Python scripts that work under both Python 2 and Python 3, but produce different results due to the change in the behavior of integer division. -
- -
-R, in comparison is much closer (in terms of developer community) to
-languages like SAS, which is heavily used in the pharmaceutical
-industry where statistical procedures need to be standardized and rock
-solid/stable. R is obviously not immune to evolutions that break old
-versions and hinder reproducibility/backward compatibility. Here is a
-relatively recent true story about this and some colleagues who worked
-on the statistics introductory course with R on FUN reported us
-several issues with a few functions (plotmeans
from gplots
,
-survfit
from survival
, or hclust
) whose default parameters had
-changed over the years. It is thus probably good practice to give
-explicit values for all parameters (which can be cumbersome) instead
-of relying on default values, and to restrict your dependencies as much
-as possible.
-
-This being said, the R development community is generally quite -careful about stability. We (the authors of this MOOC) believe that open -source (which allows to inspect how computation is done and to -identify both mistakes and sources of non-reproducibility) is more -important than the rock solid stability of SAS, which is proprietary -software. Yet, if you really need to stay with SAS (similar solutions -probably exist for other languages as well), you should know that SAS -can be used within Jupyter using either the Python SASKernel or the -Python SASPy package (step by step explanations about this are given -here). Using such literate programming approach allied with systematic -version and environment control will always help. -
-Controlling your software environment
--As we mentioned in the video sequences, there are several solutions to -control your environment: -
--
-
- The easy (preserve the mess) ones: CDE or ReproZip -
- The more demanding (encourage cleanliness) where you start with a
-clean environment and install only what's strictly necessary (and document it):
-
-
-
- The very well known Docker -
- Singularity or Spack, which are more targeted toward the specific -needs of high performance computing users -
- Guix, Nix that are very clean (perfect?) solutions to this -dependency hell and which we recommend -
-
-It may be hard to understand the difference between these different -approaches and decide which one is better in your context. -
- --Here is a webinar where some of these tools are demoed in a -reproducible research context: Controling your environment (by Michael -Mercier and Cristian Ruiz) -
- --You may also want to have a look at the Popper conventions (webinar by -Ivo Gimenez through google hangout) or at the presentation of Konrad -Hinsen on Active Papers (http://www.activepapers.org/). -
-Preservation/Archiving
--Ensuring software is properly archived, i.e, is safely stored so that -it can be accessed in a perennial way, can be quite tricky. If you -have never seen Roberto Di Cosmo presenting the Software Heritage -project, this is a must see. https://www.softwareheritage.org/ -
- --For regular data, we highly recommend using https://www.zenodo.org/ -whenever the data is not sensitive. -
-Workflows
--In the video sequences, we mentioned workflow managers (original application domain in parenthesis): -
--
-
- Galaxy (genomics), Kepler (ecology), Taverna (bio-informatics), Pegasus -(astronomy), Collective Knowledge (compiling optimization) , -VisTrails (image processing) -
- Light-weight: dask (python), drake (R), swift (molecular biology),
-snakemake (like
make
but more expressive and inpython
) …
- - Hybrids: SOS-notebook, … -
-You may want to have a look at this webinar: Reproducible Science in -Bio-informatics: Current Status, Solutions and Research Opportunities -(by Sarah Cohen Boulakia, Yvan Le Bras and Jérôme Chopard). -
-Numerical and statistical issues
--We have mentioned these topics in our MOOC but we could by no way -cover them properly. We only suggest here a few interesting talks -about this. -
--
-
- In this talk, Pierre Dragicevic provides a nice illustration of the -consequences of statistical uncertainty and of how some concepts -(e.G. p-values) are commonly badly understood. -
- Nathalie Revol, Philippe Langlois and Stef Graillat present the main -challenges encountered when trying to achieve numerical -reproducibility and present recent research work on this topic. -
Publication practices
--You may want to have a look at the following two webinars: -
--
-
- Enabling open and reproducible research at computer systems’ -conferences (by Grigori Fursin). In particular, this talk discusses -artifact evaluation that is becoming more and more popular. -
- Publication Modes Favoring Reproducible Research (by Konrad Hinsen -and Nicolas Rougier). In this talk, the motivation for the ReScience -journal initiative are presented. -
- Simine Vazire - When Should We be Skeptical of Scientific Claims?, -which is discussing publication practices in social sciences and in -particular HARKing (Hypothesizing After the Results are Known), -p-hacking, etc. -
Experimentation
--Experimentation was not covered in this MOOC, although it is an -essential part of science. The main reason is that practices and -constraints can vary so wildly from one domain to another that it could -not be properly covered in a first edition. We would be happy to -gather references you consider as interesting in your domain so do not -hesitate to provide us with such references by using the forum and we -will update this page. -
- - -Tracking environment information
-Getting information about your Git repository
-Getting information about your Git repository
+When taking notes, it may be difficult to remember which version of the code or of a file was used. This is what version control is useful @@ -328,13 +125,13 @@ is the price to pay for running git from within the notebook itself.
Getting information about Python(3) libraries
-Getting information about Python(3) libraries
+Getting information about your system
-Getting information about your system
+This topic is discussed on StackOverflow.
@@ -351,9 +148,9 @@ uname_result(system='Linux', node='icarus', release='4.15.0-2-amd64', version='#Getting the list of installed packages and their version
-Getting the list of installed packages and their version
+
This topic is discussed on StackOverflow. When using pip
(the Python
package installer) within a shell command, it is easy to query the
@@ -461,9 +258,9 @@ Requires: patsy, pandas
How to list imported modules?
-How to list imported modules?
+Without resorting to pip (that will list all available packages), you may want to know which modules are loaded in a Python session as well @@ -525,9 +322,9 @@ zlib 1.0
Saving and restoring an environment with pip
-Saving and restoring an environment with pip
+The easiest way to go is as follows:
@@ -544,9 +341,9 @@ dynamic libraries that are wrapped by Python though.Installing a new package or a specific version
-Installing a new package or a specific version
+The Jupyter environment we deployed on our servers for the MOOC is based on the version 4.5.4 of Miniconda and Python 3.6. In this @@ -613,13 +410,13 @@ It is even possible to install a specific (possibly much older) version, e.g.,:
Getting information about R libraries
-Getting information about R libraries
+Getting the list imported modules and their version
-Getting the list imported modules and their version
+
The best way seems to be to rely on the
Finally, it is good to know that there is a built-in R command
(
This section is mostly a cut and paste from the recent post by Ian
Pylvainen on this topic. It comprises a very clear explanation of how
@@ -954,9 +751,9 @@ to proceed.
If you're on a Debian or a Ubuntu system, it may be difficult to
access a specific version without breaking your system. So unless you
@@ -979,9 +776,10 @@ install.packages(packageurl, repos=Using devtools
The simplest method to install the version you need is to use the
Alternatively, you may want to install an older package from source If
devtools fails or if you do not want to depend on it, you can install
@@ -1025,9 +824,10 @@ R CMD INSTALL ggplot2_0.9.1.tar.gz
There are a few potential issues that may arise with installing older
versions of packages:
@@ -1041,8 +841,6 @@ to downgrade R to a compatible version or update your R code to work
with a newer version of the package.
+As we explained, the programming language used in an analysis has a
+clear influence on the reproducibility of your analysis. It is not a
+characteristic of the language itself but rather a consequence of the
+development philosophy of the underlying community. For example C is a
+very stable language with a very clear specification designed by a
+committee (even though some compilers may not respect this norm).
+
+On the other end of the spectrum, Python had a much more organic
+development based on a readability philosophy and valuing continuous
+improvement over backwards-compatibility. Furthermore, Python is
+commonly used as a wrapping language (e.g., to easily use C or FORTRAN
+libraries) and has its own packaging system. All these design choices
+tend to make reproducibility often a bit painful with Python, even
+though the community is slowly taking this into account. The transition from Python 2 to the not fully backwards compatible Python 3 has been a particularly painful process, not least because the two languages are so similar that is it not always easy to figure out if a given script or module is written in Python 2 or Python 3. It isn't even rare to see Python scripts that work under both Python 2 and Python 3, but produce different results due to the change in the behavior of integer division.
+
+R, in comparison is much closer (in terms of developer community) to
+languages like SAS, which is heavily used in the pharmaceutical
+industry where statistical procedures need to be standardized and rock
+solid/stable. R is obviously not immune to evolutions that break old
+versions and hinder reproducibility/backward compatibility. Here is a
+relatively recent true story about this and some colleagues who worked
+on the statistics introductory course with R on FUN reported us
+several issues with a few functions (
+This being said, the R development community is generally quite
+careful about stability. We (the authors of this MOOC) believe that open
+source (which allows to inspect how computation is done and to
+identify both mistakes and sources of non-reproducibility) is more
+important than the rock solid stability of SAS, which is proprietary
+software. Yet, if you really need to stay with SAS (similar solutions
+probably exist for other languages as well), you should know that SAS
+can be used within Jupyter using either the Python SASKernel or the
+Python SASPy package (step by step explanations about this are given
+here). Using such literate programming approach allied with systematic
+version and environment control will always help.
+
+As we mentioned in the video sequences, there are several solutions to
+control your environment:
+
+It may be hard to understand the difference between these different
+approaches and decide which one is better in your context.
+
+Here is a webinar where some of these tools are demoed in a
+reproducible research context: Controling your environment (by Michael
+Mercier and Cristian Ruiz)
+
+You may also want to have a look at the Popper conventions (webinar by
+Ivo Gimenez through google hangout) or at the presentation of Konrad
+Hinsen on Active Papers (http://www.activepapers.org/).
+
+Ensuring software is properly archived, i.e, is safely stored so that
+it can be accessed in a perennial way, can be quite tricky. If you
+have never seen Roberto Di Cosmo presenting the Software Heritage
+project, this is a must see. https://www.softwareheritage.org/
+
+For regular data, we highly recommend using https://www.zenodo.org/
+whenever the data is not sensitive.
+
+In the video sequences, we mentioned workflow managers (original application domain in parenthesis):
+
+You may want to have a look at this webinar: Reproducible Science in
+Bio-informatics: Current Status, Solutions and Research Opportunities
+(by Sarah Cohen Boulakia, Yvan Le Bras and Jérôme Chopard).
+
+We have mentioned these topics in our MOOC but we could by no way
+cover them properly. We only suggest here a few interesting talks
+about this.
+
+You may want to have a look at the following two webinars:
+
+Experimentation was not covered in this MOOC, although it is an
+essential part of science. The main reason is that practices and
+constraints can vary so wildly from one domain to another that it could
+not be properly covered in a first edition. We would be happy to
+gather references you consider as interesting in your domain so do not
+hesitate to provide us with such references by using the forum and we
+will update this page.
+devtools
package (if this
package is not installed, you should install it first by running in R
@@ -687,9 +484,9 @@ clean R dependency management should thus have a look at
-Getting the list of installed packages and their version
-Getting the list of installed packages and their version
+installed.packages
) allowing to retrieve and list the details of all
@@ -944,9 +741,9 @@ packages installed.
Installing a new package or a specific version
-Installing a new package or a specific version
+
-
-Installing a pre-compiled version
+
-Using devtools
+install_version()
function of the devtools
package (obviously, you
@@ -995,9 +793,10 @@ install_version("ggplot2", version =
-Installing from source code
+
-Potential issues
+Additional references
+Table of Contents
+
+"Thoughts" on language/software stability
+plotmeans
from gplots
,
+survfit
from survival
, or hclust
) whose default parameters had
+changed over the years. It is thus probably good practice to give
+explicit values for all parameters (which can be cumbersome) instead
+of relying on default values, and to restrict your dependencies as much
+as possible.
+Controlling your software environment
+
+
+
+
+
Preservation/Archiving
+Workflows
+
+
+
+make
but more expressive and in python
) …Numerical and statistical issues
+
+
+Publication practices
+
+
+Experimentation
+