jakelever / civicmine

Text mining cancer biomarkers for the CIVIC database
http://bionlp.bcgsc.ca/civicmine
MIT License
22 stars 1 forks source link

Error when running "pubrunner --test ." #4

Closed Kalifa-manjang closed 4 years ago

Kalifa-manjang commented 4 years ago

Hello Jake, I have set up the environment for civicmine as described in your Github. I am trying to replicate the analysis with "pubrunner --test ." but I ran into some issues. Here is the output and error description:


Working directory: /home/kalifa/pubrunner/workspace/CIViCmine/test Traceback (most recent call last): File "/home/kalifa/.local/bin/pubrunner", line 33, in sys.exit(load_entry_point('pubrunner==0.5.3', 'console_scripts', 'pubrunner')()) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/command_line.py", line 66, in main pubrunner.pubrun(args.codebase,args.test,(not args.nogetresource),forceresource_dir=args.forceresource_dir,forceresource_format=args.forceresource_format,outputdir=args.outputdir) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/pubrun.py", line 352, in pubrun prepareConversionAndHashingRuns(toolSettings,mode,workingDirectory) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/pubrun.py", line 86, in prepareConversionAndHashingRuns eutilsToFile('pubmed',pmid,filename) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/pubrun.py", line 41, in eutilsToFile f.write(xml) File "/usr/lib/python3.7/codecs.py", line 721, in write return self.writer.write(data) File "/usr/lib/python3.7/codecs.py", line 377, in write data, consumed = self.encode(object, self.errors) TypeError: utf_8_encode() argument 1 must be str, not bytes

I am using python 3.7 and Ubuntu 19.10. The problem is briefly solved if I change the following line of codes in the codecs.py file. def write(self, object):

    """ Writes the object's contents encoded to self.stream.
    """
    data, consumed = self.encode(object.decode('uft-8'), self.errors)
    self.stream.write(data)

However, other problems with snakemake rise up, therefore I have to undone the changes. I have been working on this for the past two days. I will appreciate it if you can render me some support. Thanks.

jakelever commented 4 years ago

Thanks for raising this. I'll take a look.

jakelever commented 4 years ago

Hi, I've made a few fixes to PubRunner and Kindred that are dependencies of this project, due to changes in another package. It seems to be working for me now. Hope it does for you. You'll need to upgrade both of them:

pip install -U kindred pubrunner
Kalifa-manjang commented 4 years ago

Hello Jake, Thanks for the response. The previous error is gone. However, I have another error. It's about snakemake. Here is the error I am having.

Running conversions

Traceback (most recent call last): File "/home/kalifa/.local/bin/snakemake", line 33, in sys.exit(load_entry_point('snakemake==5.1.5', 'console_scripts', 'snakemake')()) File "/home/kalifa/.local/bin/snakemake", line 25, in importlib_load_entry_point return next(matches).load() File "/usr/local/lib/python3.7/dist-packages/importlib_metadata/init.py", line 105, in load module = import_module(match.group('module')) File "/usr/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/home/kalifa/.local/lib/python3.7/site-packages/snakemake/init.py", line 20, in from snakemake.workflow import Workflow File "/home/kalifa/.local/lib/python3.7/site-packages/snakemake/workflow.py", line 23, in from snakemake.shell import shell File "/home/kalifa/.local/lib/python3.7/site-packages/snakemake/shell.py", line 69 async= False, ^ SyntaxError: invalid syntax Traceback (most recent call last): File "/home/kalifa/.local/bin/pubrunner", line 33, in sys.exit(load_entry_point('pubrunner==0.5.4', 'console_scripts', 'pubrunner')()) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/command_line.py", line 66, in main pubrunner.pubrun(args.codebase,args.test,(not args.nogetresource),forceresource_dir=args.forceresource_dir,forceresource_format=args.forceresource_format,outputdir=args.outputdir) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/pubrun.py", line 447, in pubrun pubrunner.launchSnakemake(convertSnakeFile,parameters=parameters) File "/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/snakemake.py", line 34, in launchSnakemake raise RuntimeError("Snake make call FAILED (file:%s)" % snakeFilePath) RuntimeError: Snake make call FAILED (file:/home/kalifa/.local/lib/python3.7/site-packages/pubrunner/Snakefiles/Convert.py)

I read somewhere that "async" is a reserved name in python 3.7. Can you please help me with this? Thanks

jakelever commented 4 years ago

Hi, thanks for spotting this. I had only been testing things with Python 3.6 and an older version of snakemake. I've fixed this and expanded testing. You'll need to update pubrunner and snakemake this time:

pip install -U pubrunner snakemake

Let me know how it goes.

Kalifa-manjang commented 4 years ago

Hello Jake, Thanks. I am able to run the program now. I tested your application on the following PubMed id: 19563758. But the 3 files returned are all empty. I tried other ID's as well to no avail. Do you know what the problem might be? Thanks

jakelever commented 4 years ago

Hi, I just ran 19563758 and confirm that CIViCmine doesn't find anything there. CIViCmine needs a sentence with a gene name and cancer type (with drug name and mutation as optional). It then applies ML to identify sentences that discuss Diagnostic, Predictive, Prognostic and Predisposing markers. It doesn't look like that that information is in that abstract, so I think it makes sense that CIViCmine wouldn't anything there. Did you find anything with the default test PubMed ID: 28418444?

Kalifa-manjang commented 4 years ago

The information is present in the full text not the abstract. Yes, I found something for PubMed ID: 28418444.

jakelever commented 4 years ago

Great. Could you provide some of the sentences that you were hoping CIViCmine would extract data from?

stale[bot] commented 4 years ago

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

Kalifa-manjang commented 4 years ago

Hello Jake, I have put the project on hold for now. I will come back to it later.

On Tue, Sep 15, 2020 at 3:55 AM stale[bot] notifications@github.com wrote:

Is this still relevant? If so, what is blocking it? Is there anything you can do to help move it forward?

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jakelever/civicmine/issues/4#issuecomment-692395746, or unsubscribe https://github.com/notifications/unsubscribe-auth/AM26LPZO2OYMCLKLNUZTEZTSF23QDANCNFSM4OUZWTNQ .