# HG changeset patch # User yhoogstrate # Date 1387468411 18000 # Node ID f2939b8fb2e1344239cdf5949a662496475b6057 Uploaded diff -r 000000000000 -r f2939b8fb2e1 FASTQ_replace_dots_for_N.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/FASTQ_replace_dots_for_N.py Thu Dec 19 10:53:31 2013 -0500 @@ -0,0 +1,12 @@ +#!/usr/bin/env python + +import sys +from Bio import Seq, SeqRecord, SeqIO + +if(sys.argv[0] == ''): + input_stream = sys.stdin +else: + input_stream = fh.open(sys.argv[0],"r") + +for record in SeqIO.parse(input_stream,"fastq-sanger"): + SeqIO.write(SeqRecord.SeqRecord(seq=Seq.Seq(str(record.seq).replace(".","N")),letter_annotations=record.letter_annotations,id=record.id,name=record.name,description=record.description),sys.stdout,"fastq-sanger")