[med-svn] [Git][med-team/cyvcf2][upstream] New upstream version 0.30.16

Andreas Tille (@tille) gitlab at salsa.debian.org
Tue Aug 23 15:38:28 BST 2022



Andreas Tille pushed to branch upstream at Debian Med / cyvcf2


Commits:
a6afb4b5 by Andreas Tille at 2022-08-23T16:36:02+02:00
New upstream version 0.30.16
- - - - -


3 changed files:

- .github/workflows/wheels.yml
- cyvcf2/__init__.py
- cyvcf2/cli.py


Changes:

=====================================
.github/workflows/wheels.yml
=====================================
@@ -51,7 +51,7 @@ jobs:
       run: |
         python -m cibuildwheel --output-dir wheelhouse
       env:
-        CIBW_SKIP: "pp* cp310-* *i686*"
+        CIBW_SKIP: "pp* *i686*"
         CIBW_ARCHS_MACOS: "x86_64 arm64"
         CIBW_MANYLINUX_X86_64_IMAGE: manylinux2014
         CIBW_BEFORE_BUILD_MACOS: "{project}/ci/osx-deps"


=====================================
cyvcf2/__init__.py
=====================================
@@ -2,4 +2,4 @@ from .cyvcf2 import (VCF, Variant, Writer, r_ as r_unphased, par_relatedness,
                      par_het)
 Reader = VCFReader = VCF
 
-__version__ = "0.30.15"
+__version__ = "0.30.16"


=====================================
cyvcf2/cli.py
=====================================
@@ -14,7 +14,7 @@ LOG_LEVELS = ['DEBUG', 'INFO', 'WARNING', 'ERROR', 'CRITICAL']
 
 def print_header(vcf_obj, include, exclude, samples=None):
     """Print the header of a vcf obj
-    
+
     Parameters
     ----------
     vcf_obj: cyvcf2.VCF
@@ -27,7 +27,12 @@ def print_header(vcf_obj, include, exclude, samples=None):
     """
     if not samples is None:
         vcf_obj.set_samples(samples)
-    
+
+    if include:
+        include_list = ['ID='+inc+','for inc in include]
+    if exclude:
+        exclude_list = ['ID='+exc+','for exc in exclude]
+
     for header_line in vcf_obj.raw_header.split('\n'):
         if len(header_line) == 0:
             continue
@@ -35,21 +40,21 @@ def print_header(vcf_obj, include, exclude, samples=None):
         if 'INFO' not in header_line:
             pass
         elif include:
-            print_line = any('ID='+inc+','for inc in include)
+            print_line = sum(map(header_line.count, include_list))
         elif exclude:
-            print_line = not any('ID='+exc+','for exc in exclude)
+            print_line = not sum(map(header_line.count, exclude_list))
         if print_line:
             click.echo(header_line)
 
 def print_variant(variant, include, exclude):
     """Print a vcf variant
-    
+
     Parameters
     ----------
     variant: cyvcf2.Variant
     include: tuple
         set of strings with info fields that should be included
-    include: tuple
+    exclude: tuple
         set of strings with info fields that should be included
     """
     if include:
@@ -61,11 +66,11 @@ def print_variant(variant, include, exclude):
         for exc in exclude:
             if variant.INFO.get(exc):
                 del variant.INFO[exc]
-                
+
     print_string = str(variant).rstrip()
     click.echo(print_string)
-        
-    
+
+
 
 @click.command()
 @click.argument('vcf',
@@ -104,7 +109,7 @@ def print_variant(variant, include, exclude):
     help="Set the level of log output.",
     show_default=True,
 )
- at click.option('--silent', 
+ at click.option('--silent',
     is_flag=True,
     help='Skip printing of vcf.'
 )
@@ -129,7 +134,7 @@ def cyvcf2(context, vcf, include, exclude, chrom, start, end, loglevel, silent,
             region = "{0}:{1}-{2}".format(chrom, start, end)
 
     vcf_obj = VCF(vcf)
-    
+
     for inclusion in include:
         if vcf_obj.contains(inclusion):
             log.info("Including %s in output", inclusion)
@@ -143,7 +148,7 @@ def cyvcf2(context, vcf, include, exclude, chrom, start, end, loglevel, silent,
         else:
             log.warning("%s does not exist in header", exclusion)
             context.abort()
-    
+
     if individual:
         # Check if the choosen individuals exists in vcf
         test = True
@@ -157,7 +162,7 @@ def cyvcf2(context, vcf, include, exclude, chrom, start, end, loglevel, silent,
         individual = list(individual)
     else:
         individual = None
-    
+
     # Set individual to be empty list to skip all genotypes
     if no_inds:
         individual = []
@@ -173,12 +178,10 @@ def cyvcf2(context, vcf, include, exclude, chrom, start, end, loglevel, silent,
     except Exception as err:
         log.warning(err)
         context.abort()
-    
+
     if nr_variants is None:
         log.info("No variants in vcf")
         return
-    
+
     log.info("{0} variants parsed".format(nr_variants+1))
     log.info("Time to parse variants: {0}".format(datetime.now() - start_parsing))
-        
-    
\ No newline at end of file



View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/a6afb4b5d5786f919050d0b94e511737d2c5be7f

-- 
View it on GitLab: https://salsa.debian.org/med-team/cyvcf2/-/commit/a6afb4b5d5786f919050d0b94e511737d2c5be7f
You're receiving this email because of your account on salsa.debian.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20220823/6115406f/attachment-0001.htm>


More information about the debian-med-commit mailing list