Monday, November 8, 2021

Stepwise tutorial to Install Admixtools & Plink

 I will make 3 separate posts on how to install Admixtools, run qpAdm and run qpGraph respectively. This first blog post will detail steps to successfully install Admixtools by Harvard lab.

STEP 1.  Have a Linux system

Admixtools cannot be run from a Windows system. If you have a Windows or MacOS Host system, install Oracle VirtualBox from here. Its free.

Install any Guest linux system on this VBox. I use OpenSuse Leap v15.1 for no particular reason apart from that I'm used to it. The virtual image for installation can be downloaded for free from here.

Once this is done, install the guest Linux system on the VBOX. This video below can guide you. 


In the Virtual box settings (can only edit it when Guest OS is shut down), make sure to use 2 processors, 3d acceleration enabled in display settings and I would suggest using 4GB RAM. Use VBoxSVGA as Graphics controller in display settings so that you can get full screen display in guest OS.

STEP 2: Download ADMIXTOOLS

Once inside the Linux Guest OS, open browser and go to https://github.com/DReichLab/AdmixTools
Click the green 'Code' button and download the ZIP archive. Go the the folder where the download happened and extract the ZIP folder into another folder. Rename this folder for ease of typing.



STEP 3: Install Admixtools

In the guest OS terminal, go to the admixtools folder. eg. cd /home/ash/Downloads/AdmixTools/src

Once inside the folder, the next 3 commands are

1. make clobber
2. make all
3. make install

Most likely, there will be errors in running command no 2 because of many missing libraries. To resolve that make sure to install required libraries such as gcc, gsl, lapack, openblas and their development libraries as well. The below screen record shows how to do it in OpenSuse.


After the 'make all' command is successful, type 'make install' and press enter. This will end the installation process. The last step now required is to copy the newly made executables in /Admixtools/bin to /bin as shown below.


Now your system is ready to run commands like qpAdm, qpGraph, qpfstat, qpDstat, convertf etc.

STEP 4: Install PLINK

PLINK's primary job is management and analysis of position-based SNP-like data for thousands of samples, and it is optimized for this setting. It is best used for merging various databases having same SNP array, extracting single chromosome data for multiple samples (useful for Y calls), extracting only s afew samples into a new database, etc. It is a must have tool.

Download Plink 1.90 (not 2.0) from https://www.cog-genomics.org/plink/ in the guest Linux OS. 
Extract the ZIP folder into a normal folder. 
Copy the Plink and prettify executables into the /bin folder where we pasted the other executables.

STEP 5: Enable clipboard and file sharing between Host & Guest OS

Follow the steps listed here to make a shared folder which you can use in both the Host and Guest OS.
If the shared folder name is 'IE' and /home/ash/host' is the location of folder in Guest , load it manually at every startup with this command in the terminal. Input your password when asked.

sudo mount -t vboxsf IE /home/ash/host

This will load your shared folder in Host to the given folder in the Guest and it will be a bidirectional shared folder.

STEP 6: Download the 1240k Eigenstrat database from Harvard Lab

Go here in your browser. You can download these files in the Host shared folder also, as the guest OS can read from this shared folder.

Download the 1240k tarball all files (.ind, .snp, .geno and .anno) from here. The 1240k + HO database is not 1240K but 500something k, so avoid it.


You are now ready to play with Admixtools.

Step 2: 

HOW TO Part 2:: How to test models using qpAdm - qpAdm 101


18 comments:

Anon blogger ind said...

Thank you. It would be really helpful if you continue this series and also add how to interpret some observations and results.

Anon blogger ind said...

Will be trying these tomorrow, though I’ll be running them on a linux host on azure

vAsiSTha said...

@anon I will make qpAdm and qpGraph tutorial soon which will include how to read the output and test models.

H said...

Hey, I'm completely new to this. I'm havıng trouble running the 'make' command, the terminal says ''If 'make' is not a typo you can use command-not-found to lookup the package that contains it,[...]''. What am I doing incorrectly?

vAsiSTha said...

Which linux OS are you using?

try running 'sudo apt-get install build-essential' first then try again

vAsiSTha said...

or you can try

sudo apt-get update

then

sudo apt-get install make

But build-essential solution is preferable

H said...

I'm using openSUSE on the Guest OS, I tried applying what you suggested but it says ''sudo: apt-get: command not found''. Please bear with me since as I said I'm completely new to this lol

H said...

I mean openSUSE on the VBOX

vAsiSTha said...

On opensuse try
'sudo zypper install --type pattern devel_basis'

H said...

Never mind, I pulled it off, now I'm facing a different issue though. As you have mentioned above, the second command will likely bring errors with it. The error I received goes like:

/usr/lib64/gcc/x86_64-suse-linux/11/../../../../x86_64-suse-linux/bin/ld: cannot find -lgsl
collect2: error: ld returned 1 exit status
make: *** [: qp3Pop] Error 1

H said...

Am I missing a library?

H said...
This comment has been removed by the author.
H said...

( ''builtin'' between <> in the [])

vAsiSTha said...

Yes you're missing lib gsl
"cannot find -lgsl"

Open software manager from opensuse menu and search for gsl development libraries. Install them. You will get more errors after that. Install them too.

vAsiSTha said...

Have a look at my video, i deal with these errors

Konowryy said...

I followed step by step the videos and when I write "make clobber" it doesn't work, it shows me "If 'make' is not a typo you can use command-not-found to lookup the package that ...".
What's the problem I don't understand

Konwryy said...

I am at the step 5 and i did nothing well because the tutorial is with a Windows 10 virtual box machine, this step doesn't work. Is it necessary ?

vAsiSTha said...

Sorry for late reply, if make is not found then you are missing some basic linux package. Install package 'build-essentials'. find out how to do that online.