summaryrefslogtreecommitdiff
path: root/python-fastral.spec
blob: 7e3aa5f74841adec4bee91f68277586125ce6974 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
%global _empty_manifest_terminate_build 0
Name:		python-FASTRAL
Version:	1.0.0
Release:	1
Summary:	A hybrid summary method for reconstructing species tree from gene trees.
License:	MIT License
URL:		https://github.com/PayamDiba/FASTRAL
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/96/7f/005060f111cd0677d8af66d519923b41001f50ee0c596cd7c155aa59c10e/FASTRAL-1.0.0.tar.gz
BuildArch:	noarch

Requires:	python3-numpy
Requires:	python3-pandas
Requires:	python3-absl-py

%description
# FASTRAL

## Description
FASTRAL is a novel approach for running [ASTRAL](https://github.com/smirarab/ASTRAL), a widely used and popular species tree reconstruction method. FASTRAL runs up to ~800 times faster than ASTRAL but with a similar (or sometimes better) accuracy.

## Dependencies
FASTRAL can run on Linux or mac OS machines with Python 3 installed.

## Getting Started
To download FASTRAL, use the following command:

```pip install FASTRAL```

## Usage
To get a quick help on the required flags for running FASTRAL, run:

```fastral -h```

The required flags for running FASTRAL are described below:

* --ns: Number of sub-samples to be created. To specify multiple samples (containing different number of gene trees) use comma separated values
* --nt: Number of trees per sample, if there are multiple samples use comma separated values
* --k: Total number of input gene trees.
* --it: Path to input gene trees
* --os: Path for writing sampled trees
* --aggregate: Path for writing aggregated species trees
* --o: Path for writing FASTRAL output species tree
* --time: Path for writing running times

The following flags are optional:
* --rep: If specified, samples are created with replacement | Default (if not specified): Samples are created without replacement
* --path_ASTRID: path to ASTRID's runtime | Default: ASTRID-2 ([version untagged-fdc5326080d364b87c5a](https://github.com/pranjalv123/ASTRID/releases/tag/untagged-fdc5326080d364b87c5a)) is used
* --path_ASTRAL: Path to ASTRAL's runtime | Default: modified ASTRAL 5.7.3 is used
* --heuristics: Heuristics level of ASTRAL (See ASTRAL's manual) | Default: 0
* --multi: Required if input gene trees contain multiple individuals. Specify the path to the mapping file
* --incomp_id: (In multi-individual mode; optional) Path to a file containing the IDs of incomplete gene trees (zero-based). If specified, sampling step makes sure that each sub-sample contains at least one complete gene trees.

## Running on multi-individual datasets
When input gene trees contain multiple individuals per species, FASTRAL requires a mapping file to be passed with ```--multi``` flag. This mapping file should have one line per species in the following format:

```
species_name: individual_1, individual_2, ...
```

An example of mapping file is provided in the ```example/data``` directory.

Also, if missing data is present and sub-samples containing at least one complete gene tree is required, the IDs of incomplete gene trees can be passed to FASTRAL using ```--incomp_id``` flag. IDs are indices (zero-based) of incomplete gene trees and this file should have one ID per line. An example of such missing_ids file is provided in the ```example/data``` directory.

## Example
We provided an example multi-individual data with 5 individuals per species in ```example/data``` directory. 1000 input gene trees (genes.gtr), mapping and missing_ids files are provided. Use the following command to run FASTRAL on this data. Here, we chose to create 51 sub-samples, one of which has all the 1000 gene trees, 10 of which each have 500 gene trees, 20 of which each have 250 gene trees and the remaining 20 samples each contain 100 gene trees:

```fastral --ns 1,10,20,20 --nt 1000,500,250,100 --k 1000 --it {PATH-TO}/example/data/genes.gtr --os {PATH-TO}/example/out/samples --aggregate {PATH-TO}/example/out/combined_trees.tre --o {PATH-TO}/example/out/final_species_tree.tre --time {PATH-TO}/out/time.log --multi {PATH-TO}/example/data/mapping```




%package -n python3-FASTRAL
Summary:	A hybrid summary method for reconstructing species tree from gene trees.
Provides:	python-FASTRAL
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-FASTRAL
# FASTRAL

## Description
FASTRAL is a novel approach for running [ASTRAL](https://github.com/smirarab/ASTRAL), a widely used and popular species tree reconstruction method. FASTRAL runs up to ~800 times faster than ASTRAL but with a similar (or sometimes better) accuracy.

## Dependencies
FASTRAL can run on Linux or mac OS machines with Python 3 installed.

## Getting Started
To download FASTRAL, use the following command:

```pip install FASTRAL```

## Usage
To get a quick help on the required flags for running FASTRAL, run:

```fastral -h```

The required flags for running FASTRAL are described below:

* --ns: Number of sub-samples to be created. To specify multiple samples (containing different number of gene trees) use comma separated values
* --nt: Number of trees per sample, if there are multiple samples use comma separated values
* --k: Total number of input gene trees.
* --it: Path to input gene trees
* --os: Path for writing sampled trees
* --aggregate: Path for writing aggregated species trees
* --o: Path for writing FASTRAL output species tree
* --time: Path for writing running times

The following flags are optional:
* --rep: If specified, samples are created with replacement | Default (if not specified): Samples are created without replacement
* --path_ASTRID: path to ASTRID's runtime | Default: ASTRID-2 ([version untagged-fdc5326080d364b87c5a](https://github.com/pranjalv123/ASTRID/releases/tag/untagged-fdc5326080d364b87c5a)) is used
* --path_ASTRAL: Path to ASTRAL's runtime | Default: modified ASTRAL 5.7.3 is used
* --heuristics: Heuristics level of ASTRAL (See ASTRAL's manual) | Default: 0
* --multi: Required if input gene trees contain multiple individuals. Specify the path to the mapping file
* --incomp_id: (In multi-individual mode; optional) Path to a file containing the IDs of incomplete gene trees (zero-based). If specified, sampling step makes sure that each sub-sample contains at least one complete gene trees.

## Running on multi-individual datasets
When input gene trees contain multiple individuals per species, FASTRAL requires a mapping file to be passed with ```--multi``` flag. This mapping file should have one line per species in the following format:

```
species_name: individual_1, individual_2, ...
```

An example of mapping file is provided in the ```example/data``` directory.

Also, if missing data is present and sub-samples containing at least one complete gene tree is required, the IDs of incomplete gene trees can be passed to FASTRAL using ```--incomp_id``` flag. IDs are indices (zero-based) of incomplete gene trees and this file should have one ID per line. An example of such missing_ids file is provided in the ```example/data``` directory.

## Example
We provided an example multi-individual data with 5 individuals per species in ```example/data``` directory. 1000 input gene trees (genes.gtr), mapping and missing_ids files are provided. Use the following command to run FASTRAL on this data. Here, we chose to create 51 sub-samples, one of which has all the 1000 gene trees, 10 of which each have 500 gene trees, 20 of which each have 250 gene trees and the remaining 20 samples each contain 100 gene trees:

```fastral --ns 1,10,20,20 --nt 1000,500,250,100 --k 1000 --it {PATH-TO}/example/data/genes.gtr --os {PATH-TO}/example/out/samples --aggregate {PATH-TO}/example/out/combined_trees.tre --o {PATH-TO}/example/out/final_species_tree.tre --time {PATH-TO}/out/time.log --multi {PATH-TO}/example/data/mapping```




%package help
Summary:	Development documents and examples for FASTRAL
Provides:	python3-FASTRAL-doc
%description help
# FASTRAL

## Description
FASTRAL is a novel approach for running [ASTRAL](https://github.com/smirarab/ASTRAL), a widely used and popular species tree reconstruction method. FASTRAL runs up to ~800 times faster than ASTRAL but with a similar (or sometimes better) accuracy.

## Dependencies
FASTRAL can run on Linux or mac OS machines with Python 3 installed.

## Getting Started
To download FASTRAL, use the following command:

```pip install FASTRAL```

## Usage
To get a quick help on the required flags for running FASTRAL, run:

```fastral -h```

The required flags for running FASTRAL are described below:

* --ns: Number of sub-samples to be created. To specify multiple samples (containing different number of gene trees) use comma separated values
* --nt: Number of trees per sample, if there are multiple samples use comma separated values
* --k: Total number of input gene trees.
* --it: Path to input gene trees
* --os: Path for writing sampled trees
* --aggregate: Path for writing aggregated species trees
* --o: Path for writing FASTRAL output species tree
* --time: Path for writing running times

The following flags are optional:
* --rep: If specified, samples are created with replacement | Default (if not specified): Samples are created without replacement
* --path_ASTRID: path to ASTRID's runtime | Default: ASTRID-2 ([version untagged-fdc5326080d364b87c5a](https://github.com/pranjalv123/ASTRID/releases/tag/untagged-fdc5326080d364b87c5a)) is used
* --path_ASTRAL: Path to ASTRAL's runtime | Default: modified ASTRAL 5.7.3 is used
* --heuristics: Heuristics level of ASTRAL (See ASTRAL's manual) | Default: 0
* --multi: Required if input gene trees contain multiple individuals. Specify the path to the mapping file
* --incomp_id: (In multi-individual mode; optional) Path to a file containing the IDs of incomplete gene trees (zero-based). If specified, sampling step makes sure that each sub-sample contains at least one complete gene trees.

## Running on multi-individual datasets
When input gene trees contain multiple individuals per species, FASTRAL requires a mapping file to be passed with ```--multi``` flag. This mapping file should have one line per species in the following format:

```
species_name: individual_1, individual_2, ...
```

An example of mapping file is provided in the ```example/data``` directory.

Also, if missing data is present and sub-samples containing at least one complete gene tree is required, the IDs of incomplete gene trees can be passed to FASTRAL using ```--incomp_id``` flag. IDs are indices (zero-based) of incomplete gene trees and this file should have one ID per line. An example of such missing_ids file is provided in the ```example/data``` directory.

## Example
We provided an example multi-individual data with 5 individuals per species in ```example/data``` directory. 1000 input gene trees (genes.gtr), mapping and missing_ids files are provided. Use the following command to run FASTRAL on this data. Here, we chose to create 51 sub-samples, one of which has all the 1000 gene trees, 10 of which each have 500 gene trees, 20 of which each have 250 gene trees and the remaining 20 samples each contain 100 gene trees:

```fastral --ns 1,10,20,20 --nt 1000,500,250,100 --k 1000 --it {PATH-TO}/example/data/genes.gtr --os {PATH-TO}/example/out/samples --aggregate {PATH-TO}/example/out/combined_trees.tre --o {PATH-TO}/example/out/final_species_tree.tre --time {PATH-TO}/out/time.log --multi {PATH-TO}/example/data/mapping```




%prep
%autosetup -n FASTRAL-1.0.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-FASTRAL -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue May 30 2023 Python_Bot <Python_Bot@openeuler.org> - 1.0.0-1
- Package Spec generated