Skip to content
Snippets Groups Projects
Commit bec64eda authored by Veronique Legrand's avatar Veronique Legrand
Browse files

added gzip format support for genome

parent 293c946d
No related branches found
No related tags found
No related merge requests found
Pipeline #109541 failed
......@@ -304,7 +304,8 @@ def genomeFastaRecovery(filin, limit_reference, edge, host_test = 0):
if filin == "":
return "", "", ""
infile = open(filin, 'r')
#infile = open(filin, 'r')
infile = gzip.open(filin, "rt") if filin.endswith(".gz") else open(filin, 'r')
name = []
genome = []
genome_line = ""
......
......@@ -11,6 +11,7 @@ from __future__ import print_function
from time import gmtime, strftime
import sys
import gzip
from optparse import OptionParser, OptionGroup
from _modules.utilities import checkReportTitle,changeCase
from _modules.IData_handling import totReads,genomeFastaRecovery
......@@ -47,7 +48,7 @@ usage = """\n\nUsage: %prog -f reads.fastq -r phage_sequence.fasta [--report_tit
def checkFastaFile(filin):
"""Check sequence Fasta file given by user"""
first_line = 1
infil = open(filin, 'r')
infil = gzip.open(filin, "rt") if filin.endswith(".gz") else open(filin, 'r')
try:
for line in infil:
# Test '>'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment