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

Key Error in sswobj.py #10

Open
MAldBio opened this issue Dec 17, 2021 · 0 comments
Open

Key Error in sswobj.py #10

MAldBio opened this issue Dec 17, 2021 · 0 comments

Comments

@MAldBio
Copy link

MAldBio commented Dec 17, 2021

I am using a program (Bamsplit) that relies on ssw to run, and get the following SSW error:

File "[...]/bamsplit-master/bamsplit.py", line 266, in <module>
    main(parsed)
  File "[...]/bamsplit-master/bamsplit.py", line 235, in main
    run_bamsplit(ref, bam_in, vcf, vcf.header.samples[0], bams_out, bed_out, region)
  File "[...]Software/bamsplit-master/bamsplit.py", line 225, in run_bamsplit
    split_contig(contig, ref, bam_in, vcf, sample, bams_out, bed_out)
  File "[...]/Software/bamsplit-master/bamsplit.py", line 211, in split_contig
    last_read = split(phased_sites, ref, bam_iter, sample, bams_out, bed_out, last_read)
  File "[...]/Software/bamsplit-master/bamsplit.py", line 194, in split
    scores = calculate_alignment_scores(read.query_sequence, genotype)
  File "[...]/Software/bamsplit-master/bamsplit.py", line 159, in calculate_alignment_scores
    return [calculate_alignment_score(read, haplotype) for haplotype in genotype]
  File "[...]/Software/bamsplit-master/bamsplit.py", line 159, in <listcomp>
    return [calculate_alignment_score(read, haplotype) for haplotype in genotype]
  File "[...]/Software/bamsplit-master/bamsplit.py", line 155, in calculate_alignment_score
    alignment = aligner.align(reference=haplotype, query=read)
  File "[...]/.local/lib/python3.7/site-packages/ssw-0.3.1-py3.7-linux-x86_64.egg/ssw/sswobj.py", line 99, in align
    res = self._align(query, reference, flags, filter_score, filter_distance, mask_length)
  File "[...].local/lib/python3.7/site-packages/ssw-0.3.1-py3.7-linux-x86_64.egg/ssw/sswobj.py", line 109, in _align
    _reference = self.matrix.convert_sequence_to_ints(reference)
  File "[...]/.local/lib/python3.7/site-packages/ssw-0.3.1-py3.7-linux-x86_64.egg/ssw/sswobj.py", line 64, in convert_sequence_to_ints
    return _seq_type(*seq_generator)
  File "[...]/.local/lib/python3.7/site-packages/ssw-0.3.1-py3.7-linux-x86_64.egg/ssw/sswobj.py", line 63, in <genexpr>
    seq_generator = (self.symbol_map[symbol.upper()] for symbol in seq)
KeyError: '<'

I thought it might be a problem with "<" not being able to run through "symbol.upper()", so I attempted to manually remove all ".upper()" commands, in the sswobj.py file, but that was unable to correct the problem. Any idea on what what the issue is?

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