Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds option to extract barcode from read2 only #630

Merged
merged 1 commit into from
Mar 13, 2024

Conversation

TomSmithCGAT
Copy link
Member

This adds the option --read2-only for extract and whitelist to only extract barcodes from read2.

See #522 for motivation

Copy link
Member

@IanSudbery IanSudbery left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any immediate problems, and I assume that you have run the tests. There was one question I asked.

Also, what happens if the mode is string rather than regex, is that covered? And documented?

@@ -542,7 +532,7 @@ def __call__(self, read1, read2=None):
# Check for regex is more complex.
# Reads too short with regex pattern will silently fail to match
if self.method == "string":
if(len(read1.seq) < len(self.pattern)):
if(self.pattern and (len(read1.seq) < len(self.pattern))):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TomSmithCGAT Should there not be an equivalent of this for self.pattern2 and len(read2.seq)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. Good point. I'll add that

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it's already there! See line 540

@TomSmithCGAT
Copy link
Member Author

Yep. Tests all run OK and new tests include mode=string and mode=regex.

By 'And documented?', do you mean is the new option to just use read2 only documented? If so, yes, usual documentation in the tool, plus FAQs.

@IanSudbery
Copy link
Member

Sorry, I mean that if it were only available in regex mode is that documented. No worries if it works in both.

@IanSudbery IanSudbery merged commit 156e285 into master Mar 13, 2024
6 checks passed
@TomSmithCGAT TomSmithCGAT deleted the ts_add_option_to_extract_from_read2_only branch March 13, 2024 10:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants