PyamilySeq 0.5.1__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (22) hide show
  1. {pyamilyseq-0.5.1/src/PyamilySeq.egg-info → pyamilyseq-0.6.0}/PKG-INFO +52 -68
  2. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/README.md +51 -67
  3. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/setup.cfg +1 -1
  4. pyamilyseq-0.6.0/src/PyamilySeq/Constants.py +2 -0
  5. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq/PyamilySeq.py +43 -19
  6. pyamilyseq-0.6.0/src/PyamilySeq/PyamilySeq_Genus.py +259 -0
  7. pyamilyseq-0.6.0/src/PyamilySeq/PyamilySeq_Species.py +279 -0
  8. pyamilyseq-0.6.0/src/PyamilySeq/clusterings.py +324 -0
  9. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq/utils.py +84 -1
  10. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0/src/PyamilySeq.egg-info}/PKG-INFO +52 -68
  11. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq.egg-info/SOURCES.txt +1 -0
  12. pyamilyseq-0.5.1/src/PyamilySeq/Constants.py +0 -2
  13. pyamilyseq-0.5.1/src/PyamilySeq/PyamilySeq_Genus.py +0 -659
  14. pyamilyseq-0.5.1/src/PyamilySeq/PyamilySeq_Species.py +0 -730
  15. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/LICENSE +0 -0
  16. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/pyproject.toml +0 -0
  17. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq/CD-Hit_StORF-Reporter_Cross-Genera_Builder.py +0 -0
  18. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq/Seq_Combiner.py +0 -0
  19. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq/__init__.py +0 -0
  20. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq.egg-info/dependency_links.txt +0 -0
  21. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq.egg-info/entry_points.txt +0 -0
  22. {pyamilyseq-0.5.1 → pyamilyseq-0.6.0}/src/PyamilySeq.egg-info/top_level.txt +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyamilySeq
3
- Version: 0.5.1
3
+ Version: 0.6.0
4
4
  Summary: PyamilySeq - A a tool to look for sequence-based gene families identified by clustering methods such as CD-HIT, DIAMOND, BLAST or MMseqs2.
5
5
  Home-page: https://github.com/NickJD/PyamilySeq
6
6
  Author: Nicholas Dimonaco
@@ -34,80 +34,83 @@ PyamilySeq requires Python 3.6 or higher. Install using pip:
34
34
  pip install PyamilySeq
35
35
  ```
36
36
 
37
+ ### Examples: Below are two examples of running PyamilySeq in its two main modes.
38
+ #### 'Full Mode': Will conduct clustering of sequences as part of PyamilySeq run
39
+ ```bash
40
+ PyamilySeq -run_mode Full -group_mode Species -output_dir ../../test_data/testing -input_type combined -input_dir .../test_data/genomes -name_split _combined.gff3 -pid 0.99 -len_diff 0.99 -clust_tool CD-HIT -gpa True -con True -w 99 -verbose True
41
+ ```
42
+ #### 'Partial Mode': Will take the output of a sequence clustering
43
+ ```bash
44
+ PyamilySeq -run_mode Partial -group_mode Species -output_dir .../test_data/testing -cluster_file .../test_data/CD-HIT/combined_Ensmbl_pep_CD_90_60.clstr -clust_tool CD-HIT -original_fasta .../test_data/combined_Ensmbl_cds.fasta -gpa True -con True -w 99 -verbose True
45
+ ```
46
+
47
+ ```bash
48
+ Calculating Groups
49
+ Gene Groups:
50
+ first_core_99: 3103
51
+ first_core_95: 0
52
+ first_core_15: 3217
53
+ first_core_0: 4808
54
+ Total Number of Gene Groups (Including Singletons): 11128
55
+ ```
56
+
57
+
37
58
  ## Usage - Menu
38
59
  ```
39
- usage: PyamilySeq.py [-h] -run_mode {Full,Partial} -group_mode {Species,Genus}
40
- -clust_tool {CD-HIT} -output_dir OUTPUT_DIR
41
- [-input_type {separate,combined}] [-input_dir INPUT_DIR]
42
- [-name_split NAME_SPLIT] [-pid PIDENT]
43
- [-len_diff LEN_DIFF] [-cluster_file CLUSTER_FILE]
44
- [-reclustered RECLUSTERED] [-seq_tag SEQUENCE_TAG]
45
- [-groups CORE_GROUPS] [-w WRITE_FAMILIES] [-con CON_CORE]
46
- [-original_fasta ORIGINAL_FASTA]
47
- [-gpa GENE_PRESENCE_ABSENCE_OUT] [-verbose {True,False}]
48
- [-v]
49
-
50
- PyamilySeq v0.5.1: PyamilySeq Run Parameters.
60
+ usage: PyamilySeq.py [-h] -run_mode {Full,Partial} -group_mode {Species,Genus} -clust_tool {CD-HIT} -output_dir OUTPUT_DIR [-input_type {separate,combined}] [-input_dir INPUT_DIR] [-name_split NAME_SPLIT]
61
+ [-pid PIDENT] [-len_diff LEN_DIFF] [-mem CLUSTERING_MEMORY] [-t CLUSTERING_THREADS] [-cluster_file CLUSTER_FILE] [-reclustered RECLUSTERED] [-seq_tag SEQUENCE_TAG]
62
+ [-core_groups CORE_GROUPS] [-genus_groups GENUS_GROUPS] [-w WRITE_FAMILIES] [-con CON_CORE] [-original_fasta ORIGINAL_FASTA] [-gpa GENE_PRESENCE_ABSENCE_OUT] [-verbose {True,False}] [-v]
63
+
64
+ PyamilySeq v0.6.0: PyamilySeq Run Parameters.
51
65
 
52
66
  options:
53
67
  -h, --help show this help message and exit
54
68
 
55
69
  Required Arguments:
56
70
  -run_mode {Full,Partial}
57
- Run Mode: Should PyamilySeq be run in "Full" or
58
- "Partial" mode?
59
- -group_mode {Species}
60
- Group Mode: Should PyamilySeq be run in "Species" or
61
- "Genus" mode? - Genus mode not currently functioning
62
- -clust_tool {CD-HIT} Clustering tool to use: CD-HIT, DIAMOND, BLAST or
63
- MMseqs2.
71
+ Run Mode: Should PyamilySeq be run in "Full" or "Partial" mode?
72
+ -group_mode {Species,Genus}
73
+ Group Mode: Should PyamilySeq be run in "Species" or "Genus" mode?
74
+ -clust_tool {CD-HIT} Clustering tool to use: CD-HIT, DIAMOND, BLAST or MMseqs2.
64
75
  -output_dir OUTPUT_DIR
65
76
  Directory for all output files.
66
77
 
67
78
  Full-Mode Arguments - Required when "-run_mode Full" is used:
68
79
  -input_type {separate,combined}
69
- Type of input files: 'separate' for separate FASTA and
70
- GFF files, 'combined' for GFF files with embedded
71
- FASTA sequences.
80
+ Type of input files: 'separate' for separate FASTA and GFF files, 'combined' for GFF files with embedded FASTA sequences.
72
81
  -input_dir INPUT_DIR Directory containing GFF/FASTA files.
73
82
  -name_split NAME_SPLIT
74
- substring used to split the filename and extract the
75
- genome name ('_combined.gff3' or '.gff').
83
+ substring used to split the filename and extract the genome name ('_combined.gff3' or '.gff').
76
84
  -pid PIDENT Default 0.95: Pident threshold for clustering.
77
- -len_diff LEN_DIFF Default 0.80: Minimum length difference between
78
- clustered sequences - (-s) threshold for CD-HIT
79
- clustering.
85
+ -len_diff LEN_DIFF Default 0.80: Minimum length difference between clustered sequences - (-s) threshold for CD-HIT clustering.
86
+
87
+ Clustering Runtime Arguments - Optional when "-run_mode Full" is used:
88
+ -mem CLUSTERING_MEMORY
89
+ Default 4000: Memory to be allocated for clustering (in MBs).
90
+ -t CLUSTERING_THREADS
91
+ Default 4: Threads to be allocated for clustering.
80
92
 
81
93
  Partial-Mode Arguments - Required when "-run_mode Partial" is used:
82
94
  -cluster_file CLUSTER_FILE
83
- Clustering output file containing CD-HIT, TSV or CSV
84
- Edge List
95
+ Clustering output file containing CD-HIT, TSV or CSV Edge List
85
96
 
86
97
  Grouping Arguments - Use to fine-tune grouping of genes after clustering:
87
98
  -reclustered RECLUSTERED
88
- Clustering output file from secondary round of
89
- clustering
99
+ Currently only works on Partial Mode: Clustering output file from secondary round of clustering.
90
100
  -seq_tag SEQUENCE_TAG
91
- Default - "StORF": Unique identifier to be used to
92
- distinguish the second of two rounds of clustered
93
- sequences
94
- -groups CORE_GROUPS Default - ('99,95,15'): Gene family groups to use
101
+ Default - "StORF": Unique identifier to be used to distinguish the second of two rounds of clustered sequences
102
+ -core_groups CORE_GROUPS
103
+ Default - ('99,95,15'): Gene family groups to use for "Species" mode
104
+ -genus_groups GENUS_GROUPS
105
+ Default - ('1,2,3,4,5,6'): Gene family groups to use for "Genus" mode
95
106
 
96
107
  Output Parameters:
97
- -w WRITE_FAMILIES Default - No output: Output sequences of identified
98
- families (provide levels at which to output "-w 99,95"
99
- - Must provide FASTA file with -fasta
100
- -con CON_CORE Default - No output: Output aligned and concatinated
101
- sequences of identified families - used for MSA
102
- (provide levels at which to output "-w 99,95" - Must
103
- provide FASTA file with -fasta
108
+ -w WRITE_FAMILIES Default - No output: Output sequences of identified families (provide levels at which to output "-w 99,95" - Must provide FASTA file with -fasta
109
+ -con CON_CORE Default - No output: Output aligned and concatinated sequences of identified families - used for MSA (provide levels at which to output "-w 99,95" - Must provide FASTA file with -fasta
104
110
  -original_fasta ORIGINAL_FASTA
105
- FASTA file to use in conjunction with "-w" or "-con"
106
- when running in Partial Mode.
111
+ FASTA file to use in conjunction with "-w" or "-con" when running in Partial Mode.
107
112
  -gpa GENE_PRESENCE_ABSENCE_OUT
108
- Default - False: If selected, a Roary formatted
109
- gene_presence_absence.csv will be created - Required
110
- for Coinfinder and other downstream tools
113
+ Default - False: If selected, a Roary formatted gene_presence_absence.csv will be created - Required for Coinfinder and other downstream tools
111
114
 
112
115
  Misc:
113
116
  -verbose {True,False}
@@ -116,25 +119,6 @@ Misc:
116
119
 
117
120
  ```
118
121
 
119
- ### Examples: Below are two examples of running PyamilySeq in its two main modes.
120
- #### 'Full Mode': Will conduct clustering of sequences as part of PyamilySeq run
121
- ```bash
122
- PyamilySeq -run_mode Full -group_mode Species -output_dir ../../test_data/testing -input_type combined -input_dir .../test_data/genomes -name_split _combined.gff3 -pid 0.99 -len_diff 0.99 -clust_tool CD-HIT -gpa True -con True -w 99 -verbose True
123
- ```
124
- #### 'Partial Mode': Will take the output of a sequence clustering
125
- ```bash
126
- PyamilySeq -run_mode Partial -group_mode Species -output_dir .../test_data/testing -cluster_file .../test_data/CD-HIT/combined_Ensmbl_pep_CD_90_60.clstr -clust_tool CD-HIT -original_fasta .../test_data/combined_Ensmbl_cds.fasta -gpa True -con True -w 99 -verbose True
127
- ```
128
-
129
- ```bash
130
- Calculating Groups
131
- Gene Groups:
132
- first_core_99: 3103
133
- first_core_95: 0
134
- first_core_15: 3217
135
- first_core_0: 4808
136
- Total Number of Gene Groups (Including Singletons): 11128
137
- ```
138
122
 
139
123
  ## Seq-Combiner: This tool is provided to enable the pre-processing of multiple GFF/FASTA files together ready to be clustered by the user
140
124
  ### Example:
@@ -145,7 +129,7 @@ Seq-Combiner -input_dir .../test_data/genomes -name_split _combined.gff3 -output
145
129
  ```bash
146
130
  usage: Seq_Combiner.py [-h] -input_dir INPUT_DIR -input_type {separate,combined} -name_split NAME_SPLIT -output_dir OUTPUT_DIR -output_name OUTPUT_FILE
147
131
 
148
- Seq-Combiner v0.5.1: Seq-Combiner Run Parameters.
132
+ Seq-Combiner v0.6.0: Seq-Combiner Run Parameters.
149
133
 
150
134
  options:
151
135
  -h, --help show this help message and exit
@@ -19,80 +19,83 @@ PyamilySeq requires Python 3.6 or higher. Install using pip:
19
19
  pip install PyamilySeq
20
20
  ```
21
21
 
22
+ ### Examples: Below are two examples of running PyamilySeq in its two main modes.
23
+ #### 'Full Mode': Will conduct clustering of sequences as part of PyamilySeq run
24
+ ```bash
25
+ PyamilySeq -run_mode Full -group_mode Species -output_dir ../../test_data/testing -input_type combined -input_dir .../test_data/genomes -name_split _combined.gff3 -pid 0.99 -len_diff 0.99 -clust_tool CD-HIT -gpa True -con True -w 99 -verbose True
26
+ ```
27
+ #### 'Partial Mode': Will take the output of a sequence clustering
28
+ ```bash
29
+ PyamilySeq -run_mode Partial -group_mode Species -output_dir .../test_data/testing -cluster_file .../test_data/CD-HIT/combined_Ensmbl_pep_CD_90_60.clstr -clust_tool CD-HIT -original_fasta .../test_data/combined_Ensmbl_cds.fasta -gpa True -con True -w 99 -verbose True
30
+ ```
31
+
32
+ ```bash
33
+ Calculating Groups
34
+ Gene Groups:
35
+ first_core_99: 3103
36
+ first_core_95: 0
37
+ first_core_15: 3217
38
+ first_core_0: 4808
39
+ Total Number of Gene Groups (Including Singletons): 11128
40
+ ```
41
+
42
+
22
43
  ## Usage - Menu
23
44
  ```
24
- usage: PyamilySeq.py [-h] -run_mode {Full,Partial} -group_mode {Species,Genus}
25
- -clust_tool {CD-HIT} -output_dir OUTPUT_DIR
26
- [-input_type {separate,combined}] [-input_dir INPUT_DIR]
27
- [-name_split NAME_SPLIT] [-pid PIDENT]
28
- [-len_diff LEN_DIFF] [-cluster_file CLUSTER_FILE]
29
- [-reclustered RECLUSTERED] [-seq_tag SEQUENCE_TAG]
30
- [-groups CORE_GROUPS] [-w WRITE_FAMILIES] [-con CON_CORE]
31
- [-original_fasta ORIGINAL_FASTA]
32
- [-gpa GENE_PRESENCE_ABSENCE_OUT] [-verbose {True,False}]
33
- [-v]
34
-
35
- PyamilySeq v0.5.1: PyamilySeq Run Parameters.
45
+ usage: PyamilySeq.py [-h] -run_mode {Full,Partial} -group_mode {Species,Genus} -clust_tool {CD-HIT} -output_dir OUTPUT_DIR [-input_type {separate,combined}] [-input_dir INPUT_DIR] [-name_split NAME_SPLIT]
46
+ [-pid PIDENT] [-len_diff LEN_DIFF] [-mem CLUSTERING_MEMORY] [-t CLUSTERING_THREADS] [-cluster_file CLUSTER_FILE] [-reclustered RECLUSTERED] [-seq_tag SEQUENCE_TAG]
47
+ [-core_groups CORE_GROUPS] [-genus_groups GENUS_GROUPS] [-w WRITE_FAMILIES] [-con CON_CORE] [-original_fasta ORIGINAL_FASTA] [-gpa GENE_PRESENCE_ABSENCE_OUT] [-verbose {True,False}] [-v]
48
+
49
+ PyamilySeq v0.6.0: PyamilySeq Run Parameters.
36
50
 
37
51
  options:
38
52
  -h, --help show this help message and exit
39
53
 
40
54
  Required Arguments:
41
55
  -run_mode {Full,Partial}
42
- Run Mode: Should PyamilySeq be run in "Full" or
43
- "Partial" mode?
44
- -group_mode {Species}
45
- Group Mode: Should PyamilySeq be run in "Species" or
46
- "Genus" mode? - Genus mode not currently functioning
47
- -clust_tool {CD-HIT} Clustering tool to use: CD-HIT, DIAMOND, BLAST or
48
- MMseqs2.
56
+ Run Mode: Should PyamilySeq be run in "Full" or "Partial" mode?
57
+ -group_mode {Species,Genus}
58
+ Group Mode: Should PyamilySeq be run in "Species" or "Genus" mode?
59
+ -clust_tool {CD-HIT} Clustering tool to use: CD-HIT, DIAMOND, BLAST or MMseqs2.
49
60
  -output_dir OUTPUT_DIR
50
61
  Directory for all output files.
51
62
 
52
63
  Full-Mode Arguments - Required when "-run_mode Full" is used:
53
64
  -input_type {separate,combined}
54
- Type of input files: 'separate' for separate FASTA and
55
- GFF files, 'combined' for GFF files with embedded
56
- FASTA sequences.
65
+ Type of input files: 'separate' for separate FASTA and GFF files, 'combined' for GFF files with embedded FASTA sequences.
57
66
  -input_dir INPUT_DIR Directory containing GFF/FASTA files.
58
67
  -name_split NAME_SPLIT
59
- substring used to split the filename and extract the
60
- genome name ('_combined.gff3' or '.gff').
68
+ substring used to split the filename and extract the genome name ('_combined.gff3' or '.gff').
61
69
  -pid PIDENT Default 0.95: Pident threshold for clustering.
62
- -len_diff LEN_DIFF Default 0.80: Minimum length difference between
63
- clustered sequences - (-s) threshold for CD-HIT
64
- clustering.
70
+ -len_diff LEN_DIFF Default 0.80: Minimum length difference between clustered sequences - (-s) threshold for CD-HIT clustering.
71
+
72
+ Clustering Runtime Arguments - Optional when "-run_mode Full" is used:
73
+ -mem CLUSTERING_MEMORY
74
+ Default 4000: Memory to be allocated for clustering (in MBs).
75
+ -t CLUSTERING_THREADS
76
+ Default 4: Threads to be allocated for clustering.
65
77
 
66
78
  Partial-Mode Arguments - Required when "-run_mode Partial" is used:
67
79
  -cluster_file CLUSTER_FILE
68
- Clustering output file containing CD-HIT, TSV or CSV
69
- Edge List
80
+ Clustering output file containing CD-HIT, TSV or CSV Edge List
70
81
 
71
82
  Grouping Arguments - Use to fine-tune grouping of genes after clustering:
72
83
  -reclustered RECLUSTERED
73
- Clustering output file from secondary round of
74
- clustering
84
+ Currently only works on Partial Mode: Clustering output file from secondary round of clustering.
75
85
  -seq_tag SEQUENCE_TAG
76
- Default - "StORF": Unique identifier to be used to
77
- distinguish the second of two rounds of clustered
78
- sequences
79
- -groups CORE_GROUPS Default - ('99,95,15'): Gene family groups to use
86
+ Default - "StORF": Unique identifier to be used to distinguish the second of two rounds of clustered sequences
87
+ -core_groups CORE_GROUPS
88
+ Default - ('99,95,15'): Gene family groups to use for "Species" mode
89
+ -genus_groups GENUS_GROUPS
90
+ Default - ('1,2,3,4,5,6'): Gene family groups to use for "Genus" mode
80
91
 
81
92
  Output Parameters:
82
- -w WRITE_FAMILIES Default - No output: Output sequences of identified
83
- families (provide levels at which to output "-w 99,95"
84
- - Must provide FASTA file with -fasta
85
- -con CON_CORE Default - No output: Output aligned and concatinated
86
- sequences of identified families - used for MSA
87
- (provide levels at which to output "-w 99,95" - Must
88
- provide FASTA file with -fasta
93
+ -w WRITE_FAMILIES Default - No output: Output sequences of identified families (provide levels at which to output "-w 99,95" - Must provide FASTA file with -fasta
94
+ -con CON_CORE Default - No output: Output aligned and concatinated sequences of identified families - used for MSA (provide levels at which to output "-w 99,95" - Must provide FASTA file with -fasta
89
95
  -original_fasta ORIGINAL_FASTA
90
- FASTA file to use in conjunction with "-w" or "-con"
91
- when running in Partial Mode.
96
+ FASTA file to use in conjunction with "-w" or "-con" when running in Partial Mode.
92
97
  -gpa GENE_PRESENCE_ABSENCE_OUT
93
- Default - False: If selected, a Roary formatted
94
- gene_presence_absence.csv will be created - Required
95
- for Coinfinder and other downstream tools
98
+ Default - False: If selected, a Roary formatted gene_presence_absence.csv will be created - Required for Coinfinder and other downstream tools
96
99
 
97
100
  Misc:
98
101
  -verbose {True,False}
@@ -101,25 +104,6 @@ Misc:
101
104
 
102
105
  ```
103
106
 
104
- ### Examples: Below are two examples of running PyamilySeq in its two main modes.
105
- #### 'Full Mode': Will conduct clustering of sequences as part of PyamilySeq run
106
- ```bash
107
- PyamilySeq -run_mode Full -group_mode Species -output_dir ../../test_data/testing -input_type combined -input_dir .../test_data/genomes -name_split _combined.gff3 -pid 0.99 -len_diff 0.99 -clust_tool CD-HIT -gpa True -con True -w 99 -verbose True
108
- ```
109
- #### 'Partial Mode': Will take the output of a sequence clustering
110
- ```bash
111
- PyamilySeq -run_mode Partial -group_mode Species -output_dir .../test_data/testing -cluster_file .../test_data/CD-HIT/combined_Ensmbl_pep_CD_90_60.clstr -clust_tool CD-HIT -original_fasta .../test_data/combined_Ensmbl_cds.fasta -gpa True -con True -w 99 -verbose True
112
- ```
113
-
114
- ```bash
115
- Calculating Groups
116
- Gene Groups:
117
- first_core_99: 3103
118
- first_core_95: 0
119
- first_core_15: 3217
120
- first_core_0: 4808
121
- Total Number of Gene Groups (Including Singletons): 11128
122
- ```
123
107
 
124
108
  ## Seq-Combiner: This tool is provided to enable the pre-processing of multiple GFF/FASTA files together ready to be clustered by the user
125
109
  ### Example:
@@ -130,7 +114,7 @@ Seq-Combiner -input_dir .../test_data/genomes -name_split _combined.gff3 -output
130
114
  ```bash
131
115
  usage: Seq_Combiner.py [-h] -input_dir INPUT_DIR -input_type {separate,combined} -name_split NAME_SPLIT -output_dir OUTPUT_DIR -output_name OUTPUT_FILE
132
116
 
133
- Seq-Combiner v0.5.1: Seq-Combiner Run Parameters.
117
+ Seq-Combiner v0.6.0: Seq-Combiner Run Parameters.
134
118
 
135
119
  options:
136
120
  -h, --help show this help message and exit
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = PyamilySeq
3
- version = v0.5.1
3
+ version = v0.6.0
4
4
  author = Nicholas Dimonaco
5
5
  author_email = nicholas@dimonaco.co.uk
6
6
  description = PyamilySeq - A a tool to look for sequence-based gene families identified by clustering methods such as CD-HIT, DIAMOND, BLAST or MMseqs2.
@@ -0,0 +1,2 @@
1
+ PyamilySeq_Version = 'v0.6.0'
2
+
@@ -7,11 +7,13 @@ import subprocess
7
7
 
8
8
 
9
9
  try:
10
- from .PyamilySeq_Species import cluster
10
+ from .PyamilySeq_Species import cluster as species_cluster
11
+ from .PyamilySeq_Genus import cluster as genus_cluster
11
12
  from .Constants import *
12
13
  from .utils import *
13
14
  except (ModuleNotFoundError, ImportError, NameError, TypeError) as error:
14
- from PyamilySeq_Species import cluster
15
+ from PyamilySeq_Species import cluster as species_cluster
16
+ from PyamilySeq_Genus import cluster as genus_cluster
15
17
  from Constants import *
16
18
  from utils import *
17
19
 
@@ -25,7 +27,8 @@ def run_cd_hit(input_file, clustering_output, options):
25
27
  '-o', clustering_output,
26
28
  '-c', str(options.pident),
27
29
  '-s', str(options.len_diff),
28
- '-T', "20",
30
+ '-T', str(options.clustering_threads),
31
+ '-M', str(options.clustering_memory),
29
32
  '-d', "0",
30
33
  '-sc', "1",
31
34
  '-sf', "1"
@@ -43,8 +46,8 @@ def main():
43
46
  required.add_argument('-run_mode', action='store', dest='run_mode', choices=['Full','Partial'],
44
47
  help='Run Mode: Should PyamilySeq be run in "Full" or "Partial" mode?',
45
48
  required=True)
46
- required.add_argument('-group_mode', action='store', dest='group_type', choices=['Species'],
47
- help='Group Mode: Should PyamilySeq be run in "Species" or "Genus" mode? - Genus mode not currently functioning',
49
+ required.add_argument('-group_mode', action='store', dest='group_type', choices=['Species', 'Genus'],
50
+ help='Group Mode: Should PyamilySeq be run in "Species" or "Genus" mode? ',
48
51
  required=True)
49
52
  required.add_argument("-clust_tool", action="store", dest="clust_tool", choices=['CD-HIT'],
50
53
  help="Clustering tool to use: CD-HIT, DIAMOND, BLAST or MMseqs2.",
@@ -70,7 +73,14 @@ def main():
70
73
  full_mode_args.add_argument("-len_diff", action="store", dest="len_diff", type=float, default=0.80,
71
74
  help="Default 0.80: Minimum length difference between clustered sequences - (-s) threshold for CD-HIT clustering.",
72
75
  required=False)
73
-
76
+ ###Clustering Arguments
77
+ clustering_args = parser.add_argument_group('Clustering Runtime Arguments - Optional when "-run_mode Full" is used')
78
+ clustering_args.add_argument("-mem", action="store", dest="clustering_memory", type=int, default=4000,
79
+ help="Default 4000: Memory to be allocated for clustering (in MBs).",
80
+ required=False)
81
+ clustering_args.add_argument("-t", action="store", dest="clustering_threads", type=int, default=4,
82
+ help="Default 4: Threads to be allocated for clustering.",
83
+ required=False)
74
84
 
75
85
  ###Partial-Mode Arguments
76
86
  partial_mode_args = parser.add_argument_group('Partial-Mode Arguments - Required when "-run_mode Partial" is used')
@@ -80,13 +90,17 @@ def main():
80
90
 
81
91
  ###Grouping Arguments
82
92
  grouping_args = parser.add_argument_group('Grouping Arguments - Use to fine-tune grouping of genes after clustering')
83
- grouping_args.add_argument('-reclustered', action='store', dest='reclustered', help='Clustering output file from secondary round of clustering',
93
+ grouping_args.add_argument('-reclustered', action='store', dest='reclustered',
94
+ help='Currently only works on Partial Mode: Clustering output file from secondary round of clustering.',
84
95
  required=False)
85
96
  grouping_args.add_argument('-seq_tag', action='store', dest='sequence_tag', default='StORF',
86
97
  help='Default - "StORF": Unique identifier to be used to distinguish the second of two rounds of clustered sequences',
87
98
  required=False)
88
- grouping_args.add_argument('-groups', action="store", dest='core_groups', default="99,95,15",
89
- help='Default - (\'99,95,15\'): Gene family groups to use',
99
+ grouping_args.add_argument('-core_groups', action="store", dest='core_groups', default="99,95,15",
100
+ help='Default - (\'99,95,15\'): Gene family groups to use for "Species" mode',
101
+ required=False)
102
+ grouping_args.add_argument('-genus_groups', action="store", dest='genus_groups', default="1,2,3,4,5,6",
103
+ help='Default - (\'1,2,3,4,5,6\'): Gene family groups to use for "Genus" mode',
90
104
  required=False)
91
105
 
92
106
  ###Output Arguments
@@ -118,6 +132,8 @@ def main():
118
132
 
119
133
  ### Checking all required parameters are provided by user
120
134
  if options.run_mode == 'Full':
135
+ if options.reclustered != None:
136
+ sys.exit("Currently reclustering only works on Partial Mode.")
121
137
  required_full_mode = [options.input_type, options.input_dir, options.name_split, options.clust_tool,
122
138
  options.pident, options.len_diff]
123
139
  if all(required_full_mode):
@@ -157,7 +173,7 @@ def main():
157
173
  else:
158
174
  exit("mafft is not installed. Please install mafft to proceed.")
159
175
  ##CD-HIT
160
- if options.clust_tool == 'CD-HIT':
176
+ if options.clust_tool == 'CD-HIT' and options.run_mode == 'Full':
161
177
  if is_tool_installed('cd-hit'):
162
178
  if options.verbose == True:
163
179
  print("cd-hit is installed. Proceeding with clustering.")
@@ -167,7 +183,7 @@ def main():
167
183
  if options.write_families != None and options.original_fasta == False:
168
184
  exit("-fasta must br provided if -w is used")
169
185
 
170
- options.core_groups = options.core_groups + ',0'
186
+
171
187
 
172
188
 
173
189
  if options.cluster_file:
@@ -183,24 +199,30 @@ def main():
183
199
  combined_out_file = os.path.join(output_path, "combined_sequences.fasta")
184
200
  clustering_output = os.path.join(output_path, 'clustering_' + options.clust_tool)
185
201
 
186
-
187
- if options.run_mode == 'Full':
188
-
202
+ if options.group_type == 'Species':
203
+ options.core_groups = options.core_groups + ',0'
204
+ groups_to_use = options.core_groups
205
+ else:
206
+ options.genus_groups = options.genus_groups + ',>'
207
+ groups_to_use = options.genus_groups
189
208
 
190
209
 
210
+ if options.run_mode == 'Full':
191
211
  if options.input_type == 'separate':
192
212
  read_separate_files(options.input_dir, options.name_split, combined_out_file)
193
213
  else:
194
214
  read_combined_files(options.input_dir, options.name_split, combined_out_file)
195
215
 
196
216
  run_cd_hit(combined_out_file, clustering_output, options)
217
+
197
218
  class clustering_options:
198
219
  def __init__(self):
199
220
  self.cluster_format = options.clust_tool
200
221
  self.reclustered = options.reclustered
201
222
  self.sequence_tag = options.sequence_tag
202
- self.core_groups = '99,95,15,0'
223
+ self.core_groups = groups_to_use
203
224
  self.clusters = clustering_output + clust_affix
225
+ self.output_dir = options.output_dir
204
226
  self.gene_presence_absence_out = options.gene_presence_absence_out
205
227
  self.write_families = options.write_families
206
228
  self.con_core = options.con_core
@@ -215,8 +237,9 @@ def main():
215
237
  self.cluster_format = options.clust_tool
216
238
  self.reclustered = options.reclustered
217
239
  self.sequence_tag = options.sequence_tag
218
- self.core_groups = '99,95,15,0'
240
+ self.core_groups = groups_to_use
219
241
  self.clusters = options.cluster_file
242
+ self.output_dir = options.output_dir
220
243
  self.gene_presence_absence_out = options.gene_presence_absence_out
221
244
  self.write_families = options.write_families
222
245
  self.con_core = options.con_core
@@ -226,9 +249,10 @@ def main():
226
249
  clustering_options = clustering_options()
227
250
 
228
251
 
229
-
230
-
231
- cluster(clustering_options)
252
+ if options.group_type == 'Species':
253
+ species_cluster(clustering_options)
254
+ elif options.group_type == 'Genus':
255
+ genus_cluster((clustering_options))
232
256
 
233
257
  print("Thank you for using PyamilySeq -- A detailed user manual can be found at https://github.com/NickJD/PyamilySeq\n"
234
258
  "Please report any issues to: https://github.com/NickJD/PyamilySeq/issues\n#####")