agshumate/Liftoff

keyError: 'intersectin' when parsing alignments

hchen15-amgen opened this issue · 1 comments

Hi there,

Glad to find your tool!
I tried to use it and got an error for parsing the alignment. Could you please shed some lights on this? Please see the info below.

Many thanks in advance!

Best,
Hao

My command:

liftoff -g process/Human.B37.3.gtf
-o process/Human.B37.3.lifted.gff
-f data/liftoff.demo/features_to_map.txt
-dir process/liftoff.demo.tmpFiles
-chroms process/chrom.txt
-p 15
data/liftoff.demo/Human.B38.fasta data/liftoff.demo/Human.B37.3.fasta

The error msg:

[M::main] CMD: minimap2 -o process/liftoff.demo.tmpFiles/1_to_1.sam -a --end-bonus 5 --eqx -N 50 -p 0.5 -t 1 process/liftoff.demo.tmpFiles/1.fa.mmi process/liftoff.demo.tmpFiles/1_genes.fa
[M::main] Real time: 559.818 sec; CPU: 263.748 sec; Peak RSS: 4.460 GB
aligning features
Traceback (most recent call last):
File "/usr/local/environments/anaconda3/envs/id_map/bin/liftoff", line 8, in
sys.exit(main())
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/run_liftoff.py", line 12, in main
run_all_liftoff_steps(args)
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/run_liftoff.py", line 24, in run_all_liftoff_steps
feature_db, feature_hierarchy, ref_parent_order = liftover_types.lift_original_annotation(ref_chroms, target_chroms,
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/liftover_types.py", line 15, in lift_original_annotation
align_and_lift_features(ref_chroms, target_chroms, args, feature_hierarchy, liftover_type, unmapped_features,
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/liftover_types.py", line 23, in align_and_lift_features
aligned_segments= align_features.align_features_to_target(ref_chroms, target_chroms, args,
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/align_features.py", line 28, in align_features_to_target
return parse_all_sam_files(feature_hierarchy, unmapped_features, liftover_type, sam_files)
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/align_features.py", line 118, in parse_all_sam_files
aligned_segments = parse_alignment(file, feature_hierarchy, unmapped_features, liftover_type)
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/align_features.py", line 132, in parse_alignment
aln_id = add_alignment(ref_seq, align_count_dict, search_type, name_dict,aln_id, feature_hierarchy,
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/align_features.py", line 149, in add_alignment
aligned_blocks = get_aligned_blocks(ref_seq, aln_id, feature_hierarchy, search_type)
File "/usr/local/environments/anaconda3/envs/id_map/lib/python3.8/site-packages/liftoff/align_features.py", line 170, in get_aligned_blocks
parent = feature_hierarchy.parents[liftoff_utils.convert_id_to_original(alignment.query_name)]
KeyError: 'intersectin'

Update from my end. The error is originated from the input GFF file. Specifically, the "space character" in "gene_id" of the last column is the source of this problem. I replace the space with "_" and solved this problem.