Skip to content

Fixed error causing names attribute to be overwritten with NAs#14

Open
cphealy8 wants to merge 3 commits into
ParkerICI:masterfrom
cphealy8:connor
Open

Fixed error causing names attribute to be overwritten with NAs#14
cphealy8 wants to merge 3 commits into
ParkerICI:masterfrom
cphealy8:connor

Conversation

@cphealy8

Copy link
Copy Markdown

add_landmark_labels is overwriting the names attribute causing the names of landmark entries in the graphml object to be set to NA. This commit prevents this overwriting when it's not needed by wrapping add_landmark_labels in an if-else statement so that this overwriting only occurs when a new variable, overwrite.names, is TRUE.

I added overwrite.names as an optional argument to get_scaffold_map and run_scaffold_analysis with a default value of TRUE.

This implementation should permit the fix without affecting existing deployments of vite.

cphealy8 and others added 3 commits June 29, 2022 10:09
add_landmark_labels is overwriting the names attribute causing the names of landmark entries in the graphml object to be set to NA. This commit prevents this overwriting when it's not needed.
@SamGG

SamGG commented Jun 8, 2023

Copy link
Copy Markdown

@cphealy8 thanks for your feedback to the community
Concerning

        good.cols <- col.names[col.names %in% colnames(tab)]
        if (length(good.cols)<length(col.names)){
            warning('Some channels requested were not present in the clustering file. Double check names.')
            col.names<-good.cols
        }

I think good.cols <- intersect(col.names, colnames(tab)) would be clearer.
I think using setdiff() would give a more informative message to the user about missing channels.

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