Skip to content

Commit 8e94505

Browse files
authored
Merge pull request #13 from Kalan-Lab/update
Update to v1.1.4
2 parents c23c060 + c317ad6 commit 8e94505

File tree

5 files changed

+23
-17
lines changed

5 files changed

+23
-17
lines changed

bin/lsaBGC-Sociate

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,10 @@ def lsaBGC_Sociate():
332332
if i == 0: continue
333333
tot_tests += 1
334334

335-
mt_cor_alpha = 0.05/tot_tests
335+
tot_tests = 0
336+
mt_cor_alpha = 0.05
337+
if tot_tests >= 1:
338+
mt_cor_alpha = 0.05/tot_tests
336339

337340
hits = []
338341
sociated_ogs = set([])

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[project]
22
name = "lsaBGC-Pan"
33
authors = [{name="Rauf Salamzade", email="salamzader@gmail.com"}]
4-
version = "1.1.3"
4+
version = "1.1.4"
55
readme = "README.md"
66
description = "lsaBGC-Pan: a workflow/suite for pan-BGC-ome analyses."
77

src/lsaBGC/classes/BGC.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,4 +325,4 @@ def parseGenbanks(self, comprehensive_parsing=True, flank_size=2000):
325325
elif self.prediction_method.upper() == 'GECCO':
326326
self.parseGECCO(comprehensive_parsing=comprehensive_parsing, flank_size=flank_size)
327327
else:
328-
raise RuntimeError("Unable to parse file because BGC prediction method is not an accepted option!")
328+
raise RuntimeError("Unable to parse file because BGC prediction method is not an accepted option!")

src/lsaBGC/classes/Pan.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def runMCLAndReportGCFs(self, mip, jcp, sccp, ccp, outdir, run_parameter_tests=F
367367
try:
368368
subprocess.call(' '.join(mcl_cmd), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
369369
executable='/bin/bash')
370-
assert (os.path.isfile(relations_mcl_file) and os.path.getsize(relations_mcl_file) > 50)
370+
assert (os.path.isfile(relations_mcl_file)) # and os.path.getsize(relations_mcl_file) > 50)
371371
self.logObject.info('Successfully ran: %s' % ' '.join(mcl_cmd))
372372
except Exception as e:
373373
if self.logObject:
@@ -381,7 +381,7 @@ def runMCLAndReportGCFs(self, mip, jcp, sccp, ccp, outdir, run_parameter_tests=F
381381
try:
382382
subprocess.call(' '.join(mcxdump_cmd), shell=True, stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL,
383383
executable='/bin/bash')
384-
assert (os.path.isfile(mcxdump_out_file) and os.path.getsize(mcxdump_out_file) > 50)
384+
assert (os.path.isfile(mcxdump_out_file)) # and os.path.getsize(mcxdump_out_file) > 50)
385385
if self.logObject:
386386
self.logObject.info('Successfully ran: %s' % ' '.join(mcl_cmd))
387387
except Exception as e:

src/lsaBGC/util.py

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,15 @@
1515
import gzip
1616
import warnings
1717
warnings.simplefilter('ignore')
18-
import pkg_resources # part of setuptools
18+
import importlib.metadata
1919
import pandas as pd
2020

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+
2327
valid_alleles = set(['A', 'C', 'G', 'T'])
2428

2529
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
322326

323327
zp = zol_parameters
324328
if zol_high_quality_preset:
325-
zp = '-qa -b -s'
329+
zp = '-qa -s -b'
326330

327331
for gcf in gcf_sample_bgcs:
328332
gcf_bgcs_to_input = []
@@ -1726,7 +1730,7 @@ def parseVersion():
17261730
"""
17271731
Returns suite version.
17281732
"""
1729-
return(str(version))
1733+
return(package_version)
17301734

17311735
def castToNumeric(x):
17321736
"""
@@ -1853,12 +1857,11 @@ def createFinalSpreadsheets(detailed_BGC_listing_with_Pop_and_GCF_map_file, zol_
18531857
'Proportion of sites which are highly ambiguous in trimmed codon alignment', 'Median GC', 'Median GC Skew',
18541858
'BGC score (GECCO weights)', 'Viral score (V-Score)']
18551859

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']
18621865

18631866
zol_sheet_header += ['KO Annotation (E-value)', 'PGAP Annotation (E-value)', 'PaperBLAST Annotation (E-value)', 'CARD Annotation (E-value)',
18641867
'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_
18961899
ls = line.split('\t')
18971900
row = [gcf, ls[0], ls[1], ls[2], comp_cons[gcf][ls[0]]] + ls[3:18] + ls[19:]
18981901
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:]
19001903
zctf_handle.write('\t'.join(row) + '\n')
19011904
num_rows += 1
19021905
zctf_handle.close()

0 commit comments

Comments
 (0)