Skip to content

Commit

Permalink
Minor fixes and inputs checks
Browse files Browse the repository at this point in the history
- Version flag now gets correct package version
- Sample more reads when checking for consistent
  reads sizes
- Check for overlap between SV chroms and CNVs
  intended to make errors clearer, see
  #25
  • Loading branch information
mcmero committed May 25, 2024
1 parent b7befae commit ea39282
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion SVclone/SVprocess/bamtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def estimateInsertSizeDistribution(bamfile,


def estimateTagSize(bamfile,
alignments=10,
alignments=1000,
multiple="error"):
'''estimate tag size from first alignments in file.'''
samfile = pysam.AlignmentFile(bamfile)
Expand Down
3 changes: 2 additions & 1 deletion SVclone/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,13 @@

import argparse
import numpy as np
import pkg_resources

def main():

parser = argparse.ArgumentParser(prog='SVclone')

parser.add_argument('--version', action='version', version='SVclone-1.0.2')
parser.add_argument('--version', action='version', version=pkg_resources.get_distribution("SVclone").version)

subparsers = parser.add_subparsers()

Expand Down
7 changes: 7 additions & 0 deletions SVclone/run_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,13 @@ def match_copy_numbers(var_df, cnv_df, strict_cnv_filt, sv_offset, bp_fields=['c
bp_chroms = np.unique(var_df[chrom_field].values)
bp_chroms = natural_sort(bp_chroms)

bp_chrom_overlap = [bchr in cnv_df['chr'].values for bchr in bp_chroms]
if not np.any(bp_chrom_overlap):
raise ValueError('''
No SV chroms match the CNV input!
Check that your chromosome names are compatible.
''')

adj_cnv_field = '%s_adjacent' % gtype_field
cnv_dist_field = '%s_cnv_boundary_dist' % gtype_field

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from setuptools import setup, find_packages

setup(name='SVclone',
version='v1.1.0',
version='v1.1.3',
description='A computational method for inferring the cancer cell fraction of tumour structural variation from whole-genome sequencing data.',
url='https://github.com/mcmero/SVclone',
author='Marek Cmero',
Expand Down

0 comments on commit ea39282

Please sign in to comment.