icebert / eccDNA_RCA_nanopore

eccDNA identification from nanopore long reads of rolling-circle amplicon
MIT License
5 stars 4 forks source link

some problems when running #3

Open panxiaoguang opened 2 years ago

panxiaoguang commented 2 years ago
Traceback (most recent call last):
  File "./software/eccDNA_RCA_nanopore/eccDNA_RCA_nanopore.py", line 577, in <module>
    cs = ConsensusSequence(fastq, genome, read).callConsensus()
  File "./software/eccDNA_RCA_nanopore/eccDNA_RCA_nanopore.py", line 525, in callConsensus
    consensus[i].align(seq, readInterval, refInterval, frag.cigar)
  File "./software/eccDNA_RCA_nanopore/eccDNA_RCA_nanopore.py", line 440, in align
    self.sequence[ref_cur-1].insert(seq[read_cur:read_cur+step])
  File "./software/eccDNA_RCA_nanopore/eccDNA_RCA_nanopore.py", line 381, in insert
    self.nt[self.last] -= 1
KeyError: ''

Hi, I met an error like this, do you know why ?

panxiaoguang commented 2 years ago

I find the reson, in the line440, sometimes self.sequence[ref_cur-1].nt would be an empty dict.? I don't know why?

icebert commented 2 years ago

This may be due to the malformed CIGAR string. Line 440 deals with 'I' (insertion), which should not be in the first place a CIGAR string. You can check whether in your input file some CIGAR strings begin with 'I'.

panxiaoguang commented 2 years ago

This may be due to the malformed CIGAR string. Line 440 deals with 'I' (insertion), which should not be in the first place a CIGAR string. You can check whether in your input file some CIGAR strings begin with 'I'.

I found you din't use --eqx when you use minimap2 to align nanopore reads, so your cigar string will not contain "=", But the cg tag in my PAF file both have = and x , so your code will not deal with "=" ?

icebert commented 2 years ago

Yes, no need to use --eqx in minimap2. 'M' includes both '=' and 'x'.