Entering edit mode
5.9 years ago
andermachon
•
0
HI. I try to make complement fastq file using this code:
from Bio import SeqIO
seq_=[]
with open("pass/to/input/file.fastq") as handle:
for i in SeqIO.parse(handle,"fastq"):
a =i.seq.complement()
seq_.append(a)
SeqIO.write(seq_, "pass/to/output/file.fastq", "fastq")
Trying this I get error:
Traceback (most recent call last):
File "/home/andrey/PycharmProjects/python_bio/2.py", line 7, in <module>
SeqIO.write(seq_, "/home/andrey/genes/2.fastq", "fastq")
File "/home/andrey/PycharmProjects/python_bio/venv/lib/python3.5/site-packages/Bio/SeqIO/__init__.py", line 497, in write
count = writer_class(fp).write_file(sequences)
File "/home/andrey/PycharmProjects/python_bio/venv/lib/python3.5/site-packages/Bio/SeqIO/Interfaces.py", line 215, in write_file
count = self.write_records(records)
File "/home/andrey/PycharmProjects/python_bio/venv/lib/python3.5/site-packages/Bio/SeqIO/Interfaces.py", line 200, in write_records
self.write_record(record)
File "/home/andrey/PycharmProjects/python_bio/venv/lib/python3.5/site-packages/Bio/SeqIO/QualityIO.py", line 1428, in write_record
if record.seq is None:
AttributeError: 'Seq' object has no attribute 'seq'
In my opinion i did not add id to fastq file
hope for your help)
I was wondering whether there is a command-line-only-way to produce the reverse complement of a fastq file. And there is:
BTW: Why do you want to produce a reverse complement of a fastq file?
fin swimmer