Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ Running PhyloWGS

2. Compile the C++ file.

g++ -o mh.o -O3 mh.cpp util.cpp `gsl-config --cflags --libs`
g++ -o phylowgs_mh -O3 mh.cpp util.cpp `gsl-config --cflags --libs`

3. Run PhyloWGS. Minimum invocation on sample data set:

Expand Down
10 changes: 10 additions & 0 deletions conda/phylowgs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

mkdir -p $PREFIX/bin

g++ -g -o phylowgs_mh -O3 mh.cpp util.cpp `gsl-config --cflags --libs`

cp phylowgs_mh $PREFIX/bin/phylowgs_mh

$PYTHON setup.py install

2 changes: 2 additions & 0 deletions conda/phylowgs/cnv_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cnv a d ssms physical_cnvs
c0 66023,50883,62757,36056,58777 126755,100469,121941,71263,115417 s2,1,2;s4,0,1 chrom=1,start=1234,end=5678,major_cn=2,minor_cn=1,cell_prev=0.8;chrom=X,start=15,end=10000,major_cn=2,minor_cn=0,cell_prev=0.8;chrom=22,start=123,end=456,major_cn=1,minor_cn=0,cell_prev=0.8
27 changes: 27 additions & 0 deletions conda/phylowgs/meta.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package:
name: phylowgs
version: 'smchet5'

source:
git_url: https://github.com/morrislab/phylowgs.git
git_rev: smchet5

requirements:
build:
- python
- gsl
run:
- python
- numpy
- scipy
- ete2
- gsl

build:
number: 1

about:
home: https://github.com/morrislab/phylowgs.git
license: GPL
summary: Application for inferring subclonal composition and evolution from whole-genome sequencing data.

3 changes: 3 additions & 0 deletions conda/phylowgs/run_test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

phylowgs_evolve -B 10 -s 10 -i 10 $RECIPE_DIR/ssm_data.txt $RECIPE_DIR/cnv_data.txt
12 changes: 12 additions & 0 deletions conda/phylowgs/ssm_data.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
id gene a d mu_r mu_v
s0 a 66023,50883,62757,36056,58777 126755,100469,121941,71263,115417 0.999 0.5
s1 b 71532,50933,64719,52048,83311 135031,97485,120826,101788,157737 0.999 0.5
s2 c 93057,61406,72640,61648,54961 106716,83179,83799,86440,84607 0.999 0.5
s3 GOLGA7B 31531,40281,18089,34256,36473 72221,84463,37410,73050,76869 0.999 0.5
s4 KHNYN 94954,74636,67529,42328,59678 116386,106518,83271,66152,94465 0.999 0.5
s5 NPHP4 9653,2300,4506,3559,3695 112775,79087,84707,92076,95849 0.999 0.5
s6 NPM1 9072,2953,4140,5150,5270 127079,112052,86626,137055,185970 0.999 0.5
s7 OLFM2 36288,28055,26648,35692,26492 74007,58150,56286,76579,54844 0.999 0.5
s8 PYHIN1 75935,106216,153378,115054,112006 76826,111139,155389,123305,119960 0.999 0.5
s9 RHCG 28543,31070,57616,34454,40929 51929,64677,116465,68393,79788 0.999 0.5
s10 SMC1A 54447,39896,60454,63950,48658 82781,73370,92894,120384,89511 0.999 0.5
4 changes: 2 additions & 2 deletions mh.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

using namespace std;

// g++ -o mh.o mh.cpp util.cpp `gsl-config --cflags --libs`
// ./mh.o 5000 100 11 1 8 4 ssm_data.txt cnv_data.txt c_tree_ssm_data_1.txt c_data_states_ssm_data_1.txt c_params.txt 5
// g++ -o phylowgs_mh mh.cpp util.cpp `gsl-config --cflags --libs`
// ./phylowgs_mh 5000 100 11 1 8 4 ssm_data.txt cnv_data.txt c_tree_ssm_data_1.txt c_data_states_ssm_data_1.txt c_params.txt 5
//https://www.gnu.org/software/gsl/manual/html_node/Shared-Libraries.html


Expand Down
Empty file added phylowgs/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions params.py → phylowgs/params.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ def metropolis(tssb,iters=1000,std=0.01,burnin=0,n_ssms=0,n_cnvs=0,fin1='',fin2=
NNODES = str(len(nodes))
TREE_HEIGHT = str(max([node.ht for node in nodes])+1)

script_dir = os.path.dirname(os.path.realpath(__file__))
sp.check_call(['%s/mh.o' % script_dir, MH_ITR, MH_STD, N_SSM_DATA, N_CNV_DATA, NNODES, TREE_HEIGHT, FNAME_SSM_DATA, FNAME_CNV_DATA, FNAME_C_TREE, FNAME_C_DATA_STATES, FNAME_C_PARAMS,FNAME_C_MH_ARATIO, NTPS])
sp.check_call(['phylowgs_mh', MH_ITR, MH_STD, N_SSM_DATA, N_CNV_DATA, NNODES, TREE_HEIGHT, FNAME_SSM_DATA, FNAME_CNV_DATA, FNAME_C_TREE, FNAME_C_DATA_STATES, FNAME_C_PARAMS,FNAME_C_MH_ARATIO, NTPS])
ar = str(loadtxt(FNAME_C_MH_ARATIO,dtype='string'))
update_tree_params(tssb,FNAME_C_PARAMS) # update the tree with the new parameters sampled using the c++ code

Expand Down
File renamed without changes.
Empty file added phylowgs/parser/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions pwgsresults/result_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import sys
import os
sys.path.append(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..'))
import util2
import phylowgs.util2
import json

class ResultGenerator(object):
def generate(self, tree_file, include_ssm_names):
reader = util2.TreeReader(tree_file)
reader = phylowgs.util2.TreeReader(tree_file)
first_tree = next(reader.load_trees())
cnv_logical_physical_mapping = json.loads(reader.read_extra_file('cnv_logical_physical_mapping.json'))
try:
Expand All @@ -35,7 +35,7 @@ def generate(self, tree_file, include_ssm_names):
return summaries, mutlist, all_mutass, params

def _summarize_all_pops(self, tree_file):
reader = util2.TreeReader(tree_file)
reader = phylowgs.util2.TreeReader(tree_file)
for idx, llh, tree in reader.load_trees_and_metadata(remove_empty_vertices = True):
yield (idx, llh) + self._summarize_pops(tree)
reader.close()
Expand Down
18 changes: 18 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from setuptools import setup, find_packages

setup(
name='phylowgs',
packages=find_packages(),
description='Application for inferring subclonal composition and evolution from whole-genome sequencing data.',
keywords=[],
classifiers=[],
entry_points={
'console_scripts': [
'phylowgs_evolve = phylowgs.evolve:main',
'phylowgs_write_results = phylowgs.write_results:main',
'phylowgs_create_inputs = phylowgs.parser.create_phylowgs_inputs:main',
'phylowgs_parse_cnvs = phylowgs.parser.parse_cnvs:main',
],
},
)