forked from vinuesa/get_phylomarkers
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_get_phylomarkers.t
86 lines (60 loc) · 4.64 KB
/
test_get_phylomarkers.t
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
# version 2021-09-19
use strict;
use warnings;
use Test::More tests => 22;
use lib "lib";
use lib "lib/perl/bioperl-1.5.2_102/";
use lib "lib/perl/File::Rename";
### Test Perl scripts
# test 1
ok( eval{ `perl ./add_labels2tree.pl 2>&1` } =~ /two args/ , 'add_labels2tree.pl' );
# test 2
ok( eval{ `perl ./add_nos2fasta_header.pl 2>&1` } =~ /fasta file/ , 'add_nos2fasta_header.pl' );
# test 3
ok( eval{ `perl ./concat_alignments.pl 2>&1` } =~ /list of alignment/ , 'concat_alignments.pl' );
# test 4
ok( eval{ `perl ./convert_aln_format_batch_bp.pl` } =~ /Usage:/ , 'convert_aln_format_batch_bp.pl' );
# test 5
ok( eval{ `perl ./popGen_summStats.pl` } =~ /usage/ , 'popGen_summStats.pl' );
# test 6
ok( eval{ `perl ./pal2nal.pl 2>&1` } =~ /Usage:/ , 'pal2nal.pl' );
# test 7
ok( eval{ `perl ./remove_uninformative_sites_from_aln.pl -h 2>&1` } =~ /Removes/ , 'remove_uninformative_sites_from_aln.pl' );
# test 8
ok( eval{ `perl ./rename.pl 2>&1` } =~ /Usage/ , 'rename.pl' );
# test 9
ok( eval{ `perl ./run_parallel_cmmds.pl` } =~ /usage/ , 'run_parallel_cmmds.pl' );
### Test R scripts
# test 10
ok( eval{ `Rscript ./compute_suppValStas_and_RF-dist.R 2>&1` } =~ /Usage/ , 'compute_suppValStas_and_RF-dist.R' );
### Test Bash scripts
# test 11
ok( eval{ `bash ./estimate_pangenome_phylogenies.sh 2>&1` } =~ /PARS PARALLELIZATION/ , 'estimate_pangenome_phylogenies.sh' );
# test 12 keeps failing on Travis CI
# ok( eval{ `bash ./hcluster_pangenome_matrix.sh 2>&1` } =~ /synopsis/, 'hcluster_pangenome_matrix.sh' );
#ok( eval{ `bash ./hcluster_pangenome_matrix.sh` } =~ /synopsis/ , 'hcluster_pangenome_matrix.sh' );
# test 12
ok( eval{ `bash ./run_get_phylomarkers_pipeline.sh 2>&1` } =~ /INVOCATION/, 'run_get_phylomarkers_pipeline.sh' );
# test 13
ok( eval{ `bash ./run_parallel_molecClock_test_with_paup.sh 2>&1` } =~ /OUTPUT/, 'run_parallel_molecClock_test_with_paup.sh' );
# test 14
ok( eval{ `bash ./run_pexec_cmmds.sh 2>&1` } =~ /example4/, 'run_pexec_cmmds.sh' );
# test 15
ok( eval{ `bash ./run_test_suite.sh 2>&1` } =~ /LAUNCHING THE CONTAINER/, 'run_test_suite.sh' );
### Test runs of main scripts
# test 16 default run on DNA sequence ...
ok( eval{ `cd test_sequences/core_genome && ../../run_get_phylomarkers_pipeline.sh -R 1 -t DNA | grep "wrote file gene_trees" && rm -rf get_phylomarkers_run_*` }, 'run_get_phylomarkers_pipeline.sh -R 1 -t DNA' );
# test 17 IQT run on proteins sequence ...
ok( eval{ `cd test_sequences/core_genome && ../../run_get_phylomarkers_pipeline.sh -R 1 -t PROT -k 1.2 -m 0.6 | grep "wrote file" && rm -rf get_phylomarkers_run_*` }, 'run_get_phylomarkers_pipeline.sh -R 1 -t PROT -k 1.2 -m 0.6' );
# test 18 Thorough FastTree searching and molecular clock analysis on DNA sequences using 10 cores and increasing k stringency
ok( eval{ `cd test_sequences/core_genome && ../../run_get_phylomarkers_pipeline.sh -R 1 -t DNA -A F -k 1.2 -m 0.7 -s 20 -l 12 -T high -K -M HKY -q 0.95 -n 10 | grep "wrote file phylogenetic_attributes_of_top"` }, 'run_get_phylomarkers_pipeline.sh -R 1 -t DNA -A F -k 1.2 ...' );
# test 19 FastTree thorough searching on a protein dataset with moderate average bipartition support
ok( eval{ `cd test_sequences/core_genome && ../../run_get_phylomarkers_pipeline.sh -R 1 -t PROT -A F -T high -m 0.6 | grep "wrote file concat_nonRecomb_KdeFilt_protAlns_FTlgG"` }, 'run_get_phylomarkers_pipeline.sh -R 1 -t PROT -A F ...' );
# test 20 Run in population-genetics mode (generates a table with descritive statistics for DNA-polymorphisms) with K2P model
ok( eval{ `cd test_sequences/core_genome && ../../run_get_phylomarkers_pipeline.sh -R 2 -t DNA -S K2P | grep "wrote file polymorphism_descript_stats.tab"` }, 'run_get_phylomarkers_pipeline.sh -R 2 -t DNA -S K2P' );
# test 21 estimate a ML pan-genome tree from the pan-genome matrix, using 2 independent IQT runs and UFBoot
ok( eval{ `cd test_sequences/pan_genome && ../../estimate_pangenome_phylogenies.sh -f pangenome_matrix_t0.fasta -r 2 -S UFBoot | grep "done!"` }, 'estimate_pangenome_phylogenies.sh -r 2 -S UFBoot ...' );
# test 22 estimate a PARS pan-genome tree with bootstrapping; 50 bootstrap replicates divided on 10 core (5 reps / core)
ok( eval{ `cd test_sequences/pan_genome && ../../estimate_pangenome_phylogenies.sh -c PARS -R 3 -i pangenome_matrix_t0.phylip -n 10 -b 5 -j 1 -t 1 | grep "seq_key"` }, 'estimate_pangenome_phylogenies.sh -c PARS -R 3 ...' );
# test 24, run hcluster_pangenome_matrix.sh
#ok( eval{ `cd test_sequences/pan_genome && ../../hcluster_pangenome_matrix.sh -i pangenome_matrix_t0.tab -T "Pan-genome tree" -a ward.D2 -d gower -O pdf -A 'NULL,45' -X 0.8 -s sil | grep 'hcluster_pangenome_matrix_script'` }, ' hcluster_pangenome_matrix.sh -i pangenome_matrix_t0.tab ...' );