Skip to content
Snippets Groups Projects
Commit cfa01998 authored by Alexis Mergez's avatar Alexis Mergez
Browse files

Added support for compressed files

parent a64dd545
No related branches found
No related tags found
No related merge requests found
......@@ -15,6 +15,7 @@ import time
import pandas as pd
from functools import reduce
import concurrent.futures
import gzip
version = "0.3"
......@@ -71,8 +72,16 @@ start_time = time.time()
panname = os.path.basename(args.gfa).split('.gfa')[0]
## Reading the gfa into a list
with open(args.gfa, 'r') as file:
gfaLines = file.readlines()
# If not gzipped :
if args.gfa[-2:] != "gz" :
with open(args.gfa, 'r') as file:
gfaLines = file.readlines()
# If gzipped :
else :
with gzip.open(args.gfa, 'r') as file:
gfaLines = [line.decode() for line in file.readlines()]
## Initializing dictionnairies
genStats = { # General statistics
......
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