cutseq 0.0.7__tar.gz → 0.0.9__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: cutseq
3
- Version: 0.0.7
3
+ Version: 0.0.9
4
4
  Summary: Automatically cut adapter / barcode / UMI from NGS data
5
5
  Home-page: https://github.com/y9c/cutseq
6
6
  License: MIT
@@ -33,7 +33,7 @@ from cutadapt.modifiers import (
33
33
  )
34
34
  from cutadapt.pipeline import PairedEndPipeline, SingleEndPipeline
35
35
  from cutadapt.predicates import Predicate, TooShort
36
- from cutadapt.report import Statistics
36
+ from cutadapt.report import Statistics, minimal_report
37
37
  from cutadapt.runners import make_runner
38
38
  from cutadapt.steps import (
39
39
  PairedEndFilter,
@@ -83,7 +83,7 @@ class ReverseComplementConverter(SingleEndModifier):
83
83
  self.rcd = False
84
84
 
85
85
  def __repr__(self):
86
- return f"UnconditionalCutter(length={self.length})"
86
+ return "ReverseComplementConverter()"
87
87
 
88
88
  def __call__(self, read, info):
89
89
  return read.reverse_complement()
@@ -256,6 +256,8 @@ def pipeline_single(input1, output1, short1, untrimmed1, barcode, settings):
256
256
 
257
257
  # step 9: reverse complement the read
258
258
  if settings.reverse_complement:
259
+ if barcode.strand == "+":
260
+ logging.warn("Library is + strand, but reverse complement is enabled.")
259
261
  modifiers.append(ReverseComplementConverter())
260
262
 
261
263
  inpaths = InputPaths(input1)
@@ -267,14 +269,16 @@ def pipeline_single(input1, output1, short1, untrimmed1, barcode, settings):
267
269
  interleaved=False,
268
270
  )
269
271
  steps = []
272
+ # TODO: report info
273
+ # --info-file=info.txt
274
+ # PairedSingleEndStep(InfoFileWriter(outfiles.open_text("info.txt"))),
270
275
  steps.append(
271
- # --info-file=info.txt
272
- # PairedSingleEndStep(InfoFileWriter(outfiles.open_text("info.txt"))),
273
276
  # -m 10
274
277
  SingleEndFilter(
275
278
  TooShort(settings.min_length), outfiles.open_record_writer(short1)
276
279
  ),
277
280
  )
281
+ # TODO: --max-n=0 support
278
282
  if (
279
283
  settings.ensure_inline_barcode
280
284
  and barcode.inline5.len + barcode.inline3.len > 0
@@ -285,7 +289,6 @@ def pipeline_single(input1, output1, short1, untrimmed1, barcode, settings):
285
289
  if barcode.inline3.len > 0:
286
290
  ref_adapters.append(adapter_inline3)
287
291
  steps.append(
288
- # TODO: --max-n=0 support
289
292
  SingleEndFilter(
290
293
  IsUntrimmedAny(ref_adapters),
291
294
  outfiles.open_record_writer(untrimmed1, interleaved=False),
@@ -297,6 +300,7 @@ def pipeline_single(input1, output1, short1, untrimmed1, barcode, settings):
297
300
  )
298
301
  pipeline = SingleEndPipeline(modifiers, steps)
299
302
  _stats = runner.run(pipeline, Progress(), outfiles)
303
+ print(minimal_report(_stats, time=None, gc_content=None), file=sys.stderr)
300
304
  # _ = stats.as_json()
301
305
  outfiles.close()
302
306
 
@@ -444,6 +448,8 @@ def pipeline_paired(
444
448
 
445
449
  # step 9: reverse complement the read
446
450
  if settings.reverse_complement:
451
+ if barcode.strand == "+":
452
+ logging.warn("Library is + strand, but reverse complement is enabled.")
447
453
  modifiers.append((ReverseComplementConverter(), ReverseComplementConverter()))
448
454
 
449
455
  inpaths = InputPaths(input1, input2)
@@ -465,12 +471,12 @@ def pipeline_paired(
465
471
  outfiles.open_record_writer(short1, short2, interleaved=False),
466
472
  )
467
473
  )
474
+ # TODO: --max-n=0 support
468
475
  if (
469
476
  settings.ensure_inline_barcode
470
477
  and barcode.inline5.len + barcode.inline3.len > 0
471
478
  ):
472
479
  steps.append(
473
- # TODO: --max-n=0 support
474
480
  PairedEndFilter(
475
481
  IsUntrimmedAny([adapter_inline5])
476
482
  if barcode.inline5.len > 0
@@ -490,12 +496,13 @@ def pipeline_paired(
490
496
  )
491
497
  pipeline = PairedEndPipeline(modifiers, steps)
492
498
  _stats = runner.run(pipeline, Progress(), outfiles)
499
+ print(minimal_report(_stats, time=None, gc_content=None), file=sys.stderr)
493
500
  # _ = stats.as_json()
494
501
  outfiles.close()
495
502
 
496
503
 
497
504
  def run_cutseq(args):
498
- barcode_config = BarcodeConfig(args.adapter_scheme.upper())
505
+ barcode_config = BarcodeConfig(args.adapter_scheme.replace(" ", "").upper())
499
506
  settings = CutadaptConfig()
500
507
  settings.rname_suffix = args.with_rname_suffix
501
508
  settings.ensure_inline_barcode = args.ensure_inline_barcode
@@ -630,6 +637,11 @@ def main():
630
637
  "-V", "--version", action="version", version=f"%(prog)s {__version__}"
631
638
  )
632
639
 
640
+ # Check if no arguments were provided
641
+ if len(sys.argv) == 1:
642
+ parser.print_help(sys.stdout)
643
+ sys.exit(0)
644
+
633
645
  args = parser.parse_args()
634
646
 
635
647
  if args.adapter_name is not None:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "cutseq"
3
- version = "0.0.7"
3
+ version = "0.0.9"
4
4
  description = "Automatically cut adapter / barcode / UMI from NGS data"
5
5
  authors = ["Ye Chang <yech1990@gmail.com>"]
6
6
  license = "MIT"
File without changes
File without changes