Skip to content

Commit

Permalink
Add support from writing bigWig files with pybigtools instead of pyBi…
Browse files Browse the repository at this point in the history
…gWig.

Add support from writing bigWig files with pybigtools instead of pyBigWig.
  • Loading branch information
ghuls committed Jan 31, 2024
1 parent 28ca0f8 commit 39c9349
Show file tree
Hide file tree
Showing 3 changed files with 274 additions and 57 deletions.
3 changes: 2 additions & 1 deletion src/scatac_fragment_tools/cli/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ def command_fragment_to_bigwigs(args):
args.normalize,
args.scaling_factor,
args.cut_sites,
args.verbose
args.bigwig_writer,
args.verbose,
)

def command_split_fragments_by_cell_type(args):
Expand Down
11 changes: 11 additions & 0 deletions src/scatac_fragment_tools/cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
_OPTIONAL_ARGUMENTS_NAME = "Optional arguments"
_FORMATTER_CLASS = RichHelpFormatter


class SubparserBuilder:
"""
Helper class for building subparsers.
Expand Down Expand Up @@ -118,6 +119,16 @@ def add_fragments_to_bigwig_subparser(
help="Use 1 bp Tn5 cut sites (start and end of each fragment) instead of whole "
"fragment length for coverage calculation.",
)
parser.add_optional_argument(
"-w",
"--writer",
dest="bigwig_writer",
action="store",
type=str.lower,
choices=["pybigtools", "pybigwig"],
default="pybigwig",
help="Which bigWig writer implementation to use.",
)
parser.add_optional_argument(
"--chrom-prefix",
dest="chrom_prefix",
Expand Down
Loading

0 comments on commit 39c9349

Please sign in to comment.