I have a parsed fastq file, and I am doing some operations with the reads. Concretely, I am trying to determine if my fastq files have reads that belong to a microorganism contamination, instead of my human sample. So, if my read is a contamination, I need to remove it from my fastq file in order to have only the reads that belong to the human sample. I tried this;
for record_seq in SeqIO.parse("file.fastq","fastq"):
if condition==T:
record_seq=""
But with this code i wasnt deleting my record, cause i had the same records counts in the final file.
So i thinked about the method pop , but i can not use it due to it is only for lists, and record_seq is a SeqRecord object... any ideas? Thanks!