Skip to content

Conversation

@eolaniru
Copy link

Dear @PoisonAlien,
When filtering sample pair at if(nrow(sample_pair) > 0){ unique(unlist(sample_pair[XY_possibly_paired == "Yes", .(X_bam, Y_bam)], use.names = FALSE)) }, the script fails if nrow is of length zero. This PR fixes this.

It also fixes issues described in PR #797

I've tested it on real data but please take a look.
Thanks

R/sample_swap.R Outdated
}
}
})
pos_mathces = pos_mathces[which(lapply(pos_mathces, function(x) length(x) > 0) == TRUE)]
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be better to use pos_mathces[sapply(pos_mathces, function(x) length(x) > 0)]?

Copy link
Author

Choose a reason for hiding this comment

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

Yes, you are right. That works as well

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