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

Make mergePairs work with one sample mergers #605

Closed
wants to merge 5 commits into from

Conversation

derele
Copy link
Contributor

@derele derele commented Nov 7, 2018

mergePairs is still failing (producing unexpected output without an error or warning) when mergers were obtained for only one sample.

This was because at the end lenght one lists are simplified and then the nameing according to sample names was performed. This overwrote the names of the mergers dataframe and column one got the sample names.

Simple fix to name bofore simplifying the list.

@derele derele changed the title Make this work with one sample mergers Make mergePairs work with one sample mergers Nov 7, 2018
@benjjneb
Copy link
Owner

benjjneb commented Dec 3, 2018

Sorry for long delay in responding, but have been busy with my class. I should be able to get to this in the next week or two though.

@benjjneb benjjneb closed this in 3b02a35 Apr 11, 2019
@benjjneb
Copy link
Owner

So after a very long delay this is now fixed. To clarify, the bug behavior was produced by the following:

# dereplicate and dada a single paired-end sample
mm <- mergePairs(list(sam1=ddF), list(sam1=drpF), list(sam1=ddR), list(sam1=drpR))
names(mm)

[1] "sam1" NA NA NA NA NA NA NA NA

After this commit, this behaves as expected:

# dereplicate and dada a single paired-end sample
mm <- mergePairs(list(sam1=ddF), list(sam1=drpF), list(sam1=ddR), list(sam1=drpR))
names(mm)

[1] "sequence" "abundance" "forward" "reverse" "nmatch" "nmismatch" "nindel" "prefer" "accept"

Since it's been so long I just implemented the fix myself instead of taking your pull request to avoid the merge conflicts that have cropped up since then. But thanks again @derele for so clearly describing the problem and fix which made this very easy for me!

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