From 683c3d94b5e491a3107029df854b1624fe500f4e Mon Sep 17 00:00:00 2001 From: Haibao Tang Date: Wed, 24 Jul 2024 19:30:46 +0800 Subject: [PATCH] Fix None path (thanks @jailynai, #693) --- jcvi/assembly/hic.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/jcvi/assembly/hic.py b/jcvi/assembly/hic.py index f4392b88..0547ae15 100644 --- a/jcvi/assembly/hic.py +++ b/jcvi/assembly/hic.py @@ -945,7 +945,6 @@ def bam2mat(args): ) p.add_argument( "--seqids", - default=None, help="Use a given seqids file, a single line with seqids joined by comma", ) opts, args = p.parse_args(args) @@ -959,9 +958,10 @@ def bam2mat(args): pf += f".resolution_{N}" bins = 1500 # Distance distribution bins minsize = 100 # Record distance if it is at least minsize + seqids = opts.seqids seqids = ( - open(opts.seqids).readline().strip().split(",") - if op.exists(opts.seqids) + open(seqids).readline().strip().split(",") + if seqids and op.exists(seqids) else None )