Sunday, May 7, 2023

MINIFS function in excel

 =MINIFS(Sheet2!F:F,Sheet2!M:M,A2)

Sheet2!F:F : Dates - because I want the minimum date from a list of dates

Sheet2!M:M : Searches this column for my key

A2:  search this is the key for which I want to find out the minimum date in column M 


Column F Column M

22/11/2011 NA

27/11/2011 NA

13/12/2021 Cluster_18

18/09/2013 Cluster_18


Final result:

Cluster_18 18/09/2013

The MINIFS function returns the minimum value among cells specified by a given set of conditions or criteria.

Sunday, April 9, 2023

How to Fix a VirtualBox Aborted Error with Blank Screen in Ubuntu

Have you ever encountered an issue where your Windows virtual machine just suddenly aborted and left you with a blank screen? This can be a frustrating experience, especially if you were in the middle of an important task or project. Luckily, there's a simple solution to this problem: installing the VirtualBox Extension Pack.

VirtualBox is a free and open-source virtualization software that allows you to run different operating systems on your computer. However, in order for VirtualBox to emulate the VM's devices correctly, it needs the same version of the VirtualBox Extension Pack to be installed. This is why you might have encountered an aborted VM with a blank screen – the extension pack was missing.

To fix this issue, you'll need to follow a few simple steps:

Step 1: Check your VirtualBox version

Open the VirtualBox Manager and go to Help > About VirtualBox. This will show you the version of VirtualBox that's currently installed on your system. Make note of this version number, as you'll need it for the next step.



Step 2: Download and install the VirtualBox Extension Pack from here based on your ubuntu OS version.

Now that you know your VirtualBox version, you need to download the same version of the VirtualBox Extension Pack. You can find the download link for the extension pack on the VirtualBox website. Make sure to download the correct version that matches your VirtualBox installation.

Once the download is complete, double-click the .deb file to start the installation process in Ubuntu. You'll need to accept the license agreement and follow the prompts to complete the installation.

And that's it! Once the VirtualBox Extension Pack is installed, and you restart the VM, your Windows virtual machine should no longer abort with a blank screen. You can now continue working on your projects and tasks without any interruptions.

In conclusion, VirtualBox is a powerful virtualization tool that can greatly improve your productivity by allowing you to run multiple operating systems on a single computer. However, it's important to ensure that you have the correct version of the VirtualBox Extension Pack installed to avoid any issues with your virtual machines. By following the simple steps outlined above, you can quickly and easily fix any aborted VMs with a blank screen.

Wednesday, April 5, 2023

qpois function in R

"The qpois function provides the maximum number of events that can occur within a given time interval, given a certain mean number of events and a 95% confidence level. Essentially, it tells us the upper limit of events that are likely to occur within that time interval based on statistical analysis."

Monday, March 27, 2023

Resolved-Java version 11 is required to run InterProScan

 $ ./interproscan.sh -i test_all_appl.fasta -f tsv

Java version 11 is required to run InterProScan.

Detected version 1.8.0_92

Please install the correct version.



$ conda create -n openjdk_11.0.1 openjdk=11.0.1

$ conda activate openjdk_11.0.1
time /data01/Databases/interproscan/interproscan-5.60-92.0/interproscan.sh -t n -i filename.fasta -f tsv -dp -cpu 64

$ conda deactivate

Monday, February 20, 2023

Unexpected Topology in Gubbins Newick File: An Analysis of Branch Arrangement with Respect to SNPs

I generated a dummy file and utilized Gubbins to eliminate recombination. Here are the observations I made:

  • SNPs are identified based on the bases in the first sequence.

  • Gaps or Ns do not contribute to SNPs

  • The initial sequence is designated as the reference sequence, and any modifications made to it can result in notable changes in the output. These changes may range from slight to significant depending on the similarity between the sequences.

Furthermore, I detected an issue with the newick file in a distinct dataset when employing Gubbins. Specifically, the branches that lack SNPs should have been positioned adjacently, but were instead organized differently, resulting in a distinct topology.


 For instance, in the given example, all the samples without SNPs should have been grouped together, but Gubbins tree (newick) failed to do so.







To achieve this, I utilized the postGubbins.filtered_polymorphic_sites.fasta file and produced a tree using fasttree, resulting in the accurate output illustrated below:




Hope that helps!


Thursday, December 29, 2022

Resolved - scenic+ pip install error

  pip install -e .

Obtaining file:///home/prakki/sw/scenicplus

  Preparing metadata (setup.py) ... error

  ERROR: Command errored out with exit status 1:

   command: /home/prakki/sw/pyenv/versions/3.6.4/bin/python3.6 -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/prakki/sw/scenicplus/setup.py'"'"'; __file__='"'"'/home/prakki/sw/scenicplus/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-pip-egg-info-rn24et6_

       cwd: /home/prakki/sw/scenicplus/

  Complete output (22 lines):

  Traceback (most recent call last):

    File "<string>", line 1, in <module>

    File "/home/prakki/sw/scenicplus/setup.py", line 48, in <module>

      "Operating System :: OS Independent",

    File "/home/prakki/.local/lib/python3.6/site-packages/setuptools/__init__.py", line 145, in setup

      return distutils.core.setup(**attrs)

    File "/home/prakki/sw/pyenv/versions/3.6.4/lib/python3.6/distutils/core.py", line 108, in setup

      _setup_distribution = dist = klass(attrs)

    File "/home/prakki/.local/lib/python3.6/site-packages/setuptools/dist.py", line 444, in __init__

      k: v for k, v in attrs.items()

    File "/home/prakki/sw/pyenv/versions/3.6.4/lib/python3.6/distutils/dist.py", line 281, in __init__

      self.finalize_options()

    File "/home/prakki/.local/lib/python3.6/site-packages/setuptools/dist.py", line 732, in finalize_options

      ep.load()(self, ep.name, value)

    File "/home/prakki/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2434, in load

      return self.resolve()

    File "/home/prakki/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2440, in resolve

      module = __import__(self.module_name, fromlist=['__name__'], level=0)

    File "/home/prakki/sw/scenicplus/.eggs/setuptools_scm-7.1.0-py3.6.egg/setuptools_scm/__init__.py", line 5

      from __future__ import annotations

      ^

  SyntaxError: future feature annotations is not defined

  ----------------------------------------

WARNING: Discarding file:///home/prakki/sw/scenicplus. Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.


Solution:

For some reason, although I installed python3.8 version for scenic+, still it reported error. And surprisingly, my python version was found to be 3.6

$ python --version

Python 3.6.4


but, I had python3.8 version installed in the scenicplus environment.

$ which python3.8

/home/prakki/anaconda3/envs/scenicplus/bin/python3.8

Assuming I am using older version of pip, I checked the above bin had a latest pip version.

and running the below command finally worked in the installation of scenic

/home/prakki/anaconda3/envs/scenicplus/bin/pip install .





Wednesday, November 30, 2022

devtools installation error

 installing *source* package ‘textshaping’ ...

** package ‘textshaping’ successfully unpacked and MD5 sums checked

** using staged installation

Package harfbuzz was not found in the pkg-config search path.

Perhaps you should add the directory containing `harfbuzz.pc'

to the PKG_CONFIG_PATH environment variable

No package 'harfbuzz' found

Package fribidi was not found in the pkg-config search path.

Perhaps you should add the directory containing `fribidi.pc'

to the PKG_CONFIG_PATH environment variable

No package 'fribidi' found

Using PKG_CFLAGS=

Using PKG_LIBS=-lfreetype -lharfbuzz -lfribidi -lpng

--------------------------- [ANTICONF] --------------------------------

Configuration failed to find the harfbuzz freetype2 fribidi library. Try installing:

 * deb: libharfbuzz-dev libfribidi-dev (Debian, Ubuntu, etc)

 * rpm: harfbuzz-devel fribidi-devel (Fedora, EPEL)

 * csw: libharfbuzz_dev libfribidi_dev (Solaris)

 * brew: harfbuzz fribidi (OSX)

If harfbuzz freetype2 fribidi is already installed, check that 'pkg-config' is in your

PATH and PKG_CONFIG_PATH contains a harfbuzz freetype2 fribidi.pc file. If pkg-config

is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:

R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

-------------------------- [ERROR MESSAGE] ---------------------------

<stdin>:1:10: fatal error: hb-ft.h: No such file or directory

compilation terminated.

--------------------------------------------------------------------

ERROR: configuration failed for package ‘textshaping’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/textshaping’

Warning in install.packages :

  installation of package ‘textshaping’ had non-zero exit status

ERROR: dependency ‘textshaping’ is not available for package ‘ragg’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/ragg’

Warning in install.packages :

  installation of package ‘ragg’ had non-zero exit status

ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/pkgdown’

Warning in install.packages :

  installation of package ‘pkgdown’ had non-zero exit status

ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/devtools’

Warning in install.packages :

  installation of package ‘devtools’ had non-zero exit status


The downloaded source packages are in

‘/tmp/RtmpbqMThv/downloaded_packages’



* using staged installation

Package libtiff-4 was not found in the pkg-config search path.

Perhaps you should add the directory containing `libtiff-4.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libtiff-4' found

Package libtiff-4 was not found in the pkg-config search path.

Perhaps you should add the directory containing `libtiff-4.pc'

to the PKG_CONFIG_PATH environment variable

No package 'libtiff-4' found

Using PKG_CFLAGS=

Using PKG_LIBS=-lfreetype -lpng16 -ltiff -lz -ljpeg -lbz2

-----------------------------[ ANTICONF ]-------------------------------

Configuration failed to find one of freetype2 libpng libtiff-4. Try installing:

 * deb: libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev (Debian, Ubuntu, etc)

 * rpm: freetype-devel libpng-devel libtiff-devel libjpeg-turbo-devel (Fedora, CentOS, RHEL)

 * csw: libfreetype_dev libpng16_dev libtiff_dev libjpeg_dev (Solaris)

If freetype2 libpng libtiff-4 is already installed, check that 'pkg-config' is in your

PATH and PKG_CONFIG_PATH contains a freetype2 libpng libtiff-4.pc file. If pkg-config

is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:

R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'

-------------------------- [ERROR MESSAGE] ---------------------------

<stdin>:1:10: fatal error: ft2build.h: No such file or directory

compilation terminated.

--------------------------------------------------------------------

ERROR: configuration failed for package ‘ragg’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/ragg’

Warning in install.packages :

  installation of package ‘ragg’ had non-zero exit status

ERROR: dependency ‘ragg’ is not available for package ‘pkgdown’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/pkgdown’

Warning in install.packages :

  installation of package ‘pkgdown’ had non-zero exit status

ERROR: dependency ‘pkgdown’ is not available for package ‘devtools’

* removing ‘/home/ramadatta/R/x86_64-pc-linux-gnu-library/4.1/devtools’

Warning in install.packages :

  installation of package ‘devtools’ had non-zero exit status


The downloaded source packages are in

‘/tmp/RtmpmOvwEJ/downloaded_packages’

Needed to run these packages on Linux terminal:

sudo apt install build-essential libcurl4-gnutls-dev libxml2-dev libssl-dev

sudo apt-get -y build-dep libcurl4-gnutls-dev

sudo apt-get -y install libcurl4-gnutls-dev

sudo apt-get install libcurl4-openssl-dev libssl-dev

sudo apt install libharfbuzz-dev libfribidi-dev

sudo apt-get install libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev



Tuesday, November 29, 2022

Resolved- Error in scale.default: length of 'scale' must equal the number of columns of 'x'

I encountered the following error when running prcomp function in my shiny app:

Error in scale.default: length of 'scale' must equal the number of columns of 'x'

My command was:

prcomp(Annotated_Gene_PA_df_t, scale = pca_scale)

pca_scale was a radio button with code:

radioButtons("pca_scale", label = "Scale", inline = TRUE, choices = c("TRUE", "FALSE"), selected = "FALSE"),

When giving input as choices from the GUI, passing TRUE/FALSE will result in an error because they are passed in as strings meaning that they are passed with quotes "TRUE"/"FALSE" as in the above case. 

Whereas we need to pass TRUE or FALSE as boolean values - without any quotes.

The below command takes user input as true/false as 1/0 and then the next command converts it into a logical boolean value.

So I changed the above line in ui.R like this:

radioButtons("pca_scale", label = "Scale", inline = TRUE, choices = c("TRUE"=1, "FALSE"=0), selected = "FALSE")

and in the server.R, I changed input$pca_scale to :

as.logical(as.numeric(input$pca_scale))



Resolved - UnsatisfiableError: The following specifications were found to be incompatible with each other

I encountered an error creating a conda envrionment when following single cell best practices tutorial available at:

https://www.sc-best-practices.org/introduction/raw_data_processing.html#a-real-world-example  

Below is the issue:

conda create -n af_xmpl -y -c bioconda python=3.9 salmon alevin-fry pyroe

Collecting package metadata (current_repodata.json): done

Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.

Collecting package metadata (repodata.json): done

Solving environment: | 

Found conflicts! Looking for incompatible packages.

This can take several minutes.  Press CTRL-C to abort.

failed                                                                                                                                                      

UnsatisfiableError: The following specifications were found to be incompatible with each other:

Output in format: Requested package -> Available versions

Below commands did not work!

conda update --all --yes
conda config --set channel_priority flexible
conda config --set channel_priority false

conda create -n af_xmpl 
conda activate af_xmpl
conda install -c bioconda python=3.9 salmon alevin-fry pyroe

The following command worked when I added -c conda-forge

conda create -n af_xmpl 
conda activate af_xmpl
conda install -c conda-forge -c bioconda python=3.9 salmon alevin-fry pyroe

Friday, October 7, 2022

Resolved - dist function - NAs introduced by coercion

# Get euclidean dist

euclideanDist <- dist(simMatrix, method = "euclidean")

Warning message:

In dist(simMatrix, method = "euclidean") : NAs introduced by coercion


This is because the first column is factor. So, convert the 1st column into rownames which will take care of this error.

simMatrix <- simMatrix %>% tibble::column_to_rownames("Column1Header")

  # Get euclidean dist

  euclideanDist <- dist(simMatrix, method = "euclidean")

Now, no more error since all the columns in the matrix have only numerical values.