Friday, 6 March 2020

How to update R version inside the R docker for Debian distro



Today lesson about on how to update R version inside the R docker


When i ran a docker for R, the new package need the R version of 3.6.x
Mine was R version 3.4.x


                                                                      How ya?



We can follow this steps to quick upgrade the R version for the Debian distro:


# Enter your docker and remove the old version of R

root@1234 $ apt-get remove r-base-core


# Replace  with bionic which is compatible with your current system

root@1234 $ add-apt-repository 'deb https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/'


# add the key

$ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys E298A3A825C0D65DFD57CBB651716619E084DAB9

# Do the update

$ apt-get update

# Install new r-base of R version

$ apt-get install r-base

# Check the new version

$ apt-cache policy r-base

r-base: Installed: 3.6.3-1bionic Candidate: 3.6.3-1bionic Version table: *** 3.6.3-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 100 /var/lib/dpkg/status 3.6.2-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.6.1-3bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.6.1-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.6.0-2bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.6.0-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.5.3-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.5.2-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.5.1-2bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.5.1-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.5.0-1bionic 500 500 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran35/ Packages 3.4.4-1ubuntu1 500 500 http://archive.ubuntu.com/ubuntu bionic/universe amd64 Packages




Hope you guys enjoy!






Monday, 2 March 2020

How to validate a bam file



Hello

I will cover on how to quick check our BAM file after mapping/alignment process.

In my case, I use BWA as for the mapping process of WGS data.

To validate our BAM file, first we need to install Picard tool, developed by Broad Institutes (https://broadinstitute.github.io/picard/). I will use Bioconda to install Picard


#quick check on bam file

$ conda create -n Picard python=3.7
$ conda activate Picard
$ conda install -c bioconda picard

$ picard -h
$ ValidateSamFile -h

#test one file
$ picard ValidateSamFile I=/path/to/bam/file/SRR030257.bam MODE=SUMMARY

#you can see warning or error on the terminal


Solution:

We must add Read Group information to our dataset using Picard utility before proceed with the next step.