diff --git a/.gitignore b/.gitignore index 828310b..ed77094 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ *.py[cod] +*.ipynb +.ipynb_checkpoints # C extensions *.so diff --git a/HISTORY.rst b/HISTORY.rst index 30555d5..37f5cad 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,11 @@ History ------- +0.2.9 (10/01/2019) +~~~~~~~~~~~~~~~~~~ + +* Fixed error of not setting correct header information in B/SAM. + 0.2.8 (09/23/2019) ~~~~~~~~~~~~~~~~~~ diff --git a/g2gtools/__init__.py b/g2gtools/__init__.py index d23dbfb..5e783a8 100755 --- a/g2gtools/__init__.py +++ b/g2gtools/__init__.py @@ -1,3 +1,3 @@ -__version__ = '0.2.8' +__version__ = '0.2.9' __author__ = 'Matthew Vincent and Kwangbom \"KB\" Choi, The Jackson Laboratory' __email__ = 'matt.vincent@jax.org' diff --git a/g2gtools/bsam.py b/g2gtools/bsam.py index 38b96fa..63dc60e 100644 --- a/g2gtools/bsam.py +++ b/g2gtools/bsam.py @@ -156,13 +156,12 @@ def convert_bam_file(vci_file, file_in, file_out, reverse=False): name_to_id = {} id = 0 - # TODO: Fix - #for ref_name in sorted(chain_file.chrom_size_to): - # tmp.append({'LN': chain_file.chrom_size_from[ref_name], 'SN': ref_name}) - # name_to_id[ref_name] = id - # id += 1 + for ref_name in vci_file.contigs: + tmp.append({'LN': vci_file.contigs[ref_name], 'SN': ref_name}) + name_to_id[ref_name] = sam_file.get_tid(ref_name) + id += 1 - #new_header['SQ'] = tmp + new_header['SQ'] = tmp if 'PG' not in new_header: new_header['PG'] = [] @@ -309,6 +308,7 @@ def convert_bam_file(vci_file, file_in, file_out, reverse=False): mappings = vci_file.find_mappings(read_chr, read_start, read_end) + # unmapped if mappings is None: LOG.debug("\tFail due to no mappings") diff --git a/setup.cfg b/setup.cfg index 570e0f3..daa2175 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.2.8 +current_version = 0.2.9 commit = True tag = True diff --git a/setup.py b/setup.py index 94df2aa..cab3ff9 100755 --- a/setup.py +++ b/setup.py @@ -30,7 +30,7 @@ setup( name='g2gtools', - version='0.2.8', + version='0.2.9', description="A suite of tools for the reconstruction of personal diploid genomes and better coordinate conversion", long_description=readme + '\n\n' + history, author='Matthew J. Vincent and Kwangbom "KB" Choi, The Jackson Laboratory',