PyamilySeq 0.0.1__py3-none-any.whl → 0.2.0__py3-none-any.whl

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.
@@ -0,0 +1,49 @@
1
+
2
+ import argparse
3
+ import gzip
4
+ import glob
5
+
6
+ def combine_files(files, split, glob_location, combined_out):
7
+ count = 0
8
+
9
+ for file in glob.glob(glob_location + '/' + files):
10
+ count += 1
11
+ try:
12
+ with gzip.open(file, 'rb') as genome:
13
+
14
+ for line in genome:
15
+ if line.startswith(b'#'):
16
+ continue
17
+ elif line.startswith(b'>'):
18
+ genome_name = bytes(file.split(split)[0].split('/')[-1], 'utf-8')
19
+ line = line.split(b' ')[0]
20
+ line = line.replace(b'>', b'>' + genome_name + b'|')
21
+ combined_out.write(line.decode('utf-8')+'\n')
22
+ else:
23
+ combined_out.write(line.decode('utf-8'))
24
+ except gzip.BadGzipFile:
25
+ with open(file, 'r') as genome:
26
+
27
+ for line in genome:
28
+ if line.startswith('#'):
29
+ continue
30
+ elif line.startswith('>'):
31
+ genome_name = file.split(split)[0].split('/')[-1]
32
+ line = line.replace('>', '>' + genome_name + '|')
33
+ combined_out.write(line)
34
+ else:
35
+ combined_out.write(line)
36
+
37
+ def main():
38
+ parser = argparse.ArgumentParser(description="Combine gzipped fasta files.")
39
+ parser.add_argument("files", help="File pattern to match within the specified directory.")
40
+ parser.add_argument("split", help="String used to split the file path and extract the genome name.")
41
+ parser.add_argument("glob_location", help="Directory location where the files are located.")
42
+ parser.add_argument("combined_out", help="Output file where the combined data will be written.")
43
+ args = parser.parse_args()
44
+
45
+ with open(args.combined_out, 'w') as combined_out:
46
+ combine_files(args.files, args.split, args.glob_location, combined_out)
47
+
48
+ if __name__ == "__main__":
49
+ main()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: PyamilySeq
3
- Version: 0.0.1
3
+ Version: 0.2.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
@@ -12,7 +12,6 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.6
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
- Requires-Dist: numpy
16
15
 
17
16
  # PyamilySeq
18
17
  PyamilySeq (Family Seek) is a Python tool for clustering gene sequences into families based on sequence similarity identified by tools such as CD-HIT, DIAMOND or MMseqs2.
@@ -32,7 +31,37 @@ PyamilySeq requires Python 3.6 or higher. Install dependencies using pip:
32
31
  pip install PyamilySeq
33
32
  ```
34
33
 
35
- ## Usage
34
+ ## Usage - Menu
35
+ ```
36
+ PyamilySeq_Species.py -h
37
+ usage: PyamilySeq_Species.py [-h] -c CLUSTERS -f {CD-HIT,CSV,TSV} [-w WRITE_FAMILIES] [-fasta FASTA] [-rc RECLUSTERED] [-st SEQUENCE_TAG]
38
+ [-groups CORE_GROUPS] [-gpa GENE_PRESENCE_ABSENCE_OUT] [-verbose {True,False}] [-v]
39
+
40
+ PyamilySeq v0.2.0: PyamilySeq Run Parameters.
41
+
42
+ Required Arguments:
43
+ -c CLUSTERS Clustering output file from CD-HIT, TSV or CSV Edge List
44
+ -f {CD-HIT,CSV,TSV} Which format to use (CD-HIT or Comma/Tab Separated Edge-List (such as MMseqs2 tsv output))
45
+
46
+ Output Parameters:
47
+ -w WRITE_FAMILIES Default - No output: Output sequences of identified families (provide levels at which to output "-w 99 95" - Must provide
48
+ FASTA file with -fasta
49
+ -fasta FASTA FASTA file to use in conjunction with "-w"
50
+
51
+ Optional Arguments:
52
+ -rc RECLUSTERED Clustering output file from secondary round of clustering
53
+ -st SEQUENCE_TAG Default - "StORF": Unique identifier to be used to distinguish the second of two rounds of clustered sequences
54
+ -groups CORE_GROUPS Default - ('99,95,90,80,15'): Gene family groups to use
55
+ -gpa GENE_PRESENCE_ABSENCE_OUT
56
+ Default - False: If selected, a Roary formatted gene_presence_absence.csv will be created - Required for Coinfinder and other
57
+ downstream tools
58
+
59
+ Misc:
60
+ -verbose {True,False}
61
+ Default - False: Print out runtime messages
62
+ -v Default - False: Print out version number and exit
63
+
64
+ ```
36
65
 
37
66
  ### Clustering Analysis
38
67
 
@@ -59,6 +88,7 @@ Replace `reclustered_file` with the path to the file containing additional seque
59
88
  PyamilySeq generates various outputs, including:
60
89
 
61
90
  - **Gene Presence-Absence File**: This CSV file details the presence and absence of genes across genomes.
91
+ - **FASTA Files for Each Gene Family**:
62
92
 
63
93
  ## Gene Family Groups
64
94
 
@@ -0,0 +1,11 @@
1
+ PyamilySeq/CD-Hit_StORF-Reporter_Cross-Genera_Builder.py,sha256=UzQ5iOKCNfurxmj1pnkowF11YfWBO5vnBCKxQK6goB8,26538
2
+ PyamilySeq/Constants.py,sha256=3Nr6JfUVt2eZT4M7fV-sz_bPXIvPgxIBT5nR76kCPIo,30
3
+ PyamilySeq/PyamilySeq_Species.py,sha256=SCWeK7bEfnKLrfzliiOx7Jtmie8vvAXGtQE_PpJD5hY,31040
4
+ PyamilySeq/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ PyamilySeq/combine_FASTA_with_genome_IDs.py,sha256=aMUVSk6jKnKX0g04RMM360QueZS83lRLqLLysBtQbLo,2009
6
+ PyamilySeq-0.2.0.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
7
+ PyamilySeq-0.2.0.dist-info/METADATA,sha256=FUiZzxQzqnOwokb7MflZCMUzK9JgFVUVzEvLBPAlpgk,4144
8
+ PyamilySeq-0.2.0.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
9
+ PyamilySeq-0.2.0.dist-info/entry_points.txt,sha256=zGtA2Ycf0LG3PR7zuuT0wjaAKLFxtyGgBc0O_W7E250,66
10
+ PyamilySeq-0.2.0.dist-info/top_level.txt,sha256=J6JhugUQTq4rq96yibAlQu3o4KCM9WuYfqr3w1r119M,11
11
+ PyamilySeq-0.2.0.dist-info/RECORD,,
@@ -0,0 +1 @@
1
+ PyamilySeq
@@ -1,6 +0,0 @@
1
- PyamilySeq-0.0.1.dist-info/LICENSE,sha256=OXLcl0T2SZ8Pmy2_dmlvKuetivmyPd5m1q-Gyd-zaYY,35149
2
- PyamilySeq-0.0.1.dist-info/METADATA,sha256=gYAN6guZiV3POfjJJTn20Usj3PJZ-UTsdV5gruMo86g,2571
3
- PyamilySeq-0.0.1.dist-info/WHEEL,sha256=Z4pYXqR_rTB7OWNDYFOm1qRk0RX6GFP2o8LgvP453Hk,91
4
- PyamilySeq-0.0.1.dist-info/entry_points.txt,sha256=zGtA2Ycf0LG3PR7zuuT0wjaAKLFxtyGgBc0O_W7E250,66
5
- PyamilySeq-0.0.1.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
6
- PyamilySeq-0.0.1.dist-info/RECORD,,
@@ -1 +0,0 @@
1
-