|
15 | 15 | import gzip |
16 | 16 | import warnings |
17 | 17 | warnings.simplefilter('ignore') |
18 | | -import pkg_resources # part of setuptools |
| 18 | +import importlib.metadata |
19 | 19 | import pandas as pd |
20 | 20 |
|
21 | | -version = pkg_resources.require("lsaBGC-Pan")[0].version |
22 | | - |
| 21 | +try: |
| 22 | + package_name = "lsaBGC-Pan" |
| 23 | + package_version = str(importlib.metadata.version(package_name)) |
| 24 | +except importlib.metadata.PackageNotFoundError: |
| 25 | + package_version = "NA" |
| 26 | + |
23 | 27 | valid_alleles = set(['A', 'C', 'G', 'T']) |
24 | 28 |
|
25 | 29 | def reformatOrthologInfo(ortholog_matrix_file, zol_results_dir, logObject): |
@@ -322,7 +326,7 @@ def runZol(detailed_BGC_listing_with_Pop_and_GCF_map_file, ortholog_listing_file |
322 | 326 |
|
323 | 327 | zp = zol_parameters |
324 | 328 | if zol_high_quality_preset: |
325 | | - zp = '-qa -b -s' |
| 329 | + zp = '-qa -s -b' |
326 | 330 |
|
327 | 331 | for gcf in gcf_sample_bgcs: |
328 | 332 | gcf_bgcs_to_input = [] |
@@ -1726,7 +1730,7 @@ def parseVersion(): |
1726 | 1730 | """ |
1727 | 1731 | Returns suite version. |
1728 | 1732 | """ |
1729 | | - return(str(version)) |
| 1733 | + return(package_version) |
1730 | 1734 |
|
1731 | 1735 | def castToNumeric(x): |
1732 | 1736 | """ |
@@ -1853,12 +1857,11 @@ def createFinalSpreadsheets(detailed_BGC_listing_with_Pop_and_GCF_map_file, zol_ |
1853 | 1857 | 'Proportion of sites which are highly ambiguous in trimmed codon alignment', 'Median GC', 'Median GC Skew', |
1854 | 1858 | 'BGC score (GECCO weights)', 'Viral score (V-Score)'] |
1855 | 1859 |
|
1856 | | - # TODO consider bringing back the following - will affect column referencing for coloring below: |
1857 | | - #if zol_high_qual_flag: |
1858 | | - # zol_sheet_header += ['GARD Partitions Based on Recombination Breakpoints', |
1859 | | - # 'Number of Sites Identified as Under Positive or Negative Selection by FUBAR', |
1860 | | - # 'Average delta(Beta, Alpha) by FUBAR across sites', |
1861 | | - # 'Proportion of Sites Under Selection which are Positive'] |
| 1860 | + if zol_high_qual_flag: |
| 1861 | + zol_sheet_header += ['GARD Partitions Based on Recombination Breakpoints', |
| 1862 | + 'Number of Sites Identified as Under Positive or Negative Selection by FUBAR', |
| 1863 | + 'Average delta(Beta, Alpha) by FUBAR across sites', |
| 1864 | + 'Proportion of Sites Under Selection which are Positive', 'P-value for gene-wide episodic selection by BUSTED'] |
1862 | 1865 |
|
1863 | 1866 | zol_sheet_header += ['KO Annotation (E-value)', 'PGAP Annotation (E-value)', 'PaperBLAST Annotation (E-value)', 'CARD Annotation (E-value)', |
1864 | 1867 | 'IS Finder (E-value)', 'MIBiG Annotation (E-value)', 'VOG Annotation (E-value)', 'VFDB Annotation (E-value)', |
@@ -1896,7 +1899,7 @@ def createFinalSpreadsheets(detailed_BGC_listing_with_Pop_and_GCF_map_file, zol_ |
1896 | 1899 | ls = line.split('\t') |
1897 | 1900 | row = [gcf, ls[0], ls[1], ls[2], comp_cons[gcf][ls[0]]] + ls[3:18] + ls[19:] |
1898 | 1901 | if zol_high_qual_flag: |
1899 | | - row = [gcf, ls[0], ls[1], ls[2], comp_cons[gcf][ls[0]]] + ls[3:22] + ls[23:] |
| 1902 | + row = [gcf, ls[0], ls[1], ls[2], comp_cons[gcf][ls[0]]] + ls[3:23] + ls[24:] |
1900 | 1903 | zctf_handle.write('\t'.join(row) + '\n') |
1901 | 1904 | num_rows += 1 |
1902 | 1905 | zctf_handle.close() |
|
0 commit comments