This repository has been archived by the owner. It is now read-only.
Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
thesis_tm/fq_to_fa.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
23 lines (18 sloc)
588 Bytes
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
# this works on art_illumina fq output file | |
# I needed to convert them to fa to run the superbubble performance tool | |
import sys | |
import os | |
if len(sys.argv) != 3: | |
print("Please give two arguments [input_file_name] [output_file_name]") | |
fastq_f = open(sys.argv[1], "r") | |
lines = fastq_f.readlines() | |
fasta_output = [] | |
for idx, l in enumerate(lines): | |
if l.startswith("@"): | |
l = ">" + l | |
fasta_output.append(l) | |
fasta_output.append(lines[idx+1]) | |
output_f_name = str(sys.argv[2]) | |
fasta_f = open(output_f_name, "w") | |
for l in fasta_output: | |
fasta_f.write(l) |