[Bioc-devel] MAGMA executable

Hervé Pagès hp@ge@@on@g|thub @end|ng |rom gm@||@com
Mon Dec 13 18:46:43 CET 2021

Hi Brian,

Note that Rsamtools does not relies on any CLI tools. It contains C/C++ 
code that is _compiled_ and _linked_ against Rhtslib rather than relying 
on the standalone `samtools` and `tabix` commands.

Installing MAGMA at package installation time in the package 
installation folder of MAGMA.Celltyping means downloading MAGMA each 
time MAGMA.Celltyping gets installed, including after each update of 
MAGMA.Celltyping. This would be very unusual and would break the general 
expectation that a local install with 'R CMD INSTALL MAGMA.Celltyping' 
should work without the need to access the internet to download 
additional stuff.

Instead I would recommend the following:

- Install in a more permanent location like 
tools::R_user_dir("MAGMA.Celltyping", which="cache")

- Do not install at package installation time or at package load time. 
Instead, delay installation until it's needed, that is, until the user 
calls a function that actually needs MAGMA. One way to achieve this is 
by making sure that all your functions that rely on MAGMA check its 
presence with magma_installed_version() and call magma_install() if 
needed. If MAGMA's license requires that the user accepts an end-user 
agreement, then your functions should not try to install MAGMA 
automatically. They should just fail with an error asking the user to 
call magma_install().

Another approach is to bundle MAGMA's source in MAGMA.Celltyping and 
compile it at installation time but that's an entirely different story.

Hope this helps,


On 13/12/2021 08:37, Brian Schilder wrote:
> Thank you both for the helpful feedback. I’ll follow up with the developers of MAGMA for clarification on license.
> Regarding installation, I agree Kasper, this is not an ideal solution. Installing MAGMA at the R package installation time would be ideal, but I’ve been unable to come up with a way to do this.
> I’ve been look to Rsamtools <https://github.com/Bioconductor/Rsamtools> for some sources of inspiration, since it relies on multiple CLI tools (rsamtools, tabix). I’m unfamiliar with getting bash scripts to run while installing R packages, but looking into this now.
> Best,
> Brian
>> On 13 Dec 2021, at 13:59, Kasper Daniel Hansen <kasperdanielhansen using gmail.com> wrote:
>> Ignoring the license issues (which may be significant), I strongly dislike this installation strategy. It (IMO) unreasonable that you potentially write in system locations on package load. You're looking in
>>    /usr/local/bin
>>    R.home/bin <- this makes not sense, this is the R home location, why should anything else but R be here?
>>    $HOME
>>    working directory
>> In my opinion, if you want to do something like this, you need to do it at installation time and you should install MAGMA in the package location.
>> On Thu, Dec 9, 2021 at 8:30 AM Vincent Carey <stvjc using channing.harvard.edu <mailto:stvjc using channing.harvard.edu>> wrote:
>> I didn't find an obvious licensing statement at the magma site.  I did see
>> note that standard copyright applies; the MAGMA binaries and source code
>> may not be distributed or modified)
>> the licensing situation would affect my advice on this process, but others
>> may have other more
>> specific advice
>> On Thu, Dec 9, 2021 at 7:37 AM Brian Schilder <
>> brian_schilder using alumni.brown.edu <mailto:brian_schilder using alumni.brown.edu>> wrote:
>>> Hi everyone,
>>> I’m a developer for the R package MAGMA.Celltyping <
>>> https://github.com/neurogenomics/MAGMA_Celltyping/tree/bschilder_dev <https://github.com/neurogenomics/MAGMA_Celltyping/tree/bschilder_dev>> (on
>>> the bschilder_dev branch). It’s currently only distributed via GitHub but
>>> I’m trying to get it on Bioc if possible. The dilemma is, it relies on
>>> MAGMA <https://ctg.cncr.nl/software/magma <https://ctg.cncr.nl/software/magma>>, which is only available as a
>>> CLI program.
>>> I have everything passing CRAN/Bioc checks on my local machine, but the
>>> final hurdle is installing MAGMA <https://ctg.cncr.nl/software/magma <https://ctg.cncr.nl/software/magma>> on
>>> other machines (e.g. via GitHub Actions checks) such that it can be called
>>> from within R.
>>> Here’s the steps I’ve taken:
>>> Upon .onLoad <
>>> https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/zzz.R <https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/zzz.R>>
>>> of MAGMA.Celltyping, magma_installed_version() <
>>> https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/magma_installed_version.R <https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/magma_installed_version.R>>
>>> will check whether MAGMA is installed. If not, it proceeds to try and
>>> install it via magma_install() <
>>> https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/magma_install.R <https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/magma_install.R>>
>>> .
>>> magma_install() finds the latest version of MAGMA in their archives <
>>> https://ctg.cncr.nl/software/MAGMA/prog/ <https://ctg.cncr.nl/software/MAGMA/prog/>>, installs it wherever the user
>>> has permissions (from a list of possible installation locations <
>>> https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/find_install_dir.R <https://github.com/neurogenomics/MAGMA_Celltyping/blob/bschilder_dev/R/find_install_dir.R>>),
>>> and sets up the symlink.
>>> Checks that MAGMA is indeed installed and callable from within R using
>>> functions like system(“magma ….”).
>>> This all seems to work fine locally, but when I launch to GitHub actions,
>>> MAGMA.Celltyping can’t seems to install/find MAGMA. it doesn’t seem to be
>>> able to find it.
>>> Does anyone know of any solutions to this that are Bioc (or at least CRAN)
>>> -compatible?
>>> Many thanks in advance,
>>> Brian
>>> ___________
>>> Brian Schilder
>>> PhD Candidate
>>> UK Dementia Research Institute at Imperial College London
>>> Faculty of Medicine, Department of Brain Sciences, Neurogenomics Lab
>>> Profile | bit.ly/imperial_profile <http://bit.ly/imperial_profile> <https://bit.ly/imperial_profile <https://bit.ly/imperial_profile>>
>>> LinkedIn | linkedin.com/in/brian-schilder <http://linkedin.com/in/brian-schilder> <
>>> https://www.linkedin.com/in/brian-schilder/ <https://www.linkedin.com/in/brian-schilder/>>
>>> Twitter | twitter.com/BMSchilder <http://twitter.com/BMSchilder> <http://www.twitter.com/BMSchilder <http://www.twitter.com/BMSchilder>>
>>> Lab | neurogenomics.co.uk <http://neurogenomics.co.uk/> <http://neurogenomics.co.uk/ <http://neurogenomics.co.uk/>>
>>> UK DRI | www.ukdri.ac.uk <http://www.ukdri.ac.uk/> <http://www.ukdri.ac.uk/ <http://www.ukdri.ac.uk/>>
>>>          [[alternative HTML version deleted]]
>>> _______________________________________________
>>> Bioc-devel using r-project.org <mailto:Bioc-devel using r-project.org> mailing list
>>> https://stat.ethz.ch/mailman/listinfo/bioc-devel <https://stat.ethz.ch/mailman/listinfo/bioc-devel>
>> -- 
>> The information in this e-mail is intended only for t...{{dropped:11}}

More information about the Bioc-devel mailing list