Giter Club home page Giter Club logo

scphylo-tools's People

Contributors

faridrashidi avatar pre-commit-ci[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

scphylo-tools's Issues

Recommended Resources to use HUNTRESS / multiple thread usage leads to halt of HUNTRESS ?

Hi Farid,

I am currently making heavy use of your implementation of the HUNTRESS algorithm.
tl.huntress

Do you have some guidance on the resources to allocate to HUNTRESS?

I am having some trouble running HUNTRESS.
When using a single thread HUNTRESS runs fine for small cell-mutation matrices (200 cells 10 mutations).

I tried upping the threads to 8 and ram to 2 GB in the light of larger mutation matrices (1000 cells, 50 mutations), yet it appears that even for the small runs (200 cells 10 mutations) multiple threads bring trouble - that I don't understand.

HUNTRESS seems to start up fine with the usual first line of output:
running HUNTRESS with alpha=1e-06, beta=0.1, n_threads=8

but just does not progress after that for more than 3 hrs, which is way more than the runtime the supplementary paper of HUNTRESS suggests.
Surprisingly, I cannot find a high CPU usage related to it. When multiple threads are run no significant resources are used. Tried multiple machines and setups.

Is there a way to check if HUNTRESS is making progress - A debug mode/log ?

Thanks in advance! Best Regards,

Gordon

Ancestor-descendent accuracy returns wrong values as well as `ZeroDivisionError`s

Description

Running the scphylo.tl.ad() returns wrong values and division by zero errors.
Confident about the usage of input, see examples.

Minimal reproducible example

Example 1: wrong output

In this example scphylo.tl.ad() returns a wrong value, compared to the attached by-hand calculation for these small trees. See input arrays and tree topology attached.

tree1 / df1:
         0  3  2  1
Cell-1  0  0  0  0
Cell-2  0  0  1  0
Cell-3  0  0  1  1
Cell-4  1  0  1  1
Cell-5  1  1  1  1 

tree2 / df2:
         0  3  2  1
Cell-1  0  0  0  0
Cell-2  0  0  0  1
Cell-3  0  1  0  1
Cell-4  1  1  0  1
Cell-5  1  1  1  1

tree1:
4
└── 2
    └── 1
        └── 0
            └── 3
tree2:
4
└── 1
    └── 3
        └── 0
            └── 2
scphylo AD: 0.33333333333333337
correct AD: 0.42857142857142855

By hand calculation:

249461085-d20bebab-4385-48eb-a178-6e3949e3c281

Example 2: Division by Zero

In this example the scphylo.tl.ad() fails.

tree 1 / df1:
         2  0  1  3
Cell-1  0  0  0  0
Cell-2  0  1  0  0
Cell-3  0  0  1  0
Cell-4  1  0  0  0
Cell-5  0  0  0  1 

tree 2 / df2:
         2  0  1  3
Cell-1  0  0  0  0
Cell-2  1  0  0  0
Cell-3  1  1  0  0
Cell-4  1  0  1  0
Cell-5  0  0  0  1

tree 1: 
4
├── 0
├── 1
├── 2
└── 3
tree 2: 
4
├── 2
│   ├── 0
│   └── 1
└── 3

These inputs lead to a Division by Zero error.

See Traceback.

Traceback

for Example 2, this resulted in a ZeroDivisionError in the very last line of the ad function.

def ad(df_grnd, df_sol): ... return 1 - len(error_pairs) / n_adpairs ZeroDivisionError: division by zero

Version

0.0.2

Unofficial fork at
https://github.com/pawel-czyz/scphylo-tools

One (very likely minor) glitch in scphylo tools

Description

schphylo might be having some small special case not handled as such. For example, it breaks if the input consists of all ones. When I changed just one of the 1s to zero in the input, everything was fine.

Minimal reproducible example

mport scphylo
import trisicell as tsc
df_input = scphylo.io.read("temp_scistree.tsv")
alpha = 0.001
beta  = 0.2
conflict_free_matrix = scphylo.tl.scistree(df_input, alpha, beta, experiment=False)
tree = tsc.ul.to_tree(conflict_free_matrix)
tsc.pl.dendro_tree(tree)

Traceback

```pytb /opt/anaconda3/lib/python3.9/site-packages/scphylo/ul/_utils.py:199: RuntimeWarning: invalid value encountered in long_scalars fp_rate = flips_1_0 / ((O_mtr == 0) & (I_mtr != na_value)).sum() --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) /var/folders/tz/mbg7wd2j7y3_2_wnm_nqct0dbyjdwz/T/ipykernel_53152/1760782317.py in 13 print(conflict_free_matrix.index) 14 ---> 15 tree = tsc.ul.to_tree(conflict_free_matrix) 16 tsc.pl.dendro_tree(tree) 17

/opt/anaconda3/lib/python3.9/site-packages/trisicell/ul/_trees.py in to_tree(df)
29
30 if not tsc.ul.is_conflict_free_gusfield(df):
---> 31 tsc.logg.error("The input is not conflict-free!")
32
33 def _contains(col1, col2):

/opt/anaconda3/lib/python3.9/site-packages/trisicell/logging/_logging.py in error(*args, **kwargs)
17 args = ("Error:",) + args
18 msg(*args, v="error", **kwargs)
---> 19 raise RuntimeError
20
21

</details>

### Version
<!-- Output of scphylo.__version__ -->
...

MLTD Accuracy - normalized / similarity out of one ?

Hi Farid - just a minor suggestion about the MLTD.

scphylo.tl.mltd(df1, df2)

Compared to the other distances you provide, it does not say what the range of the output is,
I notice most of the other distances state "Similarity out of one."

As I understand the MLTD paper, it may or may not be normalized to be in the range [0,1].

Which do you implement? - Perhaps worth adding to the docstring.

Kindest Regards,

Gordon

check why RF=0 in some instances?

ground = scp.io.read('morita_fig3f/ground.CFMatrix')
inferred = scp.io.read('morita_fig3f.huntress.CFMatrix')
scp.tl.rf(ground, inferred)

check why output is CF but score is not?

ground = scp.io.read('scphylo-tools/todo/problems/2/morita_fig3f.ground.CFMatrix')
inferred = scp.io.read('scphylo-tools/todo/problems/2/i_1.siclonefit.CFMatrix')
scp.tl.tpted(ground, inferred)

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.