MiraldiLab / maxATAC

Transcription Factor Binding Prediction from ATAC-seq and scATAC-seq with Deep Neural Networks
Apache License 2.0
25 stars 8 forks source link

Error on running prepare function - error while loading shared libraries: libncurses.so.5 #114

Closed timothykoala closed 1 year ago

timothykoala commented 1 year ago

Dear maxATAC developers,

I followed the install instructions and install it with conda on my Linux Ubuntu workstation, everything works well on installation but I faced difficulty on running maxATAC on prepare step. I double checked the path for my conda installation is in the ./opt/ directory and maybe I missed something on saving files or installation on correct directory? Thanks in advances.

maxatac prepare -i /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/o/Bowtie2/SRR14768461.bam -o /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac -prefix SRR14768461

[2023-02-06 06:37:16,281]
Input file: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/o/Bowtie2/SRR14768461.bam 
Input chromosome sizes file: /home/txpn/opt/maxatac/data/hg38/hg38.chrom.sizes 
Tn5 cut sites will be slopped 20 bps on each side 
Input blacklist file: /home/txpn/opt/maxatac/data/hg38/hg38_maxatac_blacklist.bw 
Output filename: SRR14768461 
Output directory: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac 
Using a millions factor of: 20000000 
Using 36 threads to run job.
[2023-02-06 06:37:16,281]
Generate the normalized signal tracks.
[2023-02-06 06:37:16,281]
Working on a bulk ATAC-seq BAM file 
Getting the number of reads in the BAM file
There are 52535910 reads in the file
[2023-02-06 06:37:34,475]
Processing BAM to bigwig. Running eduplication
Inputs:
BAM: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/o/Bowtie2/SRR14768461.bam
Sample name: SRR14768461
Cores: 36
Chr Keep: chr1 chr2 chr3 chr4 chr5 chr6 chr7 chr8 chr9 chr10 chr11 chr12 chr13 chr14 chr15 chr16 chr17 chr18 chr19 chr20 chr21 chr22
Blacklist: /home/txpn/opt/maxatac/data/hg38/hg38_maxatac_blacklist.bed
Chr Sizes: /home/txpn/opt/maxatac/data/hg38/hg38.chrom.sizes
Slop Size: 20
Scale factor: 0.38069198763284007
Create working directory: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac
Filtering with Samtools
Samtools sort reads by name for /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/o/Bowtie2/SRR14768461.bam
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
Samtools fixmate on SRR14768461_filtered.bam
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
rm: cannot remove 'SRR14768461_filtered.bam': No such file or directory
Remove duplicates from SRR14768461_fixmate.bam
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
rm: cannot remove 'SRR14768461_fixmate.bam': No such file or directory
rm: cannot remove 'SRR14768461_fixmate.bam.bai': No such file or directory
Remove unwanted chr from SRR14768461_deduped.bam
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
samtools: error while loading shared libraries: libncurses.so.5: cannot open shared object file: No such file or directory
rm: cannot remove 'SRR14768461_deduped.bam': No such file or directory
rm: cannot remove 'SRR14768461_deduped.bam.bai': No such file or directory
[E::hts_open_format_impl] Failed to open file SRR14768461_final.bam
Failed to open BAM file SRR14768461_final.bam
Scale factor:  0.38069198763284007
Using Bedtools to convert BAM to bedgraph
Using bedGraphToBigWig to convert bedgraph to bigwig
bedGraphToBigWig: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
Done!
[2023-02-06 06:37:45,407]
Min-max normalize signal tracks
[2023-02-06 06:37:45,407]
Normalization
  Input bigwig file: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac/SRR14768461_IS_slop20_RP20M.bw
  Output filename: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac/SRR14768461_IS_slop20_RP20M_minmax01.bw
  Output directory: /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac
  Using min-max normalization
[2023-02-06 06:37:45,412]
Calculating stats per chromosome
[urlOpen] Couldn't open /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac/SRR14768461_IS_slop20_RP20M.bw for reading
[urlOpen] Couldn't open /media/txpn/My_Book_Duo/Timothy/20220929_ATACseq/maxatac/SRR14768461_IS_slop20_RP20M.bw for reading
[pyBwOpen] bw is NULL!
Traceback (most recent call last):
  File "/home/txpn/anaconda3/envs/maxatac/bin/maxatac", line 24, in <module>
    sys.exit(main(sys.argv[1:]))
  File "/home/txpn/anaconda3/envs/maxatac/bin/maxatac", line 20, in main
    args.func(args)
  File "/home/txpn/anaconda3/envs/maxatac/lib/python3.9/site-packages/maxatac/analyses/prepare.py", line 142, in run_prepare
    run_normalization(args)
  File "/home/txpn/anaconda3/envs/maxatac/lib/python3.9/site-packages/maxatac/analyses/normalize.py", line 64, in run_normalization
    min_value, max_value, median, mad, mean_value, std_value = get_genomic_stats(bigwig_path=args.signal,
  File "/home/txpn/anaconda3/envs/maxatac/lib/python3.9/site-packages/maxatac/utilities/normalization_tools.py", line 24, in get_genomic_stats
    with pyBigWig.open(bigwig_path) as input_bigwig:
RuntimeError: Received an error during file opening!
tacazares commented 1 year ago

Hey, Try out some of these approaches to see if they fix your issue. I had the same error and it was because bedgraphtobigwg could not be found.

https://github.com/MiraldiLab/maxATAC/issues/102

Good luck, Tareian

timothykoala commented 1 year ago

Thanks, It works for me now by reinstall libncurses-dev. Got a similar error later on loading shared libraries: libssl.so.1.0.0 on bedGraphToBigWig

For the bedGraphToBigWig dependency on libssl.so.1.0.0 and libcrypto.so.1.0.0 is present by default.

However, these libraries are updated in Ubuntu 20.04.4 to libssl.so.1.1 and libcrypt.so.1.1.0 Workaround suscessfully by

$ conda remove ucsc-bedgraphtobigwig
$ locate libssl.so.1.1
$ ln -s /<path_to_libssl>/libssl.so.1.1 /<path_to_libssl>/libssl.so.1.0.0
$ locate libcrypt.so.1.1.0
$ ln -s /<path_to_libcrypto>/libcrypt.so.1.1.0 /<path_to_libcrypto>/libcrypto.so.1.0.0

$ conda install ucsc-bedgraphtobigwig
$ ldd /opt/miniconda3/pkgs/ucsc-bedgraphtobigwig-357-0/bin/bedGraphToBigWig
    linux-vdso.so.1 (0x00007ffc9d7d8000)
    libmysqlclient.so.18 => not found
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f6a5fe64000)
    libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6a5fd15000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6a5fd0b000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6a5fd05000)
    libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f6a5fb21000)
    libssl.so.1.0.0 => /lib/x86_64-linux-gnu/libssl.so.1.0.0 (0x00007f6a5fa8e000)
    libcrypto.so.1.0.0 => /lib/x86_64-linux-gnu/libcrypto.so.1.0.0 (0x00007f6a5fa53000)
    libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f6a5fa1b000)
    libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6a5f9ff000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6a5f80d000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f6a5fe9a000)
    libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f6a5f7f0000)
    libcrypto.so.1.1 => /lib/x86_64-linux-gnu/libcrypto.so.1.1 (0x00007f6a5f51a000)