XiaoTaoWang / HiCLift

A fast and efficient tool for converting chromatin interaction data between genome assemblies
Other
64 stars 5 forks source link

liftover error from mm9 to mm10 #18

Closed YuhePei closed 4 months ago

YuhePei commented 6 months ago

Hi, XiaoTao, I'm trying to liftover a .cool file from mm9 to mm10, but when I use 'HiCLift' or 'pairLiftOver', I met this error (same error): HiCLift --input GSM2644945_mm9_mesc_100000.cool --input-format cooler --out-pre GSM2644945_mm10_mesc_100000 --output-format hic --out-chromsizes ~/reference/GRCm38/GRCm38_STAR_index/chrNameLength.txt --in-assembly mm9 --out-assembly mm10 --logFile HiCLift.log

root                      INFO    @ 04/24/24 20:07:19: 
# ARGUMENT LIST:
# Input path = GSM2644945_mm9_mesc_100000.cool
# Input format = cooler
# Output prefix = GSM2644945_mm10_mesc_100000
# Output format = hic
# Chromosome Sizes of the output assembly = /home/adminpku/paired-tag/reference/GRCm38/GRCm38_STAR_index/chrNameLength.txt
# Generate contact maps at 11 resolutions = False
# Input assembly = mm9
# Output assembly = mm10
# Chain file = None
# Temporary Dir = .HiCLift
# Allocated memory = 8G
# Number of Processes = 8
# Log file name = HiCLift.log
HiCLift.utilities         INFO    @ 04/24/24 20:07:19: Writing headers ...
HiCLift.utilities         INFO    @ 04/24/24 20:07:20: Converting, sorting, and compressing ...
couldn't execute compress program: errno 2
Traceback (most recent call last):
  File "/home/adminpku/anaconda3/envs/hic/lib/python3.7/site-packages/HiCLift/utilities.py", line 185, in liftover
    mapped_count)
  File "/home/adminpku/anaconda3/envs/hic/lib/python3.7/site-packages/HiCLift/io.py", line 210, in _pixel_to_reads
    outstream.write('\t'.join(cols) + '\n')
BrokenPipeError: [Errno 32] Broken pipe

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/adminpku/anaconda3/envs/hic/bin/HiCLift", line 137, in <module>
    run()
  File "/home/adminpku/anaconda3/envs/hic/bin/HiCLift", line 133, in run
    high_res = args.high_res
  File "/home/adminpku/anaconda3/envs/hic/lib/python3.7/site-packages/HiCLift/utilities.py", line 196, in liftover
    process.communicate()
  File "/home/adminpku/anaconda3/envs/hic/lib/python3.7/subprocess.py", line 854, in __exit__
    self.stdin.close()
BrokenPipeError: [Errno 32] Broken pipe

I'm confused, is this because of my space? any help would be grateful.

XiaoTaoWang commented 4 months ago

Hi, as I have never seen a similar error message before, is it possible for you to share the cool file that produced this error on your end?

XiaoTaoWang commented 4 months ago

Could you also share the "chrNameLength.txt" file specified in your command? I need to reproduce the error to understand what happened.

AayushGrover commented 4 months ago

Hello. I am facing a similar issue when converting a hic file from hg19 to hg38. Specifically, I run the following command: HiCLift --input ./GSE201353_LIMA_THP1_WT_LPIF_0000_S_0.0.0_megaMap_inter.hic --input-format juicer --out-pre hg38 --output-format hic --out-chromsizes hg38.chrom.sizes --memory 50G --chain-file hg19ToHg38.over.chain.gz --nproc 16

The input hic file can be downloaded from GEO - GSE201353. The chromosome length file is used from UCSC.

Below is the error message:

root                      INFO    @ 06/17/24 09:51:08: 
# ARGUMENT LIST:
# Input path = ./GSE201353_LIMA_THP1_WT_LPIF_0000_S_0.0.0_megaMap_inter.hic
# Input format = juicer
# Output prefix = hg38
# Output format = hic
# Chromosome Sizes of the output assembly = hg38.chrom.sizes
# Generate contact maps at 11 resolutions = False
# Input assembly = hg19
# Output assembly = hg38
# Chain file = hg19ToHg38.over.chain.gz
# Temporary Dir = .HiCLift
# Allocated memory = 50G
# Number of Processes = 16
# Log file name = HiCLift.log
HiCLift.utilities         INFO    @ 06/17/24 09:51:09: Writing headers ...
HiCLift.utilities         INFO    @ 06/17/24 09:51:09: Converting, sorting, and compressing ...
couldn't execute compress program: errno 2
Traceback (most recent call last):
  File "/local/home/agrover/anaconda3/envs/test/bin/HiCLift", line 137, in <module>
    run()
  File "/local/home/agrover/anaconda3/envs/test/bin/HiCLift", line 133, in run
    high_res = args.high_res
  File "/local/home/agrover/anaconda3/envs/test/lib/python3.6/site-packages/HiCLift/utilities.py", line 186, in liftover
    mapped_count)
  File "/local/home/agrover/anaconda3/envs/test/lib/python3.6/site-packages/HiCLift/io.py", line 211, in _pixel_to_reads
    outstream.write('\t'.join(cols) + '\n')
BrokenPipeError: [Errno 32] Broken pipe

Thank you in advance!

YuhePei commented 4 months ago

Hi, as I have never seen a similar error message before, is it possible for you to share the cool file that produced this error on your end?

Oh, thanks for your reply. I simply created a new conda environment with python version 3.7 and this error was fixed. I think it maybe cause by some enviromnet confilcts......

XiaoTaoWang commented 4 months ago

@AayushGrover I think some dependencies may not have been installed properly on your end. I tested the same .hic file, but no error occurred. Please see the log message below:

# ARGUMENT LIST:
# Input path = GSE201353_LIMA_THP1_WT_LPIF_0000_S_0.0.0_megaMap_inter.hic
# Input format = juicer
# Output prefix = test
# Output format = cool
# Chromosome Sizes of the output assembly = hg38.chrom.sizes
# Generate contact maps at 11 resolutions = False
# Input assembly = hg19
# Output assembly = hg38
# Chain file = None
# Temporary Dir = .HiCLift
# Allocated memory = 32G
# Number of Processes = 8
# Log file name = HiCLift.log
numexpr.utils             INFO    @ 06/19/24 08:58:11: Note: detected 112 virtual cores but NumExpr set to maximum of 64, check "NUMEXPR_MAX_THREADS" environment variable.
numexpr.utils             INFO    @ 06/19/24 08:58:11: Note: NumExpr detected 112 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.
numexpr.utils             INFO    @ 06/19/24 08:58:11: NumExpr defaulting to 8 threads.
HiCLift.utilities         INFO    @ 06/19/24 08:58:11: Writing headers ...
HiCLift.utilities         INFO    @ 06/19/24 08:58:11: Converting, sorting, and compressing ...
HiCLift.utilities         INFO    @ 06/19/24 15:22:05: 2,672,059,305 / 2,673,496,519 pairs were uniquely mapped to the target genome
HiCLift.utilities         INFO    @ 06/19/24 15:32:56: Generate contact matrix using cooler at 2500000,1000000,500000,250000,100000,50000,25000,10000,5000 ...
HiCLift.utilities         INFO    @ 06/19/24 17:33:04: Done
XiaoTaoWang commented 4 months ago

@YuhePei Thanks for your feedback!

AayushGrover commented 4 months ago

@XiaoTaoWang you're right. I reinstalled the packages in a new conda environment and things seem to work. Thanks for your prompt reply.