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

Test failing #6

Open
pkrog opened this issue Jun 24, 2019 · 13 comments
Open

Test failing #6

pkrog opened this issue Jun 24, 2019 · 13 comments
Assignees
Labels
bug Something isn't working

Comments

@pkrog
Copy link
Collaborator

pkrog commented Jun 24, 2019

The test test_basic_processing() is failing inside function chooseVerticesLosses(), in line:

    vmz <- lf@formula[bloss,] %*% m_atoms

where m_atoms is an empty numeric vector.

--> This one is solved. atoms was a integer vector with atom letters as names instead of a character vector.

@pkrog pkrog added the bug Something isn't working label Jun 24, 2019
@pkrog pkrog self-assigned this Jun 24, 2019
@pkrog
Copy link
Collaborator Author

pkrog commented Jun 24, 2019

Now we have:

object 'bf' not found
1: test_basic_processing()
2: mineMS2::plotPatterns(m2l, full = TRUE) at /home/pr228844/dev/mineMS2_pkg/tests/testthat/test.R:36
3: plot(m2l, id) at /home/pr228844/dev/mineMS2_pkg/R/complexPlot.R:68
4: plot(m2l, id)
5: .local(x, y, ...)
6: plot(x[y], title = y, dags = mm2Dags(x), edgeLabels = (mm2EdgesLabels(x)), atoms = names(x@atoms),
       formula = get_formula(x)[toccs], ...) at /home/pr228844/dev/mineMS2_pkg/R/ms2Lib.R:608
7: plot(x[y], title = y, dags = mm2Dags(x), edgeLabels = (mm2EdgesLabels(x)), atoms = names(x@atoms),
       formula = get_formula(x)[toccs], ...)
8: .local(x, y, ...)
9: makeLabelPattern(x, atoms, dags, edgeLabels, oformula = oformula) at /home/pr228844/dev/mineMS2_pkg/R/fragPattern-plot.R:225
10: annotateAFG(p, atoms, dags, elabs, oformula = oformula) at /home/pr228844/dev/mineMS2_pkg/R/labels.R:531
11: annotateVertices(fp, label_origin, dags, elabs, atoms, allf = allf[pmm], edge_label = "lab",
       oformula = oformula, massdiff = massdiff[pmm]) at /home/pr228844/dev/mineMS2_pkg/R/labels.R:508
12: sapply(seq_along(vlab), function(x, l_origin, voformula, vatoms, subf, vdags, lformula,
       vmz, vrdbe) {
       lf <- lformula[[x]]
       if (length(lf) == 0) {
           return(list(c(1, 1), lf))
       }
       vrdbe <- vecRDBE(lf@formula)
       rtemp <- chooseVerticesLosses(lf, oformula = voformula, dags, vmz[x], vrdbe = vrdbe,
           atoms = vatoms, subformula = subf[x + 1, ])
       return(list(rtemp[2:3], lf[rtemp[1], , drop = FALSE]))
   }, vdags = vdags, voformula = oformula, l_origin = vlab, vatoms = atoms, subf = subformula,
       lformula = allf, vmz = mzv, vrdbe = vrdbe) at /home/pr228844/dev/mineMS2_pkg/R/labels.R:282
13: lapply(X = X, FUN = FUN, ...)
14: FUN(X[[i]], ...)
15: chooseVerticesLosses(lf, oformula = voformula, dags, vmz[x], vrdbe = vrdbe, atoms = vatoms,
       subformula = subf[x + 1, ]) at /home/pr228844/dev/mineMS2_pkg/R/labels.R:290

It happens in function chooseVerticesLosses() at the following line:

bpartial <- as.numeric(as.numeric(bf[bloss])==nrow(lf@formula))

@adelabriere , could you look at that please or explain me what to do?

@pkrog
Copy link
Collaborator Author

pkrog commented Jun 26, 2019

What should bf contain?

@pkrog pkrog mentioned this issue Jul 1, 2019
@adelabriere
Copy link
Owner

Hi Pierrick, thanks for reporting, bf is a vector containing the number of vertices/subformula matched for each candidates formmula (oformula). Is this still an issue ?

@pkrog
Copy link
Collaborator Author

pkrog commented Jul 9, 2019

Hi Alexis, I've solved, I think. Please look at:
https://github.com/adelabriere/mineMS2/pull/8/files#diff-d8566cf7b3fb7f63dfb157edc80e142cR236
and tell me if it looks right or wrong.

The output of my test is different from the output of the reference file of the Galaxy tool. The changed lines are the v_id lines:

<data key="v_id">P15,P15</data>  

In the case of the line above, P15,P15 is replaced with P27,P27. Is it important?

@adelabriere
Copy link
Owner

This does not seems to be an issue. I checked the results on the vignette and this does not have any practical consequence.

I probably changed a default parameters at some point for clarity purpose.

@pkrog
Copy link
Collaborator Author

pkrog commented Jul 16, 2019

The IDs in the output are different on each run. Do you use some random numbers in your algo? Can we set a seed for testing?

@adelabriere
Copy link
Owner

adelabriere commented Jul 19, 2019

Just a quick update I m investigating this behavior at the moment. I don t see any evident reason in the R code, so it is probably coming from the C++ code.

@adelabriere
Copy link
Owner

adelabriere commented Aug 7, 2019

Issu solved, pushed on the master branch, I had the same ID on 10 tests so if you don t encounter this issue anymore I ll consider that the problem is solved.

@pkrog
Copy link
Collaborator Author

pkrog commented Aug 7, 2019

Ok, I'll look at that. Thanks.

@pkrog
Copy link
Collaborator Author

pkrog commented Aug 7, 2019

Maybe I was in a bad luck, but I obtained this difference between two runs:

678c678                                                                                                                                                                                        
<       <data key="v_id">P168</data>                                                                                                                                                           
---                                                                                                                                                                                            
>       <data key="v_id">P166</data>                                                                                                                                                           
694c694                                                                                                                                                                                        
<       <data key="v_id">P168</data>                                                                                                                                                           
---                                                                                                                                                                                            
>       <data key="v_id">P166</data>                                                                                                                                                           

I just ran make test to run this test. The files to compare are:
tests/output/test_basic_processing.graphml
and
tests/res/basic_annotated.graphml

See branch basic_test.

@adelabriere
Copy link
Owner

OK I check that, It s clearly not luck as the IDs are now close.

@pkrog
Copy link
Collaborator Author

pkrog commented Aug 26, 2019

I add @ethevenot to this conversation.

@pkrog
Copy link
Collaborator Author

pkrog commented Oct 11, 2019

Hi @adelabriere , did you have time to look at this last small issue ?

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

2 participants