Skip to content

Commit

Permalink
check point
Browse files Browse the repository at this point in the history
  • Loading branch information
iossifov committed Sep 15, 2022
1 parent 426a18c commit 32d88ae
Show file tree
Hide file tree
Showing 4 changed files with 81 additions and 32 deletions.
68 changes: 68 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,70 @@
# autpop

## Introduction

Tool for exploring models of populations with autism.

The tools accompanies our "Wroten et al. Sharing parental
genomes by siblings concordant or discordant for autism"
manuscript that will hopefully be published soon.

The models and the methods used to make predictions about
populations of families with autism are described in detail in the
manuscript.

## Installation

autpop is distributed as a conda package in the iossifovlab conda channel. To install one needs first to intall a conda infrastructure.
There are many alternative ways to accomplish that. The easiest one may be to install Anaconda from
https://www.anaconda.com/products/distribution.

Anaconda installs a large number of packages related to Datascience.
If these are not needed, one can install the much smaller (and quicker to install) Miniconda from https://docs.conda.io/en/latest/miniconda.


Once Anaconda or Miniconda are installed, one can install autpop using the following command prompt command:

```shell
$ conda install -c iossifovlab autpop
```

## Basic use

autpop is a command line tool. To use it one has to define one or more population models in a yaml file. A example of a model definition is:

```yaml
threshold_model:
name: basic
male_threshold: 9
female_threshold: 11
locus_classes:
- w: 1
f: 0.4
n: 5
- w: 8
f: 0.01
n: 2
```
If we store the above in a file called simple.yaml we can compute the predicted risks and parental genomic sharing by running the following command:
```shell
$ autpop simple.yaml
```

The intermediate and final results will be stored in three files: family_stats_simple.txt, global_stats_simple.txt and models_results.txt. These files are described in detail in the manuscript.

autpop accepts many optional parameter that controll how the predictions will be computed. For a list and a description of all
optional parameters one can use:

```shell
$ autpop --help
```




## Soucre code

https://github.com/iossifovlab/autpop

15 changes: 12 additions & 3 deletions autpop/population_threshold_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ def compute_global_stats(all_stats, family_type_set: FamilyTypeSet,
n_unaffected_parents_families_with_sample_based_predictions = \
len([1 for st in all_stats
if not st['precise_prediction'] and
not st['parents_affected']])
st['unaffected_parents']])
global_stats['prediction_details'] = {

'precise':
Expand Down Expand Up @@ -833,6 +833,13 @@ def cli(cli_args=None):
parser.add_argument("-op", "--output_precision", type=int, default=3,
help="The precision of all float values in the "
"models_results.txt output table.")
parser.add_argument("-od", "--output_dir", type=str, default=None,
help="The output directory. By default, a directory, "
"next to the model definition file file will be used: "
"if the model definition is "
"<dir>/<model definition>.yaml, the output default "
"output directory will be named "
"<dir>/<model definition>_results.")

args = parser.parse_args(cli_args)

Expand All @@ -844,8 +851,10 @@ def cli(cli_args=None):
modelsD = {m.model_name: m for m in models}
models = [modelsD[mn] for mn in args.model]

pre, _ = os.path.splitext(args.models_file)
out_dir = pathlib.Path(pre + "_results")
out_dir = args.out_dir
if not out_dir:
pre, _ = os.path.splitext(args.models_file)
out_dir = pathlib.Path(pre + "_results")
out_dir.mkdir(parents=True, exist_ok=True)

GSB = []
Expand Down
28 changes: 0 additions & 28 deletions autpop/precision_test.py

This file was deleted.

2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="autpop",
version="0.7",
version="0.8",
author="Ivan Iossifov",
author_email="[email protected]",
description="Autism population model",
Expand Down

0 comments on commit 32d88ae

Please sign in to comment.