# HG changeset patch # User yhoogstrate # Date 1387469280 18000 # Node ID f7c90e81c05dc21ffdc2910a01485904412b1ed5 # Parent 9a92bd75ec9bf95992565fe57ccf006f2dacdb09 Uploaded diff -r 9a92bd75ec9b -r f7c90e81c05d FASTQ_replace_dots_for_N.py --- a/FASTQ_replace_dots_for_N.py Thu Dec 19 11:02:09 2013 -0500 +++ b/FASTQ_replace_dots_for_N.py Thu Dec 19 11:08:00 2013 -0500 @@ -3,10 +3,10 @@ import sys from Bio import Seq, SeqRecord, SeqIO -if(sys.argv[0] == ''): +if(len(sys.argv[0]) >= 2): input_stream = sys.stdin else: - input_stream = fh.open(sys.argv[0],"r") + input_stream = open(sys.argv[1],"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")