Code Monkey home page Code Monkey logo

favites's Introduction

My name is (Alexander) Niema Moshiri, and I am an Associate Teaching Professor in the Computer Science & Engineering Department at the University of California, San Diego. I work on computational biology, with a research focus on viral phylogenetics and epidemiology. I also place a heavy emphasis on teaching, namely on the development of online educational content, primarily Massive Adaptive Interactive Texts (MAITs). You can find more information about me on my website or in my Curriculum Vitae (CV).

favites's People

Contributors

niemasd avatar smirarab avatar

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

Watchers

 avatar  avatar  avatar  avatar  avatar

favites's Issues

Allow user to specify sample times in file

Create module implementations NumTimeSample_File and TimeSample_File such that the user can provide a sample_times_file in the FAVITES config file. Perhaps the sample times file should be a TSV where column 1 is an individual's name and column 2 is a sample time. Individuals can have multiple sample times by having multiple rows, e.g.:

A<TAB>1
A<TAB>2
A<TAB>3
B<TAB>4
C<TAB>5

Singularity Compatible Version of Favites Issue

I was trying to run singularity version of Favites.
I ran Favites on my Comet account on login and computing node. In both cases, I got the error message " ERROR: Configuration disallows users from running directory based containers
ABORT : Retval = 255".
I ran it in my home directory on Comet and simply using the following command:
python3 run_favites_singularity.py -c example_config.json -u 1.1.10

Sampling times file not found

When using the TimeSample_File module, FAVITES cannot find the sampling times file.

FAVITES Version

1.2.9

Environment

Mac OS Catalina, using Docker

Configuration File

Config, contact network, transmission network, and sampling times file attached.
config_noSeqs_sampleTimes.json.zip
contact_network_file.txt.zip
sampling_times.txt.zip
transmission_network_file.txt.zip

Unexpected Behavior

I expected FAVITES to read in the sampling times file and then use those times, rather than generate its own. FAVITES appears to incorrectly call the sampling times file. If I swap out TimeSample_File with TimeSample_End and NumTimeSample_File with NumTimeSample_Once, everything works perfectly.

Traceback (most recent call last):
  File "/FAVITES/run_favites.py", line 75, in <module>
    MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
  File "/FAVITES/modules/Driver_Default.py", line 68, in run
    MF.modules[module].init()
  File "/FAVITES/modules/NumTimeSample_File.py", line 22, in init
    GC.sample_times_lines = [i.strip().split() for i in open(expanduser(GC.sample_time_file)) if len(i.strip()) > 0 and i[0] != '#']
FileNotFoundError: [Errno 2] No such file or directory: 'sampling_times.txt'

example config file now working

Starting from FAVITES's own example config file: https://github.com/niemasd/FAVITES/blob/master/example/example_config.json

on a fresh docker install I get:

run_favites_docker.py -c example_config.json
Traceback (most recent call last):
  File "/FAVITES/run_favites.py", line 72, in <module>
    parseArgs()
  File "/FAVITES/run_favites.py", line 64, in parseArgs
    MF.read_config(config, config['verbose'])
  File "/FAVITES/modules/FAVITES_ModuleFactory.py", line 39, in read_config
    assert req in config, "Parameter %r of %s_%s module is not in the configuration file!" % (req, module, config[module])
AssertionError: Parameter 'vts_max_attempts' of NodeEvolution_VirusTreeSimulator module is not in the configuration file!

FAVITES Version

1.1.5

Environment

Docker on MAC

Configuration File

https://github.com/niemasd/FAVITES/blob/master/example/example_config.json

Unexpected Behavior

see above

Enquiry about backward-in-time models

FAVITES Version

1.2.7

Environment

Singularity on HPC

Configuration File

{
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "File",
"Driver": "Default",
"EndCriteria": "TransmissionFile",
"Logging": "FileSTDOUT",
"NodeAvailability": "Perfect",
"NodeEvolution": "VirusTreeSimulator",
"NumBranchSample": "Single",
"NumTimeSample": "Once",
"PostValidation": "Dummy",
"SeedSelection": "TransmissionFile",
"SeedSequence": "NoSeqs",
"SequenceEvolution": "NoSeqs",
"Sequencing": "NoSeqs",
"SourceSample": "Random",
"TimeSample": "Uniform",
"TransmissionNodeSample": "TransmissionFile",
"TransmissionTimeSample": "TransmissionFile",
"TreeNode": "Simple",
"TreeUnit": "Same",
"contact_network_file": "/share/home/jianglab/huangsisi/usr/test/out134/tree/contact_network.txt.gz",
"transmission_network_file": "/share/home/jianglab/huangsisi/usr/test/out134/tree/transmission_network.txt.gz",
"out_dir": "/share/home/jianglab/huangsisi/usr/test/out134/tree",
"gemf_path": "GEMF",
"grinder_path": "grinder",
"hmmemit_path": "hmmemit",
"java_path": "/usr/bin/java",
"nw_rename_path": "nw_rename",

"vts_growthRate": 0,
"vts_max_attempts": 1000,
"vts_model": "constant",
"vts_n0": 1,
"vts_t50": -99999,
"tree_mutation_rate": 0.0008,
"end_time": 100/365

}

Unexpected Behavior

I have successfully simulated the contact network and transmission network using FAVITES. However, I do not know how to run backward-in-time models of evolution to generate the viral time-based phylogeny using VirusTreeSimulator. I have placed the contact_network.txt.gz and transmission_network.txt.gz to the corresponding output directory /share/home/jianglab/huangsisi/usr/test/out134/tree/ and run FAVITES. It failed the run and gave FAVITES.log that looked like this

image

It stopped at Sampling patients in time. I suppose I do not understand how exactly the pipeline works. How could I generate the viral time-based phylogeny using VirusTreeSimulator (preferably with an example)?

Create script to run Docker via Singularity

Lots of HPC resources (namely SDSC/Comet/TSCC/etc.) don't allow Docker for security reasons, so run_favites_docker.py doesn't work on these platforms. Need to make a similar script (run_favites_singularity.py) to run the FAVITES via Singularity, ideally using the same DockerHub image (to keep things clean and consistent)

float('inf') in CONFIG file doesn't work in run_favites_docker.py (and potentially Singularity)

Niemas-Air:Desktop niema$ ~/GitHub/FAVITES/run_favites_docker.py -u -c CONFIG.json
Pulling Docker image (1.1.34)... done
Removing old Docker images... done
Traceback (most recent call last):
  File "/FAVITES/run_favites.py", line 72, in <module>
    parseArgs()
  File "/FAVITES/run_favites.py", line 24, in parseArgs
    config = eval(ORIG_CONFIG)
  File "<string>", line 1, in <module>
NameError: name 'inf' is not defined

Example files output directory

All example config files should change so that they write to the current directory instead of ~/

Besides possible issues with portability (not sure about that), it's not good to write something to people's home out of blue.

"KeyError: 'None'", for my Transmission Network File

FAVITES Version

FAVITES version 1.1.35

Environment

macOS Catalina 10.15, and using Docker

Configuration File

Config file:
FAVITES_config.json.txt

The transmission network and contact network files:
transmission_network_file.txt
contact_network_file.txt

Unexpected Behavior

Loaded my own Transmission Network and Contact Network Files. FAVITES seemed unable to correctly parse "None" from the Transmission Network file when reading seed infections.

Error message:

======================== Simulation Process ========================
Loading contact network... done
Creating ContactNetwork object... done
Selecting seed nodes... done
Infecting seed nodes... done
Performing transmission simulations...Traceback (most recent call last):
File "/FAVITES/run_favites.py", line 75, in
MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
File "/FAVITES/modules/Driver_Default.py", line 164, in run
u,v = MF.modules['TransmissionNodeSample'].sample_nodes(t)
File "/FAVITES/modules/TransmissionNodeSample_TransmissionFile.py", line 26, in sample_nodes
return GC.contact_network.get_node(u), GC.contact_network.get_node(v)
File "/FAVITES/modules/ContactNetwork_NetworkX.py", line 134, in get_node
return Node(self, name, self.name_to_num[name])
KeyError: 'None'

Deprecated DendroPy function usage

For example:

/FAVITES/modules/SeedSequence_VirusBirthDeathGTRCodon.py:44: CriticalDeprecationWarning: Deprecated: 'ntax' is no longer supported as an argument to this function. Use one or more of the following instead: 'num_extant_tips', 'num_extinct_tips', 'num_total_tips', or 'max_time'

  treestr = treesim.birth_death_tree(birth_rate=GC.seed_birth_rate, death_rate=GC.seed_death_rate,ntax=len(GC.seed_nodes)).as_string(schema='newick')

Does not properly identify seed nodes

FAVITES Version

1.2.0

Environment

Docker

Configuration File

toy_SAPHIRE.json.zip

Unexpected Behavior

I set up 20000 nodes fro the contact network, 1 seed "P" node, and 19999 susceptible "S" nodes, but FAVITES identified the network as having 20000 seed nodes, rather than 1.

Error message:

Performing transmission simulations...Traceback (most recent call last):
File "/FAVITES/run_favites.py", line 75, in
MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
File "/FAVITES/modules/Driver_Default.py", line 160, in run
t = MF.modules['TransmissionTimeSample'].sample_time()
File "/FAVITES/modules/TransmissionTimeSample_SAPHIREGEMF.py", line 64, in sample_time
return TransmissionTimeSample_SAAPPHIIREGEMF.sample_time()
File "/FAVITES/modules/TransmissionTimeSample_SAAPPHIIREGEMF.py", line 227, in sample_time
TransmissionTimeSample_SAAPPHIIREGEMF.prep_GEMF()
File "/FAVITES/modules/TransmissionTimeSample_SAAPPHIIREGEMF.py", line 137, in prep_GEMF
assert len(start_states['seed']) == len(GC.seed_nodes), "At time 0, P1+P2+I1+I2+A1+A2 = %d, but there are %d seed nodes. Fix saapphiire_freq_* parameters accordingly" % (len(start_states['seed']),len(GC.seed_nodes))
AssertionError: At time 0, P1+P2+I1+I2+A1+A2 = 20000, but there are 1 seed nodes. Fix saapphiire_freq_* parameters accordingly

Issue with label_internal_nodes helper script

FAVITES Version

Not necessary.

Environment

Not necessary.

Configuration File

No config file needed. I've included an example tree, transmission network, and resulting tree after running the script instead.

transmission_network.txt
tree_217.time.tre.zip
tree_217.time.labelInternal.tree.zip

Unexpected Behavior

I was working on some stuff where I had to label internal nodes, and had been using your helper script from FAVITES, but I noticed I was getting some funky labels, where sometimes an internal node would be labeled by someone who wasn't yet infected. There isn't an error message for this.

I think the issue is where you read in the transmission network. You use the following code:

# read seeds and infection times from transmission network
tn = open(tn_path)
inf = {None:float('inf')}; seeds = set()
for l in tn:
    if isinstance(l,bytes):
        u,v,t = l.decode().strip().split('\t')
    else:
        u,v,t = l.strip().split('\t')
    if u == 'None':
        seeds.add(v); inf[v] = float('-inf')
    else:
        inf[v] = float(t)

However, in the final line, if you've already read in a node when it was infected, but then the node recovered or was removed from the network, you would rewrite the infection time as this recovery/leaving time. If I add the following if statement to the last line, I find the issue to be resolved.

if v not in inf.keys(): 
    inf[v] = float(t)

I could be misunderstanding though?

Starting at later steps of workflow

Can already give it contact network and transmission network from file. Add ability to give it tree as well, and then also give it (error-free) sequences as well

Kill VirusTreeSimulator after x number of failures to coalesce

VirusTreeSimulator infinite-loops if it keeps failing to coalesce the lineages. Add a way to kill VirusTreeSimulator (and throw an error) if it fails to coalesce after x attempts.

Configuration File

{
    "ContactNetwork":                "NetworkX",

    "ContactNetworkGenerator":       "Complete",
    "num_cn_nodes":                  10,

    "Driver":                        "Default",
    "out_dir":                       "out_NumBranchSample_Fixed",

    "EndCriteria":                   "Transmissions",
    "end_transmissions":             5,

    "Logging":                       "STDOUT",

    "NodeAvailability":              "Perfect",

    "NodeEvolution":                 "VirusTreeSimulator",
    "java_path":                     "java",
    "vts_growthRate":                2.851904,
    "vts_model":                     "constant",
    "vts_n0":                        100000,
    "vts_t50":                       -2,

    "NumBranchSample":               "Fixed",
    "num_viruses_per_cn_sample":     2,

    "NumTimeSample":                 "Once",

    "SeedSelection":                 "Random",
    "num_seeds":                     2,

    "SeedSequence":                  "Random",
    "seed_sequence_length":          10,

    "SequenceEvolution":             "NoMutation",

    "Sequencing":                    "Perfect",

    "SourceSample":                  "Random",

    "TimeSample":                    "End",

    "TransmissionNodeSample":        "RandomSingleInfection",

    "TransmissionTimeSample":        "Fixed",
    "fixed_transmission_time_delta": 1,

    "TreeNode":                      "Simple",

    "TreeUnit":                      "Same",
}

running error on local machibe

running error on local machine

FAVITES Version

latest (Feb 13th, 2018 )

Environment

Mac OS

Configuration File

Unexpected Behavior

{
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "RandonPartitionGraph",
"Driver": "Default",
"EndCriteria": "GEMF",
"Logging": "File",
"NodeAvailability": "Perfect",
"NodeEvolution": "None",
"NumBranchSample": "Single",
"NumTimeSample": "Once",
"SeedSelection": "Random",
"SeedSequence": "Random",
"SequenceEvolution": "NoMutation",
"seed_sequence_length": 1,
"Sequencing": "Perfect",
"SourceSample": "Random",
"TimeSample": "End",
"TransmissionNodeSample": "GEMF",
"TransmissionTimeSample": "HIVARTGranichGEMF",
"TreeNode": "Simple",
"TreeUnit": "LogNormal",
"end_time": 70,
"rpg_sizes": [20,20,20],
"rpg_p_in": 0.1,
"rpg_p_out": 0.002,
"d_or_u": "u",
"gemf_path": "GEMF",
"grinder_path": "grinder",
"hiv_a1_to_a2": 4.333333333333333,
"hiv_a1_to_d": 0,
"hiv_a1_to_i1": 0.48,
"hiv_a2_to_a3": 0,
"hiv_a2_to_d": 0,
"hiv_a2_to_i2": 0.48,
"hiv_a3_to_a4": 0,
"hiv_a3_to_d": 0,
"hiv_a3_to_i3": 0,
"hiv_a4_to_d": 0,
"hiv_a4_to_i4": 0,
"hiv_i1_to_a1": 0.5,
"hiv_i1_to_d": 0,
"hiv_i1_to_i2": 8.666666666666666,
"hiv_i2_to_a2": 0.5,
"hiv_i2_to_d": 0,
"hiv_i2_to_i3": 0,
"hiv_i3_to_a3": 0,
"hiv_i3_to_d": 0,
"hiv_i3_to_i4": 0,
"hiv_i4_to_a4": 0,
"hiv_i4_to_d": 0,
"hiv_ns_to_d": 0,
"hiv_ns_to_s": 999999,
"hiv_s_to_d": 0,
"hiv_s_to_i1_by_a1": 0.005625,
"hiv_s_to_i1_by_a2": 0,
"hiv_s_to_i1_by_a3": 0,
"hiv_s_to_i1_by_a4": 0,
"hiv_s_to_i1_by_i1": 0.25,
"hiv_s_to_i1_by_i2": 0.05,
"hiv_s_to_i1_by_i3": 0,
"hiv_s_to_i1_by_i4": 0,
"hiv_s_to_i1_seed": 0,
"hmmemit_path": "hmmemit",
"java_path": "java",
"num_seeds": 1,
"nw_rename_path": "nw_rename",
"out_dir": "FAVITES_output_test3",
"seed_population": 20,
"seqgen_a_to_c": 1.765707,
"seqgen_a_to_g": 9.587649,
"seqgen_a_to_t": 0.691915,
"seqgen_c_to_g": 0.863348,
"seqgen_c_to_t": 10.282617,
"seqgen_freq_a": 0.392,
"seqgen_freq_c": 0.165,
"seqgen_freq_g": 0.212,
"seqgen_freq_t": 0.232,
"seqgen_g_to_t": 1.0,
"seqgen_gamma_shape": 0.405129,
"seqgen_num_gamma_rate_categories": "",
"seqgen_path": "seq-gen",
"tree_rate_mean": -5.5,
"tree_rate_stdev": 0.2,
"viral_sequence_type": "HIV1-B-DNA-POL-LITTLE",
"vts_growthRate": 2.851904,
"vts_model": "logistic",
"vts_n0": 1,
"vts_t50": -2,
"num_cn_nodes" "100"
"ws_k" "3"
"ws_prob" "0.02"
"PostValidation": "Dummy"
}

run_favites_docker.py -c Config-small-rp.json -u -v
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1316, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1017, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 955, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/http/client.py", line 1391, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 410, in wrap_socket
_session=session
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 821, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 1075, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/ssl.py", line 696, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:864)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/run_favites_docker.py", line 11, in
DOCKER_LATEST_TAG = sorted([t for t in urlopen("https://hub.docker.com/r/%s/tags/"%DOCKER_IMAGE).read().decode('utf-8').split('"tags":')[1].split(':')[-1][1:-2].replace('"','').split(',') if '.' in t])[-1]
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 543, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1359, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 1318, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:864)>

zipped trees seem to have issues (under error_free_files/phylogenetic_trees)

cat ./merged*
:0.0;
:0.0

path: .../error_free_files/phylogenetic_trees

FAVITES Version

Version 1.1.1

Environment

Mac

Configuration File

{'vts_max_attempts': 100, 'SequenceEvolution': 'GTRGammaSeqGen', 'tree_rate_mean': -6.164, 'gemf_path': 'GEMF', 'rpg_p_in': 0.004, 'vts_model': 'logistic', 'hiv_i2_to_i3': 0, 'TreeUnit': 'LogNormal', 'seqgen_a_to_t': 0.691915, 'TransmissionTimeSample': 'HIVARTGranichGEMF', 'hmmemit_path': 'hmmemit', 'rpg_p_out': 0.0002, 'hiv_i3_to_d': 0, 'hiv_a2_to_i2': 0.48, 'hiv_s_to_i1_by_a3': 0, 'num_seeds': 50, 'seqgen_num_gamma_rate_categories': '', 'ContactNetwork': 'NetworkX', 'hiv_a1_to_a2': 4.33333, 'hiv_a1_to_d': 0, 'hiv_s_to_i1_seed': 0, 'hiv_a1_to_i1': 0.48, 'hiv_i1_to_i2': 8.666666666666666, 'hiv_i3_to_i4': 0, 'seqgen_freq_t': 0.232, 'hiv_a3_to_d': 0, 'hiv_s_to_i1_by_a1': 0.005625, 'Logging': 'File', 'seqgen_c_to_t': 10.282617, 'TreeNode': 'Simple', 'seqgen_path': 'seq-gen', 'seqgen_a_to_g': 9.587649, 'verbose': False, 'seqgen_gamma_shape': 0.405129, 'rpg_sizes': [10000, 10000, 10000, 10000, 10000], 'hiv_i4_to_d': 0, 'hiv_ns_to_d': 0, 'hiv_s_to_i1_by_i4': 0, 'hiv_a4_to_d': 0, 'hiv_s_to_i1_by_i3': 0, 'NumTimeSample': 'Once', 'ContactNetworkGenerator': 'RandomPartitionGraph', 'hiv_a2_to_d': 0, 'nw_rename_path': 'nw_rename', 'Sequencing': 'Perfect', 'end_time': 10, 'PostValidation': 'Dummy', 'out_dir': '/OUTPUT_DIR', 'TimeSample': 'GranichFirstART', 'hiv_a3_to_i3': 0, 'SeedSequence': 'VirusPureCoalescentGTRGamma', 'hiv_i1_to_d': 0, 'hiv_s_to_i1_by_a2': 0, 'viral_sequence_type': 'HIV1-B-DNA-POL-LITTLE', 'NodeAvailability': 'Bernoulli', 'NumBranchSample': 'Single', 'hiv_ns_to_s': 999999, 'hiv_s_to_i1_by_i1': 0.1125, 'NodeEvolution': 'VirusTreeSimulator', 'SourceSample': 'Random', 'seqgen_freq_c': 0.165, 'hiv_a2_to_a3': 0, 'hiv_s_to_i1_by_a4': 0, 'hiv_i3_to_a3': 0, 'java_path': 'java', 'vts_t50': -2, 'hiv_i4_to_a4': 0, 'seqgen_c_to_g': 0.863348, 'hiv_i1_to_a1': 0.5, 'Driver': 'Default', 'grinder_path': 'grinder', 'seqgen_freq_g': 0.212, 'hiv_a4_to_i4': 0, 'hiv_i2_to_d': 0, 'TransmissionNodeSample': 'GEMF', 'hiv_s_to_i1_by_i2': 0.0225, 'd_or_u': 'u', 'EndCriteria': 'GEMF', 'vts_growthRate': 2.851904, 'seed_population': 20, 'hiv_a3_to_a4': 0, 'hiv_s_to_d': 0, 'random_number_seed': '', 'hiv_i2_to_a2': 0.5, 'tree_rate_stdev': 0.3, 'seqgen_a_to_c': 1.765707, 'seqgen_g_to_t': 1.0, 'seqgen_freq_a': 0.392, 'SeedSelection': 'Random', 'node_sample_prob': 0.1, 'vts_n0': 1}

Unexpected Behavior

content of merged phylogeny trees are copied above. Although every seed tree seems to be fine. Below I copy one of them for instance:

cat tree_9.*

(N96769|20612|1.166455:0):10.0;

(N96769|20612|1.166455:0.0):0.021674349495173547;

config_designer.py fails to write JSON

Running config_designer.py to try generating a JSON with configuration from Miller et al. paper supplement. Interface failed to launch file dialog. It seems to me that this script is importing a function from tkinter.filedialog but not the filedialog submodule itself:

art@Wernstrom FAVITES % grep -n filedialog config_designer.py
6:from tkinter.filedialog import asksaveasfile
135:    f = filedialog.asksaveasfile(mode='w', defaultextension=".json")

so when this submodule is called on line 135 then Python throws an exception (see above).
I think line 135 should be:

    f = asksaveasfile(mode='w', defaultextension=".json")

FAVITES Version

df946c8

Environment

macOS 12.5.1, manually installed FAVITES from git clone

Configuration File

Not applicable, I was running the config_designer.py interface to generate a config file.

Unexpected Behavior

art@Wernstrom FAVITES % python3 config_designer.py 
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/local/Cellar/[email protected]/3.10.6_1/Frameworks/Python.framework/Versions/3.10/lib/python3.10/tkinter/__init__.py", line 1921, in __call__
    return self.func(*args)
  File "/Users/art/git/FAVITES/config_designer.py", line 135, in save_file
    f = filedialog.asksaveasfile(mode='w', defaultextension=".json")
NameError: name 'filedialog' is not defined

Seed trees may need root branches added

Specific example is VirusTreeSimulator: no root edge, so when trees are merged with seed tree by SeedSequence module, the concatenation of the leaf branch of the seed tree to the corresponding root of the individual tree is typically too short

AssertionError in run_favites.py manually

cannot run_favites.py manually

FAVITES Version

1.1.3

Environment

ubuntu

Configuration File

{
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "RandomPartitionGraph",
"d_or_u": "u",

"rpg_p_in": 0.004,
"rpg_p_out": 0.0002,
"rpg_sizes": [1000,1000,1000,1000,1000],
"end_time": 10,
"num_seeds": 50,
"out_dir": "output_1_1",
"vts_max_attempts": 100,

"Driver": "Default",
"EndCriteria": "GEMF",
"Logging": "File",

"NodeAvailability": "Bernoulli",
"node_sample_prob": 0.1,
"NumBranchSample": "Single",
"NumTimeSample": "Once",
"SourceSample": "Random",
"TimeSample": "GranichFirstART",

"NodeEvolution": "VirusTreeSimulator",
"vts_growthRate": 2.851904,
"vts_model": "logistic",
"vts_n0": 1,
"vts_t50": -2,

"PostValidation": "Dummy",

"SeedSelection": "Random",

"SeedSequence": "VirusPureCoalescentGTRGamma",
"viral_sequence_type": "HIV1-B-DNA-POL-LITTLE",

"SequenceEvolution": "GTRGammaSeqGen",
"Sequencing": "Perfect",

"TransmissionNodeSample": "GEMF",
"hiv_a1_to_d": 0,
"hiv_a2_to_a3": 0,
"hiv_a2_to_d": 0,
"hiv_a1_to_i1": 0.48,
"hiv_a2_to_i2": 0.48,
"hiv_i2_to_a2": 0.5,
"hiv_i1_to_a1": 0.5,
"hiv_a3_to_a4": 0,
"hiv_a3_to_d": 0,
"hiv_a3_to_i3": 0,
"hiv_a4_to_d": 0,
"hiv_a4_to_i4": 0,
"hiv_i1_to_d": 0,
"hiv_i1_to_i2": 8.666666666666666,
"hiv_a1_to_a2": 4.33333,
"hiv_i2_to_d": 0,
"hiv_i2_to_i3": 0,
"hiv_i3_to_a3": 0,
"hiv_i3_to_d": 0,
"hiv_i3_to_i4": 0,
"hiv_i4_to_a4": 0,
"hiv_i4_to_d": 0,
"hiv_ns_to_d": 0,
"hiv_ns_to_s": 999999,
"hiv_s_to_d": 0,
"hiv_s_to_i1_by_a1": 0.005625,
"hiv_s_to_i1_by_a2": 0,
"hiv_s_to_i1_by_a3": 0,
"hiv_s_to_i1_by_a4": 0,
"hiv_s_to_i1_by_i1": 0.1125,
"hiv_s_to_i1_by_i2": 0.1,
"hiv_s_to_i1_by_i3": 0,
"hiv_s_to_i1_by_i4": 0,
"hiv_s_to_i1_seed": 0,
"TransmissionTimeSample": "HIVARTGranichGEMF",

"TreeNode": "Simple",
"TreeUnit": "LogNormal",
"tree_rate_mean": -6.164,
"tree_rate_stdev": 0.3,

"grinder_path": "grinder",
"gemf_path": "GEMF",
"hmmemit_path": "hmmemit",
"java_path": "java",
"nw_rename_path": "nw_rename",
"seqgen_path": "seq-gen",

"seed_population": 20,

"seqgen_a_to_c": 1.765707,
"seqgen_a_to_g": 9.587649,
"seqgen_a_to_t": 0.691915,
"seqgen_c_to_g": 0.863348,
"seqgen_c_to_t": 10.282617,
"seqgen_freq_a": 0.392,
"seqgen_freq_c": 0.165,
"seqgen_freq_g": 0.212,
"seqgen_freq_t": 0.232,
"seqgen_g_to_t": 1.0,
"seqgen_gamma_shape": 0.405129,
"seqgen_num_gamma_rate_categories": ""

}

Unexpected Behavior

Exception in thread "main" java.lang.UnsupportedClassVersionError: TransmissionTreeToVirusTree3 : Unsupported major.minor version 52.0
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:442)
at java.net.URLClassLoader.access$100(URLClassLoader.java:64)
at java.net.URLClassLoader$1.run(URLClassLoader.java:354)
at java.net.URLClassLoader$1.run(URLClassLoader.java:348)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:347)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:312)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
Traceback (most recent call last):
File "./run_favites.py", line 75, in
MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
File "./modules/Driver_Default.py", line 297, in run
File "./modules/SequenceEvolution_GTRGammaSeqGen.py", line 39, in finalize
File "./modules/SequenceEvolution_SeqGen.py", line 52, in finalize
AssertionError: No trees were generated

ERROR?

bash simulation_pipeline.sh ../../Data/Gleamviz/seedings.tsv ../../Data/Gleamviz/metadata_cities.tsv ../../FAVITES/run_favites_docker.py ../../Data/FAVITES/flu_spread_config.json simulation_output
Traceback (most recent call last):
File "/Users/lixingguang/Downloads/0_ggplot2/hzi-bifo/Phylogeography_Paper/Software/Simulation/../../FAVITES/run_favites_docker.py", line 105, in
o = check_output(['docker','images']).decode().splitlines()
File "/Users/lixingguang/opt/miniconda3/lib/python3.9/subprocess.py", line 424, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/Users/lixingguang/opt/miniconda3/lib/python3.9/subprocess.py", line 505, in run
with Popen(*popenargs, **kwargs) as process:
File "/Users/lixingguang/opt/miniconda3/lib/python3.9/subprocess.py", line 951, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "/Users/lixingguang/opt/miniconda3/lib/python3.9/subprocess.py", line 1821, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'docker'
gunzip: can't stat: FAVITES_output/error_free_files/sequence_data.fasta.gz (FAVITES_output/error_free_files/sequence_data.fasta.gz.gz): No such file or directory
gunzip: can't stat: FAVITES_output/error_free_files/transmission_network.txt.gz (FAVITES_output/error_free_files/transmission_network.txt.gz.gz): No such file or directory
gunzip: can't stat: FAVITES_output/error_free_files/phylogenetic_trees/tree_0.tre.gz (FAVITES_output/error_free_files/phylogenetic_trees/tree_0.tre.gz.gz): No such file or directory
gunzip: can't stat: FAVITES_output/error_free_files/phylogenetic_trees/tree_0.time.tre.gz (FAVITES_output/error_free_files/phylogenetic_trees/tree_0.time.tre.gz.gz): No such file or directory
gunzip: can't stat: FAVITES_output/seed_sequences.tsv.gz (FAVITES_output/seed_sequences.tsv.gz.gz): No such file or directory
Error in file(file, "r") : cannot open the connection
Calls: read.tree -> scan -> file
In addition: Warning message:
In file(file, "r") :
cannot open file 'FAVITES_output/error_free_files/phylogenetic_trees/tree_0.tre': No such file or directory
Execution halted
cp: FAVITES_output/error_free_files/sequence_data.fasta: No such file or directory
head: FAVITES_output/seed_sequences.tsv: No such file or directory
head: FAVITES_output/seed_sequences.tsv: No such file or directory

PANGEA doesn't work in Docker image

Configuration File

.travis_tests/test_PANGEA.json

Unexpected Behavior

/---------------------------------------------------------------------\
| FAVITES - FrAmework for VIral Transmission and Evolution Simulation |
|                            Version 1.0.3                            |
|                         Niema Moshiri 2017                          |
\---------------------------------------------------------------------/
========================   Simulation Process  ========================
Loading contact network...Traceback (most recent call last):
  File "/FAVITES/run_favites.py", line 75, in <module>
    MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
  File "/FAVITES/modules/Driver_Default.py", line 109, in run
    GC.cn_edge_list = MF.modules['ContactNetworkGenerator'].get_edge_list()
  File "/FAVITES/modules/ContactNetworkGenerator_PANGEA.py", line 58, in get_edge_list
    check_output([GC.Rscript_path,PANGEA_command_script], stderr=open(devnull,'w'))
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['Rscript', 'FAVITES_PANGEA_COMMAND.R']' returned non-zero exit status 1

Breaks when using "-u" in command line and not specifying the version

FAVITES Version

The issue is using "-u" without the version specified. When using "-u 1.1.35", it works.

Environment

OS 10.14, using Docker

Configuration File

Unexpected Behavior

When using "-u" in the command line input without the version specified, I get the following output. When using "-u 1.1.35", the program works correctly.

$ python3 run_favites_docker.py -c example/example_configNEW.json
ERROR: Output directory exists. Overwrite? All contents will be deleted. (y/n) y
Traceback (most recent call last):
File "/FAVITES/run_favites.py", line 72, in
parseArgs()
File "/FAVITES/run_favites.py", line 64, in parseArgs
MF.read_config(config, config['verbose'])
File "/FAVITES/modules/FAVITES_ModuleFactory.py", line 39, in read_config
assert req in config, "Parameter %r of %s_%s module is not in the configuration file!" % (req, module, config[module])
AssertionError: Parameter 'gemf_path' of EndCriteria_GEMF module is not in the configuration file!

Error on running run_favites.py

Hello,

I hope you're doing well. I've been attempting to execute the FAVITES model in a loop with my configuration files, aiming to generate 100 samples for each configuration on a MacBook Pro M1. However, I'm encountering an issue. When I execute run_favites.py in a loop, I encounter the following error:

GC.virus_history[virus.get_label()].append((time,self))
KeyError: 'N1'

Additionally, I attempted to use run_favites_docker.py, but ran into a connection issue with Docker.

Could you provide assistance or guidance on resolving these issues to successfully run your code? Your help would be greatly appreciated.

FAVITES Version

Environment

Configuration File

{'ContactNetwork': 'NetworkX',
'ContactNetworkGenerator': 'BarabasiAlbert',
'Driver': 'Default',
'EndCriteria': 'GEMF',
'Logging': 'STDOUT',
'NodeAvailability': 'Perfect',
'NodeEvolution': 'VirusTreeSimulator',
'NumBranchSample': 'Fixed',
'NumTimeSample': 'Once',
'SeedSelection': 'EdgeWeighted',
'SeedSequence': 'User',
'SequenceEvolution': 'GTRGammaSeqGen',
'Sequencing': 'Perfect',
'SourceSample': 'Random',
'TimeSample': 'End',
'TransmissionNodeSample': 'GEMF',
'TransmissionTimeSample': 'SIGEMF',
'TreeNode': 'Simple',
'TreeUnit': 'ConstantRate',
'end_time': 200,
'gemf_path': 'GEMF',
'hmmemit_path': 'hmmemit',
'java_path': 'java',
'num_cn_nodes': 100,
'num_edges_from_new': 1,
'num_seeds': 1,
'num_viruses_per_cn_sample': 10,
'out_dir': '/FAVITES_MOUNT/OUTPUT_DIR',
'seed_seqs': ['CACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAACACCTACAGCTGCCCTAGTGGTGTCGCAGTTACTCCGGATCCCACAAGCTGTCGTGGACATGGTAGCGGGGGCCCACTGGGGAGTCCTGGCGGGCCTTGCATACTATTCCATGGTGGGGAACTGGGCTAAGGTTTTGATTGTGATGCTGCTCTTTGCCGGCGTCGACGGGGAGACCCACACGACGGGGGGGTCGGCGGCCAAGAGTACTTTCAGGCTTACGAACATCTTTTCGCTAGGGCCGGCTCAGAAAATCCAGCTTATAA'],
'seir_beta_by_i': 0.01,
'seir_beta_seed': 0,
'seir_delta': 0.93,
'seir_lambda': 0.06,
'infection_rate': 0.05,
'si_beta_seed': 0,
'si_beta_by_i': 0.01,
'seqgen_a_to_c': 6.461945,
'seqgen_a_to_g': 16.399738,
'seqgen_a_to_t': 3.197035,
'seqgen_c_to_g': 0.750543,
'seqgen_c_to_t': 14.629816,
'seqgen_g_to_t': 1.0,
'seqgen_freq_a': 0.178159,
'seqgen_freq_c': 0.263322,
'seqgen_freq_g': 0.233821,
'seqgen_freq_t': 0.324698,
'seqgen_gamma_shape': 0.1,
'seqgen_num_gamma_rate_categories': '',
'seqgen_path': 'seq-gen',
'tree_mutation_rate': 0.01,
'ts_truncnorm_loc': 0.9,
'ts_truncnorm_scale': 5,
'vts_growthRate': 0.05,
'vts_max_attempts': 10000,
'vts_model': 'exponential',
'vts_n0': 1,
'vts_t50': -5.5,
'random_number_seed': '',
'verbose': False}

Unexpected Behavior

SOPHIConfig/exponential_SI_config_01.json
/Users/maryamkafi/Documents/PhD_Project/FAVITES-master/run_favites.py:50: UserWarning: Output directory specified in command line (FAVITES_output_expSI_contemp_T5_N5_E1_101) and config file (/FAVITES_MOUNT/OUTPUT_DIR). Command line will take precedence
warn("Output directory specified in command line (%s) and config file (%s). Command line will take precedence" % (args.out_dir, config['out_dir']))
ERROR: Output directory exists. Overwrite? All contents will be deleted. (y/n) y
/---------------------------------------------------------------------
| FAVITES - FrAmework for VIral Transmission and Evolution Simulation |
| Version 1.2.11 |
| Niema Moshiri 2017 |
---------------------------------------------------------------------/

======================== Simulation Process ========================
Loading contact network... done
Creating ContactNetwork object... done
Selecting seed nodes... done
Infecting seed nodes...Traceback (most recent call last):
File "/Users/maryamkafi/Documents/PhD_Project/FAVITES-master/run_favites.py", line 79, in
MF.modules['Driver'].run('/'.join(expanduser(abspath(argv[0])).split('/')[:-1]), ORIG_CONFIG)
File "/Users/maryamkafi/Documents/PhD_Project/FAVITES-master/./modules/Driver_Default.py", line 146, in run
node.infect(0.0,virus)
File "/Users/maryamkafi/Documents/PhD_Project/FAVITES-master/./modules/ContactNetworkNode_NetworkX.py", line 117, in infect
GC.virus_history[virus.get_label()].append((time,self))
KeyError: 'N1'
/Users/maryamkafi/Documents/PhD_Project/FAVITES-master/run_favites.py:50: UserWarning: Output directory specified in command line (FAVITES_output_expSI_contemp_T5_N5_E1_101) and config file (/FAVITES_MOUNT/OUTPUT_DIR). Command line will take precedence
warn("Output directory specified in command line (%s) and config file (%s). Command line will take precedence" % (args.out_dir, config['out_dir']))

running error on Calab

Sounds like problem with docker deamon or sth

FAVITES Version

Environment

Configuration File

{
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "RandomPartitionGraph",
"d_or_u": "u",

"rpg_p_in": 0.004,
"rpg_p_out": 0.0002,
"rpg_sizes": [1000,1000,1000,1000,1000],
"end_time": 10,
"num_seeds": 50,
"out_dir": "/Users/sepideh/FAVITES/output/set1/output_1_1",

"Driver": "Default",
"EndCriteria": "GEMF",
"Logging": "File",

"NodeAvailability": "Bernoulli",
"node_sample_prob": 0.1,
"NumBranchSample": "Single",
"NumTimeSample": "Once",
"SourceSample": "Random",
"TimeSample": "GranichFirstART",

"NodeEvolution": "VirusTreeSimulator",
"vts_growthRate": 2.851904,
"vts_model": "logistic",
"vts_n0": 1,
"vts_t50": -2,

"PostValidation": "Dummy",

"SeedSelection": "Random",

"SeedSequence": "VirusPureCoalescentGTRGamma",
"viral_sequence_type": "HIV1-B-DNA-POL-LITTLE",

"SequenceEvolution": "GTRGammaSeqGen",
"Sequencing": "Perfect",

"TransmissionNodeSample": "GEMF",
"hiv_a1_to_d": 0,
"hiv_a2_to_a3": 0,
"hiv_a2_to_d": 0,
"hiv_a1_to_i1": 0.48,
"hiv_a2_to_i2": 0.48,
"hiv_i2_to_a2": 0.5,
"hiv_i1_to_a1": 0.5,
"hiv_a3_to_a4": 0,
"hiv_a3_to_d": 0,
"hiv_a3_to_i3": 0,
"hiv_a4_to_d": 0,
"hiv_a4_to_i4": 0,
"hiv_i1_to_d": 0,
"hiv_i1_to_i2": 8.666666666666666,
"hiv_a1_to_a2": 4.33333,
"hiv_i2_to_d": 0,
"hiv_i2_to_i3": 0,
"hiv_i3_to_a3": 0,
"hiv_i3_to_d": 0,
"hiv_i3_to_i4": 0,
"hiv_i4_to_a4": 0,
"hiv_i4_to_d": 0,
"hiv_ns_to_d": 0,
"hiv_ns_to_s": 999999,
"hiv_s_to_d": 0,
"hiv_s_to_i1_by_a1": 0.005625,
"hiv_s_to_i1_by_a2": 0,
"hiv_s_to_i1_by_a3": 0,
"hiv_s_to_i1_by_a4": 0,
"hiv_s_to_i1_by_i1": 0.1125,
"hiv_s_to_i1_by_i2": 0.1,
"hiv_s_to_i1_by_i3": 0,
"hiv_s_to_i1_by_i4": 0,
"hiv_s_to_i1_seed": 0,
"TransmissionTimeSample": "HIVARTGranichGEMF",

"TreeNode": "Simple",
"TreeUnit": "LogNormal",
"tree_rate_mean": -6.164,
"tree_rate_stdev": 0.3,

"grinder_path": "grinder",
"gemf_path": "GEMF",
"hmmemit_path": "hmmemit",
"java_path": "java",
"nw_rename_path": "nw_rename",
"seqgen_path": "seq-gen",

"seed_population": 20,

"seqgen_a_to_c": 1.765707,
"seqgen_a_to_g": 9.587649,
"seqgen_a_to_t": 0.691915,
"seqgen_c_to_g": 0.863348,
"seqgen_c_to_t": 10.282617,
"seqgen_freq_a": 0.392,
"seqgen_freq_c": 0.165,
"seqgen_freq_g": 0.212,
"seqgen_freq_t": 0.232,
"seqgen_g_to_t": 1.0,
"seqgen_gamma_shape": 0.405129,
"seqgen_num_gamma_rate_categories": ""

}

Unexpected Behavior

run_favites_docker.py -c CONFIG1-1.json
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.35/images/json: dial unix /var/run/docker.sock: connect: permission denied
Traceback (most recent call last):
File "/calab_data/mirarab/home//sepideh/.bin/run_favites_docker.py", line 31, in
o = check_output(['docker','images']).decode().splitlines()
File "/usr/lib/python3.4/subprocess.py", line 620, in check_output
raise CalledProcessError(retcode, process.args, output=output)
subprocess.CalledProcessError: Command '['docker', 'images']' returned non-zero exit status 1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/calab_data/mirarab/home//sepideh/.bin/run_favites_docker.py", line 36, in
raise RuntimeError("docker images command failed\n%s"%e.output)
RuntimeError: docker images command failed
b''

run_favites_docker.py only works on Linux with sudo

I am trying to get FAVITES up and running to see if will satsify our needs (with potentially adding our only implementations). I have followed the Docker installation instructions. When I try running run_favites_docker.py --config config.json or run_favites_docker.py -u --config config.json I get the following error:

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.24/images/json: dial unix /var/run/docker.sock: connect: permission denied
Traceback (most recent call last):
File "/usr/local/bin/run_favites_docker.py", line 105, in
o = check_output(['docker','images']).decode().splitlines()
File "/home/ghart/anaconda3/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/home/ghart/anaconda3/lib/python3.8/subprocess.py", line 512, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['docker', 'images']' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/bin/run_favites_docker.py", line 110, in
raise RuntimeError("docker images command failed\n%s"%e.output)
RuntimeError: docker images command failed
b''

I can successfully run with sudo run_favites_docker.py --config config.json but then the output files (and directory) are owned by root and cannot be touched by a regular user (or other programs) it would be great if there was an easy fix for this. I am try installing manually if there is not.

FAVITES Version

1.2.7

Environment

Operating System: Ubuntu 20.04.1 LTS
Kernel: Linux 5.4.0-73-generic
Architecture: x86-64

Configuration File

This is the example file given in the wiki (which I am using just to get things running):

{
# Module Implementations
"Driver": "Default",
"Logging": "STDOUT",
"TreeNode": "Simple",
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "Complete",
"SeedSelection": "Random",
"SeedSequence": "Random",
"EndCriteria": "Transmissions",
"TransmissionTimeSample": "Fixed",
"TransmissionNodeSample": "RandomSingleInfection",
"NodeEvolution": "VirusTreeSimulator",
"SequenceEvolution": "NoMutation",
"SourceSample": "Random",
"NumTimeSample": "Once",
"TimeSample": "End",
"NumBranchSample": "Single",
"TreeUnit": "LogNormal",
"NodeAvailability": "Perfect",
"Sequencing": "Perfect",

# Parameter Choices
"end_transmissions": 5,
"fixed_transmission_time_delta": 0.5,
"java_path": "java",
"num_cn_nodes": 100,
"num_seeds": 1,
"out_dir": "FAVITES_output",
"seed_sequence_length": 20,
"tree_rate_mean": -6.164,
"tree_rate_stdev": 0.3,
"vts_growthRate": 2.851904,
"vts_max_attempts": 10,
"vts_model": "logistic",
"vts_n0": 1,
"vts_t50": -2

}

Unexpected Behavior

See above

No seq file generated

Below is a sample config file where we don't get the sequences (/subsamples):

{
"ContactNetwork": "NetworkX",
"ContactNetworkGenerator": "RandomPartitionGraph",
"d_or_u": "u",

"rpg_p_in": 0.004,
"rpg_p_out": 0.0002,
"rpg_sizes": [1000,1000,1000,1000,1000],
"end_time": 10,
"num_seeds": 50,
"out_dir": "$FAVITESHOME/output/set6/output_6_19",

"Driver": "Default",
"EndCriteria": "GEMF",
"Logging": "File",

"NodeAvailability": "Bernoulli",
"node_sample_prob": 1,
"NumBranchSample": "Single",
"NumTimeSample": "Once",
"SourceSample": "Random",
"TimeSample": "GranichFirstART",

"NodeEvolution": "VirusTreeSimulator",
"vts_growthRate": 2.851904,
"vts_model": "logistic",
"vts_n0": 1,
"vts_t50": -2,

"PostValidation": "Dummy",

"SeedSelection": "Random",

"SeedSequence": "VirusPureCoalescentGTRGamma",
"viral_sequence_type": "HIV1-B-DNA-POL-LITTLE",

"SequenceEvolution": "GTRGammaSeqGen",
"Sequencing": "Perfect",

"TransmissionNodeSample": "GEMF",
"hiv_a1_to_d": 0,
"hiv_a2_to_a3": 0,
"hiv_a2_to_d": 0,
"hiv_a1_to_i1": 0.48,
"hiv_a2_to_i2": 0.48,
"hiv_i2_to_a2": 0.5,
"hiv_i1_to_a1": 0.5,
"hiv_a3_to_a4": 0,
"hiv_a3_to_d": 0,
"hiv_a3_to_i3": 0,
"hiv_a4_to_d": 0,
"hiv_a4_to_i4": 0,
"hiv_i1_to_d": 0,
"hiv_i1_to_i2": 8.666666666666666,
"hiv_a1_to_a2": 4.33333,
"hiv_i2_to_d": 0,
"hiv_i2_to_i3": 0,
"hiv_i3_to_a3": 0,
"hiv_i3_to_d": 0,
"hiv_i3_to_i4": 0,
"hiv_i4_to_a4": 0,
"hiv_i4_to_d": 0,
"hiv_ns_to_d": 0,
"hiv_ns_to_s": 999999,
"hiv_s_to_d": 0,
"hiv_s_to_i1_by_a1": 0.005625,
"hiv_s_to_i1_by_a2": 0,
"hiv_s_to_i1_by_a3": 0,
"hiv_s_to_i1_by_a4": 0,
"hiv_s_to_i1_by_i1": 0.1125,
"hiv_s_to_i1_by_i2": 0.0225,
"hiv_s_to_i1_by_i3": 0,
"hiv_s_to_i1_by_i4": 0,
"hiv_s_to_i1_seed": 0,
"TransmissionTimeSample": "HIVARTGranichGEMF",

"TreeNode": "Simple",
"TreeUnit": "LogNormal",
"tree_rate_mean": -6.164,
"tree_rate_stdev": 0.3,

"grinder_path": "grinder",
"gemf_path": "GEMF",
"hmmemit_path": "hmmemit",
"java_path": "java",
"nw_rename_path": "nw_rename",
"seqgen_path": "seq-gen",

"seed_population": 20,

"seqgen_a_to_c": 1.765707,
"seqgen_a_to_g": 9.587649,
"seqgen_a_to_t": 0.691915,
"seqgen_c_to_g": 0.863348,
"seqgen_c_to_t": 10.282617,
"seqgen_freq_a": 0.392,
"seqgen_freq_c": 0.165,
"seqgen_freq_g": 0.212,
"seqgen_freq_t": 0.232,
"seqgen_g_to_t": 1.0,
"seqgen_gamma_shape": 0.405129,
"seqgen_num_gamma_rate_categories": ""

}

No such file or directory: 'ID_xxx_simple.nex'

FAVITES Version

FAVITES 1.1.35

Environment

macOS Mojave Version 10.14.6, Docker

Configuration File

0.json.txt

Unexpected Behavior

Running the FAVITES via run_favites_docker.py, the following error occurs sometimes.

=============================================================
Evolving trees and sequences to end time...Traceback (most recent call last):
File "/FAVITES/modules/NodeEvolution_VirusTreeSimulator.py", line 124, in evolve_to_current_time
parts = open('ID_%s_simple.nex'%str(seed)).read().strip().split('Translate')[1].split('tree TREE1')
FileNotFoundError: [Errno 2] No such file or directory: 'ID_4958_simple.nex'

Create helper script that labels internal nodes of output trees

Given the transmission network, true time tree, and true mutation tree:

  • We can map the nodes of the time tree to those of the mutation tree by mapping the leaves, then doing an ancestor traversal up the tree at each leaf, and stopping the moment you see a node you've already encountered (which is a common ancestor to a previously-explored leaf)
    • Do everything on the time tree, and just map to the mutation tree as you go
  • Parse the seeds into a set
  • For every node u in a post-order traversal:
    • If u is a leaf, person(u) = extract the person label from u's label
    • Else: set person(u) to be person(v) for u's child v with the earliest infection time (with seed being the earliest possible)
      • If there are multiple seeds, this node is a node from the seed tree, so there shouldn't be a label on it in the output, so set person(u) to None or something to signify

Don't start all HIV seeds in AU (HIV Granich)

Perhaps have a Granich File SeedSelection module where you specify a starting state for each person, and then have a Granich Proportions SeedSelection module that wraps around it

Parameter 'vts_max_attempts' not found in config

sounds like vts_max_attempts" needs to be added to config file. what is the suggested value for vts_max_attemps. also what is that variable for?

FAVITES Version

1.1.1

Environment

MacOS

Configuration File

Unexpected Behavior

File "/FAVITES/modules/FAVITES_ModuleFactory.py", line 39, in read_config
assert req in config, "Parameter %r of %s_%s module is not in the configuration file!" % (req, module, config[module])
AssertionError: Parameter 'vts_max_attempts' of NodeEvolution_VirusTreeSimulator module is not in the configuration file!

Modules that load from user-specified file don't work in Docker

FAVITES Version

Everything so far (1.1.0)

Environment

Docker

Configuration File

Use any of the ones that mention loading something from a user-specified file (e.g. profile HMM, MSA, contact network, or transmission network)

Unexpected Behavior

Because you need to explicitly mount things in the host machine onto the Docker image, the Docker image is not able to see the user-specified files. Potential solution: within run_favites_docker.py, when you parse the config file, check for parameters that are in some "need to be mounted" list stored somewhere. If so, mount them for the user and update the entry in the config file to the mounted directory

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.