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

Check possible bug for file reading #113

Open
ggutierrez-sunbright opened this issue May 5, 2024 · 0 comments
Open

Check possible bug for file reading #113

ggutierrez-sunbright opened this issue May 5, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ggutierrez-sunbright
Copy link
Contributor

It is possible that the RbtBaseFileSource::Read method has a bug where reading multi-record files with record delimiter at the beginning of the record (like MOL2) yields only the odd records (1st, 3rd, etc).

I didn't have the time to check properly, but the original code looks suspicious:

while ((m_fileIn.getline(m_szBuf, MAXLINELENGTH)) && (strncmp(m_szBuf, cszRecDelim, n) != 0));
while ((m_fileIn.getline(m_szBuf, MAXLINELENGTH)) && (strncmp(m_szBuf, cszRecDelim, n) != 0)) {
    m_lineRecs.push_back(m_szBuf);
}

To me it looks like it's going to

  1. skip the delimiter of record 1
  2. read all lines and skip the delimiter for record 2
  3. skip until it finds the delimiter of record 3
  4. read all lines from record 3 and skip the delimiter for record 4

and so on

it is possible that either I'm reading it wrong, or this issue doesn't affect the regular execution of rdock (it only reads one record for the receptor, which is the file that uses MOL2. molecules are provided in SDF which uses a delimiter at the end of each record)

there's been no complains about this in the last decades, so I think priority for this is quite low

@ggutierrez-sunbright ggutierrez-sunbright added the bug Something isn't working label May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant