rki-mf1 / covsonar

A database-driven system for handling genomic sequences of SARS-CoV-2 and screening genomic profiles.
GNU General Public License v3.0
6 stars 0 forks source link

CovSonar fails when reference gff includes features from reverse strand #20

Closed silenus092 closed 1 year ago

silenus092 commented 2 years ago

In GitLab by @beslicd on Dec 7, 2021, 11:29

Covsonar throws error, when I try to use a different reference file, which includes features from the reverse strand:

 File "covsonar/lib/sonardb.py", line 713, in process_gff3
seqs.append(str(Seq.reverse_complement(gseq[s:e])))
  File ".conda/envs/covsonar/lib/python3.9/site-packages/Bio/Seq.py", line 825, in reverse_complement
    return self.complement()[::-1]
AttributeError: 'str' object has no attribute 'complement'

Could be solved by changing:

line 713 to:

seqs.append(str(Seq.reverse_complement((Seq(gseq[s:e])))))

line 1139-1140 to:

query=query+str(Seq.reverse_complement(Seq(query)))
target=target+str(Seq.reverse_complement(Seq(target)))