Code Monkey home page Code Monkey logo

canopus_treemap's Issues

Example of output

Hi Kai,

I think this is a very interesting tool. I was wondering if you could provide an example of the output :)

Thanks in advance,

Cheers,
Eber

PermissionError

Hello!
I'm trying to run CANOPUS for tutorial files, and after processing them with Sirius I get the "PermissionError" (see below) afrer I run the "C = Canopus(sirius="sirius_rosmarin")". Could you please tell me what could be the reason for this error?

Best wishes,
Vera

PermissionError Traceback (most recent call last)
Input In [3], in <cell line: 1>()
----> 1 C = Canopus(sirius="sirius_rosmarin")

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\api.py:26, in Canopus.init(self, sirius, gnps)
24 self.cleanNorm()
25 self.probabilityThreshold=0.33
---> 26 self.sirius = SiriusWorkspace(sirius)
27 self.Quant = self.sirius.make_quant()
28 self.conditions = dict()

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\ontology.py:639, in SiriusWorkspace.init(self, rootdir, ontology)
637 if Path(rootdir).is_dir():
638 self.load_ontology_index()
--> 639 self.load_compounds()
640 print("%d compounds in workspace " % len(self.compounds))
641 else:

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\ontology.py:771, in SiriusWorkspace.load_compounds(self)
769 break
770 cmp = Compound(name, compound_dir)
--> 771 siriusInstance = SiriusInstance(compound_dir)
772 if siriusInstance.canopusfp is not None:
773 self.compounds[name] = cmp

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\ontology.py:512, in SiriusInstance.init(self, dirname)
510 def init(self, dirname):
511 self.dirname = dirname
--> 512 self.__parse()

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\ontology.py:516, in SiriusInstance.__parse(self)
514 def __parse(self):
515 self.__parse_scores()
--> 516 self.__parse_canopus()
517 self.__parse_npc()
518 self.__parse_msfile()

File ~\Downloads\canopus_treemap-master\canopus_treemap-master\canopus\ontology.py:547, in SiriusInstance.__parse_canopus(self)
545 self.filename = canopusPath.name
546 elif canopusZipPath.exists():
--> 547 with zipfile.ZipFile(canopusZipPath) as myzip:
548 path = zipfile.Path(myzip, at=filename[0] + "_" + filename[1] + ".fpt")
549 if path.exists():

File ~\AppData\Local\Programs\Python\Python310\lib\zipfile.py:1249, in ZipFile.init(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
1247 while True:
1248 try:
-> 1249 self.fp = io.open(file, filemode)
1250 except OSError:
1251 if filemode in modeDict:

PermissionError: [Errno 13] Permission denied: 'sirius_rosmarin\236_rosmarin_mzml_237\canopus'

UTF-8 encoded canopus.tsv

Hi,

Thanks for making this software!

I ran the following:

from canopus import Canopus
C = Canopus(sirius="/emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus")
C.npcSummary().to_csv("npc_summary.csv")

I ran it on a workspace generated with SIRIUS 4.8.2.

It failed with an error about parsing ascii that i unfortunately didn't save
presumably because the canopus.tsv is utf-8 encoded:
-bash-4.2$ file /emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus/canopus.tsv
/emc/cbmr/users/chs962/mani_diet_sirius_aligned_canopus/canopus.tsv: UTF-8 Unicode text, with very long lines

I applied the following fix:
@@ -771,7 +772,8 @@ class SiriusWorkspace(object):

 def load_ontology_index(self):
     mapping = dict()
  •    with Path(self.rootdir, "canopus.tsv").open() as fhandle:
    
  •    print(Path(self.rootdir, "canopus.tsv"))
    
  •    with Path(self.rootdir, "canopus.tsv").open(encoding="utf-8") as fhandle:
           header=None
           ri = None
           coid = None
    

Export HTML

Hello,

I wonder if there is a function dedicated to export sunbursts to HTML file so I can share them easily ?
The html file created by the r.toFile function doesn't seem to include any element for the visualization.

Thanks for your work it's a great tool !

Simon

Publish as package on pypi or conda

To ease installation, it would be great if this would be available as a package on PyPI or conda.

Would it be possible to add it to one of those repositories?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.