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