Created
May 6, 2014 18:53
-
-
Save mdshw5/c7cf7a232b27de0d4b31 to your computer and use it in GitHub Desktop.
Biostars #99889
This file contains hidden or 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
""" | |
Convert FASTA to FASTQ file with a static | |
Usage: | |
$ ./fasta_to_fastq NAME.fasta NAME.fastq | |
""" | |
import sys, os | |
from Bio import SeqIO | |
# Get inputs | |
fa_path = sys.argv[1] | |
fq_path = sys.argv[2] | |
# make fastq | |
with open(fa_path, "r") as fasta, open(fq_path, "w") as fastq: | |
for record in SeqIO.parse(fasta, "fasta"): | |
record.letter_annotations["phred_quality"] = [40] * len(record) | |
SeqIO.write(record, fastq, "fastq") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment