Giter VIP home page Giter VIP logo

alexandrovlab / sigprofilerplotting Goto Github PK

View Code? Open in Web Editor NEW
45.0 14.0 13.0 91.91 MB

SigProfilerPlotting provides a standard tool for displaying all types of mutational signatures as well as all types of mutational patterns in cancer genomes. The tool seamlessly integrates with other SigProfiler tools.

License: BSD 2-Clause "Simplified" License

Python 99.92% Dockerfile 0.08%
somatic-variants cancer-genomics mutational-signatures mutation-analysis visualization

sigprofilerplotting's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sigprofilerplotting's Issues

error in pip install

I was able to install the following using pip within my conda env:

SigProfilerMatrixGenerator
sigproextractor
sigproSS

but somehow pip didn't work for plotting:

pip install SigProfilePlotting
Collecting SigProfilePlotting
ERROR: Could not find a version that satisfies the requirement SigProfilePlotting (from versions: none)
ERROR: No matching distribution found for SigProfilePlotting

It could be my a version type problem but if the rest of them worked, not sure what I am missing for this plotting module. there was an issue with my matrix generator install (issue submitted on that github page), not sure if my workaround is causing this problem.
thanks

Templates cannot be created when SigProfilerPlotting is containerised

Dear Team,

I have attempted to create a container encompassing as many of the SigProfiler tools as possible for deployment within an Air-Gapped analysis environment.

The container errors out when SigProfilerPlotting needs to produce the templates needed for the plotting to take place.
The stack trace is:
Traceback (most recent call last): File "/usr/local/lib/python3.9/dist-packages/sigProfilerPlotting/sigProfilerPlotting.py", line 1027, in plotSBS fig_orig=make_pickle_file(context='SBS96', return_plot_template=True, volume=volume) File "/usr/local/lib/python3.9/dist-packages/sigProfilerPlotting/sigProfilerPlotting.py", line 129, in make_pickle_file os.mkdir(volume) OSError: [Errno 30] Read-only file system: '/usr/local/lib/python3.9/dist-packages/sigProfilerPlotting/templates/'

Looking into the code in your project it appear that the following line:
SPP_TEMPLATES = os.path.join(SPP_PATH, "templates/")
shows that the templates directory needs to be created in the install location of the package. This is not possible within the read-only filesystem of a container.

I have attempted to work around the issue by editing this line to be:
SPP_TEMPLATES = os.path.join(".", "templates/") and use the current working directory as the template root but I am not sure if there are other functions that need to be changed.

Would it be possible to:

  • confirm the number of locations where such write operations are likely to run into errors?
  • update the code to allow the templates directory to be configured as a user-defined location?

Many thanks for your assistance,
Best wishes,

Matthieu

error raised by passing axis=None to tick_params()

Hi, In sample_portrait.py, it looks like Axes.tick_params(axis=None) is used a few times, which is invalid and raises an error in matplotlib>=3.1.0 (see here). It would be great to address the underlying issue, but in the meantime you could add install_requires with working versions in your setup.

See below for error, in case I'm missing something.

 sP.samplePortrait(project_dir, project_dir, 'project', percentage=False)
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-20-ced65c03fc90> in <module>
----> 1 sP.samplePortrait(project_dir, project_dir, 'project', percentage=False)

./conda/4.6.14/envs/sigtest/lib/python3.8/site-packages/sigProfilerPlotting/sample_portrait.py in samplePortrait(sample_matrices_path, output_path, project, percentage)
   1474
   1475
-> 1476                 panel5.tick_params(axis=None,which='both',\
   1477                                                    bottom=False, labelbottom=False,\
   1478                                                    left=False, labelleft=False,\

./conda/4.6.14/envs/sigtest/lib/python3.8/site-packages/matplotlib/axes/_base.py in tick_params(self, axis, **kwargs)
   2944
   2945         """
-> 2946         cbook._check_in_list(['x', 'y', 'both'], axis=axis)
   2947         if axis in ['x', 'both']:
   2948             xkw = dict(kwargs)

./conda/4.6.14/envs/sigtest/lib/python3.8/site-packages/matplotlib/cbook/__init__.py in _check_in_list(_values, **kwargs)
   2141     for k, v in kwargs.items():
   2142         if v not in values:
-> 2143             raise ValueError(
   2144                 "{!r} is not a valid value for {}; supported values are {}"
   2145                 .format(v, k, ', '.join(map(repr, values))))

ValueError: None is not a valid value for axis; supported values are 'x', 'y', 'both'

division by zero

File "/miniconda3/lib/python3.6/site-packages/sigProfilerPlotting/sample_portrait.py", line 2033, in samplePortrait
panel7.bar(x, mutations_78[sample][key][seq]/total_count*100,width=0.4,color=colors[i],align='center', zorder=1000)
ZeroDivisionError: float division by zero

have a few divided by zero issues when using percentage=True in plotting.

Error : Bottom cannot be >= Top when scale = mutational_burden.10^x

Hi, I am getting an error Bottom cannot be >= Top raised by tmbplot.py.
I believe it is because when resizing the subplots line 110, ymin = max which makes top = bottom.
Now ymin = floor(df.min) and max = ceil(df.max) are the same value because in my case:

Because the dataframe df[log10(mutational_burden/scale)] contains only 1 row, df.max=df.min.
Additionally, when calculating mutational_burden/scale, scale is at one point hard coded at 2800.
Or in my case the mutational_burden is at one point equal to 28 so mutational_burden/scale = 0.01.
But np.log10(0.01) is approximated by numpy as being -2.0, which makes np.floor = np.ceil, and in this case ceil(df.max) = floor(df.min).

So I believe this error will be raised every time these 2 cases happen at the same time :

  • the dataframe contains only one row
  • scale = mutational_burden.10^x (x being an integer)

Could you please fix it or provide a workaround not involving changing the scale ?

I am using the latest versions of SigProfiler:
SigProfilerPlotting == 1.3.12
SigProfilerExtractor == 1.1.21
SigProfilerMatrixGenerator == 1.2.14

Thank you

extra argument in plotID

Hi,

I came across this error while trying to extract INDEL signatures and it failed while attempting to plot the signatures. The error message is :

TypeError: plotID() got an unexpected keyword argument 'custom_text_upper'

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.