Skip to content

Commit

Permalink
release 0.0.16
Browse files Browse the repository at this point in the history
  • Loading branch information
y9c committed Apr 22, 2024
1 parent 6f68be9 commit 671290d
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 8 deletions.
27 changes: 20 additions & 7 deletions cutseq/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,10 @@ def pipeline_single(input1, output1, short1, untrimmed1, barcode, settings):
)

# step 9: reverse complement the read
if settings.reverse_complement:
if barcode.strand == "+":
logging.warn("Library is + strand, but reverse complement is enabled.")
modifiers.append(ReverseComplementConverter())
if settings.reverse_complement and barcode.strand == "+":
logging.warn("Library is + strand, but reverse complement is enabled.")
if (settings.auto_rc and barcode.strand == "-") or settings.reverse_complement:
modifiers.append((ReverseComplementConverter(), ReverseComplementConverter()))

# dry run and exit code
if settings.dry_run:
Expand Down Expand Up @@ -466,9 +466,9 @@ def pipeline_paired(
)

# step 9: reverse complement the read
if settings.reverse_complement:
if barcode.strand == "+":
logging.warn("Library is + strand, but reverse complement is enabled.")
if settings.reverse_complement and barcode.strand == "+":
logging.warn("Library is + strand, but reverse complement is enabled.")
if (settings.auto_rc and barcode.strand == "-") or settings.reverse_complement:
modifiers.append((ReverseComplementConverter(), ReverseComplementConverter()))

# dry run and exit code
Expand Down Expand Up @@ -539,6 +539,7 @@ def run_cutseq(args):
settings.min_length = args.min_length
settings.dry_run = args.dry_run
settings.reverse_complement = args.reverse_complement
settings.auto_rc = args.auto_rc
settings.json_file = args.json_file
if len(args.input_file) == 1:
pipeline_single(
Expand Down Expand Up @@ -653,6 +654,11 @@ def main():
action="store_true",
help="Reverse complement the reads.",
)
parser.add_argument(
"--auto-rc",
action="store_true",
help="Reverse complete (-) strand reads only automatically.",
)

parser.add_argument(
"-t",
Expand Down Expand Up @@ -691,6 +697,13 @@ def main():
logging.error("Adapter scheme or name is required.")
sys.exit(1)

if args.auto_rc is not None:
if args.reverse_complement:
logging.warn(
"Both --reverse-complement and --auto-rc are enabled, --reverse-complement will be ignored."
)
args.reverse_complement = False

if len(args.input_file) > 2:
logging.error("Input file can not be more than two.")
sys.exit(1)
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "cutseq"
version = "0.0.15"
version = "0.0.16"
description = "Automatically cut adapter / barcode / UMI from NGS data"
authors = ["Ye Chang <[email protected]>"]
license = "MIT"
Expand Down

0 comments on commit 671290d

Please sign in to comment.