Skip to content

Commit

Permalink
revert wrongheaded partial sequence handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dorbarker committed May 16, 2019
1 parent 9fe21f1 commit b11ea66
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions fsac/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '0.2.1'
9 changes: 9 additions & 0 deletions fsac/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import sys
from pathlib import Path

from . import __version__
from .allele_call import allele_call
from .update import update_directory
from .tabulate import tabulate_calls
Expand All @@ -11,6 +12,10 @@ def arguments():

parser = argparse.ArgumentParser()

parser.add_argument('-v', '--version',
action='store_true',
help='Print version and exit')

parser.set_defaults(func=None)
subparsers = parser.add_subparsers(title='Commands')

Expand Down Expand Up @@ -76,6 +81,10 @@ def arguments():

args = parser.parse_args()

if args.version:
print('fsac', __version__)
sys.exit(0)

if args.func is None:
parser.print_help()
sys.exit(0)
Expand Down
2 changes: 1 addition & 1 deletion fsac/tabulate.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def parse_gene_calls_from_json(jsonfile: Path):

call = '-1'

elif locus_data['Partial']:
elif locus_data['PercentLength'] < 1:

call = '-2'

Expand Down
8 changes: 1 addition & 7 deletions fsac/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def update_locus(gene: Dict[str, Union[str, int, bool, float]],

# Non-contig trucation
if gene['PercentLength'] < 1:
return gene['SubjAln'], None
return None , None

seq = gene['SubjAln'].replace('-', '')

Expand Down Expand Up @@ -65,12 +65,6 @@ def update_genome(genome_data: Dict[str, GeneData], genes_dir: Path):
if seq is None and name is None:
continue

# If there is a non-contig truncation
if seq is not None and name is None:

gene['Partial'] = True
continue

# TODO ensure null matches are handled appropriately
gene['Mismatches'] = 0
gene['Gaps'] = 0
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from fsac import __version__
from setuptools import setup, find_packages

setup(

name='fsac',
version='0.1',
version=__version__,
packages=find_packages(),
install_requires=[
'pandas>=0.22.0'
Expand Down

0 comments on commit b11ea66

Please sign in to comment.