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

Issue when running in denovo mode #3

Open
JannikSchneider12 opened this issue Mar 10, 2024 · 2 comments
Open

Issue when running in denovo mode #3

JannikSchneider12 opened this issue Mar 10, 2024 · 2 comments
Assignees
Labels
help wanted Extra attention is needed

Comments

@JannikSchneider12
Copy link

Hello,

I wanted to run the model in denovo mode, but I am getting this error:

File "/home/jannik/Masterthesis/de_novo_peptide_sequencing/ContraNovo/ContraNovo/ContraNovo.py", line 198, in main
writer.set_metadata(
AttributeError: 'NoneType' object has no attribute 'set_metadata'

Which is related to this part of the implementation

https://github.com/BEAM-Labs/ContraNovo/blob/main/ContraNovo/ContraNovo.py#L197-L200

writer = None
writer.set_metadata(
config, peak_path=peak_path, model=model, config_filename=config_fn
)

If I see this right, the writer class should be instanciated before?

Thanks for your time and help

@sxu99 sxu99 added the help wanted Extra attention is needed label Mar 13, 2024
@Chryzl
Copy link

Chryzl commented Mar 21, 2024

Hello,

I encountered the issue myself.

Since ContraNovo and Casanovo are similar in code structure, I found that Casanovo's writer can be inserted.

If you look at the ms_io.py file within Casanovo, you can find a fitting MztabWriter. Simply copy the code into the ContraNovo repo (e.g. into ContraNovo/data/) and insert the writer.

I fixed it like so:

from .data import ms_io
...
writer = ms_io.MztabWriter(Path(output).with_suffix(".mztab"))
writer.set_metadata(
    config, peak_path=peak_path, model=model, config_filename=config_fn
)
writer.set_ms_run([peak_path])
...
writer.save()

I hope this works for you

@irleader
Copy link

Hello,

I encountered the issue myself.

Since ContraNovo and Casanovo are similar in code structure, I found that Casanovo's writer can be inserted.

If you look at the ms_io.py file within Casanovo, you can find a fitting MztabWriter. Simply copy the code into the ContraNovo repo (e.g. into ContraNovo/data/) and insert the writer.

I fixed it like so:

from .data import ms_io
...
writer = ms_io.MztabWriter(Path(output).with_suffix(".mztab"))
writer.set_metadata(
    config, peak_path=peak_path, model=model, config_filename=config_fn
)
writer.set_ms_run([peak_path])
...
writer.save()

I hope this works for you

#4 Can you help to check this error please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants