Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyError: 'RG' #126

Open
karen916 opened this issue Oct 11, 2023 · 0 comments
Open

KeyError: 'RG' #126

karen916 opened this issue Oct 11, 2023 · 0 comments

Comments

@karen916
Copy link

Dear svtyper creative team:
I have a little trouble using the software and would like to ask for your help. I always encounter the prompt that the RG field is missing in the bam file. Is there any way to solve it?
(lumpy_env) [chenzhaojin@lfpara test1010]$ svtyper \

-B merge_1-10_1-30.bam \
-l my.bam.json

Warning: VCF not found.
Traceback (most recent call last):
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/bin/svtyper", line 11, in
load_entry_point('svtyper==0.7.0', 'console_scripts', 'svtyper')()
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/classic.py", line 575, in cli
sys.exit(main())
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/classic.py", line 568, in main
args.max_ci_dist)
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/classic.py", line 150, in sv_genotype
sample = Sample.from_bam(bam_list[i], num_samp, min_lib_prevalence)
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/parsers.py", line 665, in from_bam
name = bam.header['RG'][0]['SM']
File "pysam/libcalignmentfile.pyx", line 548, in pysam.libcalignmentfile.AlignmentHeader.getitem
KeyError: 'RG'
This still happens when I try the svtyper-sso module,(lumpy_env) [chenzhaojin@lfpara test1010]$ svtyper-sso \

--core 48 \
--batch_size 1000 \
--max_reads 1000 \
-i merged_all_results.vcf \
-B merge_1-10_1-30.bam \
> sv.gt.vcf

Traceback (most recent call last):
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/bin/svtyper-sso", line 11, in
load_entry_point('svtyper==0.7.0', 'console_scripts', 'svtyper-sso')()
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/singlesample.py", line 848, in cli
sys.exit(main())
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/singlesample.py", line 841, in main
args.batch_size)
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/singlesample.py", line 788, in sso_genotype
sample = setup_sample(full_bam_path, lib_info_path, ref_fasta, num_samp, min_aligned)
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/singlesample.py", line 79, in setup_sample
sample = Sample.from_bam(fd, sampling_number, min_lib_prevalence)
File "/home/chenzhaojin/anaconda3/envs/lumpy_env/lib/python2.7/site-packages/svtyper/parsers.py", line 665, in from_bam
name = bam.header['RG'][0]['SM']
File "pysam/libcalignmentfile.pyx", line 548, in pysam.libcalignmentfile.AlignmentHeader.getitem
KeyError: 'RG'

I would appreciate any assistance or guidance you can provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant