LDBlockshow reports an error, Can’t locate SVG.pm

LDBlockShow installation error

image-20231110122323808
image-20231110122323808

After using conda to install LDBlockShow, the above error occurred during use, prompting "Can't locate SVG.pm in @INC xxx /bin/ShowLDSVG line 24". The reason for this error is the lack of the SVG module of the Perl language. This note provides a method to solve problems during the installation and use of LDBlockShow.

Install LDBlockshow using conda

image-20231110123107257
image-20231110123107257

In Linux systems, first use conda to create a new environment, then activate the environment and run the installation command.

conda install -c bioconda ldblockshow

## Package Plan ##

  environment location: /home/zhaojiwen/data_HD/miniconda3/envs/GWAS

  added / updated specs:
    - ldblockshow


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    ldblockshow-1.40           | pl5262h9a82719_0         105 KB  bioconda
    openssl-3.0.12             |       h7f8727e_0         5.2 MB  http://mirrors.aliyun.com/anaconda/pkgs/main
    perl-5.26.2                |    h36c2ea0_1008        15.4 MB  http://mirrors.aliyun.com/anaconda/cloud/conda-forge
    perl-svg-2.84              |          pl526_0          37 KB  bioconda
    ------------------------------------------------------------
                                           Total:        20.8 MB

The following NEW packages will be INSTALLED:

  ldblockshow        bioconda/linux-64::ldblockshow-1.40-pl5262h9a82719_0 
  perl               anaconda/cloud/conda-forge/linux-64::perl-5.26.2-h36c2ea0_1008 
  perl-svg           bioconda/linux-64::perl-svg-2.84-pl526_0 

The following packages will be UPDATED:

  openssl                                 3.0.11-h7f8727e_2 --> 3.0.12-h7f8727e_0 


Proceed ([y]/n)? 


Downloading and Extracting Packages
                                                                                                                        
Preparing transaction: done                                                                                             
Verifying transaction: done                                                                                             
Executing transaction: done   

After the installation is completed, you can query it with the following command. If the following content is displayed, the installation is successful.

$ LDBlockShow 

        Usage: LDBlockShow  -InVCF  <in.vcf.gz>  -OutPut <outPrefix>  -Region  chr1:10000-20000

                -InVCF        <str>      Input SNP VCF Format
                -OutPut       <str>      OutPut File of LD Blocks
                -Region       <str>      In One Region to show LD info svg Figure


                -SeleVar      <int>      Select statistic for deal. 1: D' 2: R^2 3/4:Both [1]
                -SubPop       <str>      SubGroup Sample File List[ALLsample]
                -BlockType    <int>      method to detect Block [beta] [1]
                                         1. Block by PLINK (Gabriel method)
                                         2. Solid Spine of LD RR/D'
 3. Blockcut with self-defined RR/D'
                                         4. FixBlock by input blocks files 5. No Block

                -InGWAS       <str>      InPut GWAS Pvalue File(chr site Pvalue)
                -InGFF        <str>      InPut GFF3 file to show Gene CDS and name

                -BlockCut     <float>    '
Strong LD' cutoff and ratio for BlockType3[0.85:0.90]
                -FixBlock     <str>      Input fixed block region
                -MerMinSNPNum <int>      merger color grids when SNPnumber over N[50]

                -help                    Show more Parameters and help [hewm2008 v1.40]

Encountered an error when using LDBlockShow

Just after the installation is completed, if you use it directly, you may get a "Can't locate SVG.pm in @INC" error. You need to use cpan to install the SVG module.

Install CPAN

If perl and cpan are not installed in the system, you need to install cpan first. The method is as follows:

  • For Debian/Ubuntu systems:
bashCopy code
sudo apt-get install cpanminus
  • For Red Hat/CentOS systems:
bashCopy code
sudo yum install perl-App-cpanminus

After the installation is complete, use CPAN to install the SVG module as follows:

First, open a terminal and run the following command:

cpan

Then in the CPAN prompt, enter the following command to install theSVG module:

install SVG

CPAN will download, compile and install the SVG module and its dependencies.

cp lib/SVG/DOM.pm blib/lib/SVG/DOM.pm
cp lib/SVG/Extension.pm blib/lib/SVG/Extension.pm
cp lib/SVG/XML.pm blib/lib/SVG/XML.pm
cp lib/SVG/Element.pm blib/lib/SVG/Element.pm
cp lib/SVG.pm blib/lib/SVG.pm

The following prompt message will appear during the process:

image-20231110124222481
image-20231110124222481

After the installation is successful, the following information is displayed:

image-20231110124257931
image-20231110124257931

If you use the LDBlockShow command again at this time, the error message just now will not appear and you can use it normally.

How to use LDBlockShow

The required input file is in vcf format. After having the input file, run the following code to draw the LD inverted triangle heat map.

LDBlockShow -InVCF file.vcf \
-OutPut re5 -Region 1:49670000:50680000\
-OutPng -SeleVar 1
image-20231110124607681
image-20231110124607681

If you have GWAS data results and want to add the significance of the SNP site (small Manhattan plot) on the inverted triangle and above, just use the -InGWAS parameter directly.

The required GWAS example results are as follows:

$ head gwas.pvalue
chr11 24142640 0.00009
chr11 24142660 1.02e-9
chr11 24142669 1e-9

The execution command is as follows:

LDBlockShow -InVCF Test.vcf.gz \
-OutPut re2 -Region \
chr11:24100000:24200000 \
-InGWAS gwas.pvalue \
-OutPng -SeleVar 1

The above is a simple example of using LDBlockshow. For more information, please check the official help document.

参考资料:
https://github.com/hewm2008/LDBlockShow/blob/main/LDBlockShow_Manual_Chinese.pdf
https://blog.csdn.net/yijiaobani/article/details/127498536
https://anaconda.org/bioconda/ldblockshow

This article is published by mdnice Multiple platforms

Guess you like

Origin blog.csdn.net/ZaoJewin/article/details/134334335