Thanks for clarifying the source code. I entered the format as you suggest but still get an error.
feature = Feature()
feature.key = "CDS"
feature.location = "1..{}".format(len(row['DNA']))
feature.qualifiers = [
Qualifier("/translation=", "%s % row['Seq']"),
]
File "csv2gb_gbrecord.py", line 84, in main
Qualifier("/translation=", "%s % row['Seq']"),
TypeError: __init__() takes exactly 1 argument (3 given)
I'm still trying to understand the Qualifier class. I tried this approach but still can't get the Qualifier data into the feature object:
feature = Feature()
feature.key = "CDS"
feature.location = "1..{}".format(len(row['DNA']))
qualifier = Qualifier()
Qualifier.key = "/translation="
Qualifier.value = "{}".format(row['Seq'])
feature.qualifiers = [qualifier]
container.features.append(feature)
print (feature)
print (Qualifier.key, Qualifier.value)
print feature.qualifiers
There is no translation line in the Genbank file written by the script. The Qualifier attributes were read correctly, but not passed to the Feature method. The dot means "no data" for Genbank files. Here is the terminal output from the print statements.
CDS 1..375 .('/translation=', 'ERNDAYGHFIS')
[<bio.genbank.record.qualifier object="" at="" 0x7f3fb1f6a6d0="">]
Might be time to call in the experts @ Peter