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

dont_check_names used for data.frame and data.table evidence_file #152

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bpolacco
Copy link
Contributor

@bpolacco bpolacco commented Apr 9, 2020

I discovered a problem in .artms_checkIfFile that was using dont_check_names the opposite that the name implies (beware double negative). The only function to use this argument that I found (grep dont_check_names ./R/*) was protein2SiteConversion which was also using it opposite of the name, so no effective bug in usage. However, there was a bug when a data.table or data.frame was passed in to protein2SiteConversion as the evidence file: no check.names argument was passed to data.frame() or data.table() so that names were always checked. The function protein2SiteConversion uses names with spaces, e.g. "Leading proteins", so check.names should be FALSE in calls to read.delim(), data.table(), data.frame().

My changes are

  1. check_names = !dont_check_names in arguments to read.delim, data.table, data.frame
  2. dont_check_names = TRUE inside protein2SiteConversion
  3. cleaning up redundant code in if(dont_check_names) statement

@bpolacco
Copy link
Contributor Author

bpolacco commented Apr 9, 2020

I'd support changing the argument dont_check_names to check_names in the function .checkIfFile for easier to understand code, but that is potentially a mess if its called places I didn't find, so I didn't use that as my fix.

@bpolacco
Copy link
Contributor Author

bpolacco commented Apr 9, 2020

wait on this, I broke something else, it seems.

Its all good now with my second commit.

@biodavidjm biodavidjm added this to Backlog in artMS Jul 19, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
artMS
Backlog
Development

Successfully merging this pull request may close these issues.

None yet

2 participants