faridrashidi / scphylo-tools Goto Github PK
View Code? Open in Web Editor NEWa python toolkit for single-cell tumor phylogenetic analysis
Home Page: https://scphylo-tools.readthedocs.io
License: BSD 3-Clause "New" or "Revised" License
a python toolkit for single-cell tumor phylogenetic analysis
Home Page: https://scphylo-tools.readthedocs.io
License: BSD 3-Clause "New" or "Revised" License
...
...
...
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
Running the scphylo.tl.ad()
returns wrong values and division by zero errors.
Confident about the usage of input, see examples.
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:
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.
for Example 2, this resulted in a ZeroDivisionError
in the very last line of the ad
function.
0.0.2
Unofficial fork at
https://github.com/pawel-czyz/scphylo-tools
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.
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)
/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__ -->
...
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
ground = scp.io.read('morita_fig3f/ground.CFMatrix')
inferred = scp.io.read('morita_fig3f.huntress.CFMatrix')
scp.tl.rf(ground, inferred)
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)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.