Skip to content

Commit

Permalink
fix: remove the option to override the default tab output delimiter (#12
Browse files Browse the repository at this point in the history
)

BREAKING CHANGE: This removes the `--delimiter` commandline arg
  • Loading branch information
a-frantz authored Mar 11, 2021
1 parent c94218b commit fbe382d
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 22 deletions.
12 changes: 0 additions & 12 deletions ngsderive/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,6 @@ class SaneFormatter(
help="Write to filename rather than standard out.",
default="stdout",
)
common.add_argument(
"--delimiter", default="<tab>", help="Delimiter for the outfile."
)
common.add_argument(
"--debug", default=False, action="store_true", help="Enable DEBUG log level."
)
Expand Down Expand Up @@ -264,10 +261,6 @@ def process_args(args):
else:
args.outfile = open(args.outfile, "w")

# set delimiter
if args.delimiter == "<tab>":
args.delimiter = "\t"


def run():
args = get_args()
Expand All @@ -277,23 +270,20 @@ def run():
readlen.main(
args.ngsfiles,
outfile=args.outfile,
delimiter=args.delimiter,
n_samples=args.n_samples,
majority_vote_cutoff=args.majority_vote_cutoff,
)
if args.subcommand == "instrument":
instrument.main(
args.ngsfiles,
outfile=args.outfile,
delimiter=args.delimiter,
n_samples=args.n_samples,
)
if args.subcommand == "strandedness":
strandedness.main(
args.ngsfiles,
args.gene_model,
outfile=args.outfile,
delimiter=args.delimiter,
n_genes=args.n_genes,
minimum_reads_per_gene=args.minimum_reads_per_gene,
only_protein_coding_genes=args.only_protein_coding_genes,
Expand All @@ -305,15 +295,13 @@ def run():
encoding.main(
args.ngsfiles,
outfile=args.outfile,
delimiter=args.delimiter,
n_samples=args.n_samples,
)
if args.subcommand == "junction-annotation":
junction_annotation.main(
args.ngsfiles,
args.gene_model,
outfile=args.outfile,
delimiter=args.delimiter,
min_intron=args.min_intron,
min_mapq=args.min_mapq,
min_reads=args.min_reads,
Expand Down
4 changes: 2 additions & 2 deletions ngsderive/commands/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
ILLUMINA_1_3_SET = set([i for i in range(31, 93)])


def main(ngsfiles, outfile=sys.stdout, delimiter="\t", n_samples=1000000):
def main(ngsfiles, outfile=sys.stdout, n_samples=1000000):

writer = csv.DictWriter(
outfile,
fieldnames=["File", "Evidence", "ProbableEncoding"],
delimiter=delimiter,
delimiter="\t",
)
writer.writeheader()
outfile.flush()
Expand Down
4 changes: 2 additions & 2 deletions ngsderive/commands/instrument.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,11 +184,11 @@ def resolve_instrument(
)


def main(ngsfiles, outfile=sys.stdout, delimiter="\t", n_samples=10000):
def main(ngsfiles, outfile=sys.stdout, n_samples=10000):
writer = csv.DictWriter(
outfile,
fieldnames=["File", "Instrument", "Confidence", "Basis"],
delimiter=delimiter,
delimiter="\t",
)
writer.writeheader()
outfile.flush()
Expand Down
3 changes: 1 addition & 2 deletions ngsderive/commands/junction_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,6 @@ def main(
ngsfiles,
gene_model_file,
outfile=sys.stdout,
delimiter="\t",
min_intron=50,
min_mapq=30,
min_reads=1,
Expand Down Expand Up @@ -287,7 +286,7 @@ def main(
"complete_novel_spliced_reads",
]

writer = csv.DictWriter(outfile, fieldnames=fieldnames, delimiter=delimiter)
writer = csv.DictWriter(outfile, fieldnames=fieldnames, delimiter="\t")
writer.writeheader()
outfile.flush()

Expand Down
3 changes: 1 addition & 2 deletions ngsderive/commands/readlen.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,14 @@
def main(
ngsfiles,
outfile=sys.stdout,
delimiter="\t",
n_samples=100000,
majority_vote_cutoff=0.7,
):

writer = csv.DictWriter(
outfile,
fieldnames=["File", "Evidence", "MajorityPctDetected", "ConsensusReadLength"],
delimiter=delimiter,
delimiter="\t",
)
writer.writeheader()
outfile.flush()
Expand Down
3 changes: 1 addition & 2 deletions ngsderive/commands/strandedness.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,6 @@ def main(
ngsfiles,
gene_model_file,
outfile=sys.stdout,
delimiter="\t",
n_genes=100,
minimum_reads_per_gene=10,
only_protein_coding_genes=True,
Expand Down Expand Up @@ -329,7 +328,7 @@ def main(
fieldnames = ["ReadGroup"] + fieldnames
fieldnames = ["File"] + fieldnames

writer = csv.DictWriter(outfile, fieldnames=fieldnames, delimiter=delimiter)
writer = csv.DictWriter(outfile, fieldnames=fieldnames, delimiter="\t")
writer.writeheader()
outfile.flush()

Expand Down

0 comments on commit fbe382d

Please sign in to comment.