Liftoff icon indicating copy to clipboard operation
Liftoff copied to clipboard

bgzip error

Open marcovth opened this issue 2 years ago • 2 comments

Hello ...

Did bgzip change its code? Not sure what else I can do to get a LiftOff ...

` bgzip -i --threads 24 GCF_003668045.3_CriGri-PICRH-1.0_genomic.fna

liftoff -p 24 -db /scratch/marcovth/cho/GCF_003668045.3_CriGri-PICRH-1.0_genomic.gff.gz_db -o /scratch/marcovth/cho/CHOBRIv01.gff -u /scratch/marcovth/cho/CHOBRIv01_unmapped.gff -dir /scratch/marcovth/cho/liftoff /scratch/marcovth/cho/CHOBRIv01.singleLine.fasta /scratch/marcovth/cho/GCF_003668045.3_CriGri-PICRH-1.0_cds_from_genomic.fna.gz extracting features Traceback (most recent call last): File "/home/marcovth/conda/lib/python3.7/site-packages/pyfaidx/init.py", line 359, in init if mutable else 'rb') File "/home/marcovth/conda/lib/python3.7/site-packages/Bio/bgzf.py", line 244, in open return BgzfReader(filename, mode) File "/home/marcovth/conda/lib/python3.7/site-packages/Bio/bgzf.py", line 561, in init self._load_block(handle.tell()) File "/home/marcovth/conda/lib/python3.7/site-packages/Bio/bgzf.py", line 588, in _load_block block_size, self._buffer = _load_bgzf_block(handle, self._text) File "/home/marcovth/conda/lib/python3.7/site-packages/Bio/bgzf.py", line 422, in _load_bgzf_block % (_bgzf_magic, magic, handle.tell()) ValueError: A BGZF (e.g. a BAM file) block should start with b'\x1f\x8b\x08\x04', not b'\x1f\x8b\x08\x00'; handle.tell() now says 4

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/marcovth/conda/bin/liftoff", line 8, in sys.exit(main()) File "/home/marcovth/conda/lib/python3.7/site-packages/liftoff/run_liftoff.py", line 12, in main run_all_liftoff_steps(args) File "/home/marcovth/conda/lib/python3.7/site-packages/liftoff/run_liftoff.py", line 27, in run_all_liftoff_steps parent_features_to_lift) File "/home/marcovth/conda/lib/python3.7/site-packages/liftoff/liftover_types.py", line 13, in lift_original_annotation parents_to_lift, args) File "/home/marcovth/conda/lib/python3.7/site-packages/liftoff/extract_features.py", line 19, in extract_features_to_lift get_gene_sequences(feature_hierarchy.parents, ref_chroms, args, liftover_type) File "/home/marcovth/conda/lib/python3.7/site-packages/liftoff/extract_features.py", line 156, in get_gene_sequences fai = Fasta(args.reference) File "/home/marcovth/conda/lib/python3.7/site-packages/pyfaidx/init.py", line 999, in init build_index=build_index) File "/home/marcovth/conda/lib/python3.7/site-packages/pyfaidx/init.py", line 363, in init "Compressed FASTA is only supported in BGZF format. Use " pyfaidx.UnsupportedCompressionFormat: Compressed FASTA is only supported in BGZF format. Use the samtools bgzip utility (instead of gzip) to compress your FASTA.`

marcovth avatar Jun 09 '22 15:06 marcovth

I bgziped both reference and target fasta files with the same result.

marcovth avatar Jun 09 '22 15:06 marcovth

It seems to be working now. Both fasta's unzipped. It would be good to give a warning in the error message that's better not to use zipped files.

marcovth avatar Jun 09 '22 16:06 marcovth