Created
March 22, 2018 01:16
-
-
Save mdshw5/5cb686a027f805eada61b2b521ab3f13 to your computer and use it in GitHub Desktop.
biostars 305027
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from simplesam import Reader | |
with Reader(open("input.sam")) as sam, open("output.fastq", "w") as fastq: | |
for read in sam: | |
fastq.write("@%s\n" % read.qname) | |
fastq.write("%s\n" % read.seq) | |
fastq.write("+\n") | |
fastq.write("%s\n" % read.qual) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment