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

Remove superfluous condition statement on existence of vcf parameter in segmentationPSCBS #337

Merged

Conversation

tinyheero
Copy link

This PR removes the following superfluous condition statements from the segmentationPSCBS() function:

if (!is.null(vcf)) {

Before this condition statement is run, the function .PSCBSinput() is run to generate inputs for PSCBS. This function has the following condition statement:

if (is.null(vcf)) {
    .stopUserError("segmentationPSCBS requires VCF file.")
}

As such, checking for whether the parameter vcf is set has already happened upstream.

Additionally, this condition statement determines where .pruneByHclust() is run. But PSCBS has already been run potentially 2 times before this function is run. Since, PSCBS can't be run without a VCF file (more specifically BAF values) this condition statement will always evaluate to TRUE making it both confusing and superfluous.

@lima1 lima1 merged commit 324e626 into lima1:devel Dec 11, 2023
1 check failed
@lima1
Copy link
Owner

lima1 commented Dec 11, 2023

Good catch, thank you!

@tinyheero tinyheero deleted the rm-condition-statement-segmentationpscbs branch December 14, 2023 20:58
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