Closed mertz1611 closed 1 year ago
I had the same issue. Strangely enough only when using edlib backend. Apparently the function get_primers
in the seq_utils
script uses the function readfq
function used to read the fastq files and perform quality filter computations. What happens is that it tries to extract quality scores (fx.get_quality_array()
) from fasta primer sequences, and of course there is no quality score which returns 'NoneType' for that object. My workaround, probably not the most elegant but works, was to rewrite the get_primers function (line 125 in seq_utils
) from:
def get_primers(primers):
"Load primers from fasta file"
all_primers = {}
for primer in readfq(primers):
all_primers[primer.Name] = primer.Seq
all_primers['-' + primer.Name] = reverse_complement(primer.Seq)
return all_primers
to:
def get_primers(primers):
"Load primers from fasta file"
all_primers = {}
with FastxFile(primers) as fh:
for primer in fh:
all_primers[primer.name] = primer.sequence
all_primers['-' + primer.name] = reverse_complement(primer.sequence)
print(all_primers)
return all_primers
I'm also printing the primer sequences which I found a nice confirmation of the primers being used.
Hi @mertz1611 and @brunaeus
I'm sorry that you are having problems with Pychopper. Thanks for raising this issue. I'l take a look at this ASAP.
Hi @mertz1611 @brunaeus
Please could you try v2.7.8. This release should have fixed your issues.
Closing due to lack of response
I freshly installed pychopper with conda a few days ago, but started getting an error with input that worked previously. I saw in the error message the readfq function and realized it's opening primers.fa and expecting fastq format. I worked around it by editing my primers.fa to fastq format.