Thanks this works. I am trying to modify the seqrecord.id by appending the corresponding id to it after an underscore. Example the read id in the fastq file should look like
@M00770:337:000000000-AN0WE:1:2105:12937:3123 1:N:0:0CGTTACACAATCC_ACTTTTTTTT
I want to know what I should modify in the above code? My current code is
id_array = []
for read_record in SeqIO.parse("in.fastq", "fastq"):
if [item for item in searchlist if read_record.seq.count(item)]:
print >> read1_out_handle, read_record.format("fastq")
id_array.appendread_record.id)
I want to modify read_record.id before it gets appended to id_array.
using simple grep you can extract.
text_file should have all your 10bp sequences one per line. if you want to separate reads for every pattern,