Skip to content

Commit

Permalink
clean up some old noqas and ignores
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jan 31, 2025
1 parent 0a4cc21 commit cdb2632
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 17 deletions.
13 changes: 6 additions & 7 deletions src/ga4gh/vrs/__init__.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
# flake8: noqa
"""Public interface to the GA4GH Variation Representation reference
implementation
"""

from importlib.metadata import version, PackageNotFoundError
from importlib.metadata import PackageNotFoundError, version

from .normalize import normalize
from .enderef import vrs_deref, vrs_enref
from .models import VrsType
from . import models
from ga4gh.vrs import models
from ga4gh.vrs.enderef import vrs_deref, vrs_enref
from ga4gh.vrs.models import VrsType
from ga4gh.vrs.normalize import normalize

__all__ = ["normalize", "vrs_deref", "vrs_enref", "VrsType", "models"]
__all__ = ["VrsType", "models", "normalize", "vrs_deref", "vrs_enref"]

try:
__version__ = version(__name__)
Expand Down
1 change: 0 additions & 1 deletion src/ga4gh/vrs/dataproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ def create_dataproxy(uri: str | None = None) -> _DataProxy:

if provider == "seqrepo":
if proto in ("", "file"):
# pylint: disable=import-error, import-outside-toplevel
from biocommons.seqrepo import SeqRepo

sr = SeqRepo(root_dir=parsed_uri.path)
Expand Down
18 changes: 9 additions & 9 deletions src/ga4gh/vrs/extras/vcf_annotation.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _set_log_level(ctx: dict, param: str, value: _LogLevel) -> None: # noqa: AR
help="Require validation checks to pass to construct a VRS object.",
)
@click.option("--silent", "-s", is_flag=True, default=False, help="Suppress messages printed to stdout")
def _annotate_vcf_cli( # pylint: disable=too-many-arguments
def _annotate_vcf_cli(
vcf_in: pathlib.Path,
vcf_out: pathlib.Path | None,
vrs_pickle_out: pathlib.Path | None,
Expand Down Expand Up @@ -188,7 +188,7 @@ def _annotate_vcf_cli( # pylint: disable=too-many-arguments
click.echo(msg)


class VCFAnnotator: # pylint: disable=too-few-public-methods
class VCFAnnotator:
"""Annotate VCFs with VRS allele IDs.
Uses pysam to read, store, and (optionally) output VCFs. Alleles are translated
Expand Down Expand Up @@ -231,7 +231,7 @@ def __init__(
self.tlr = AlleleTranslator(self.dp)

@use_ga4gh_compute_identifier_when(VrsObjectIdentifierIs.MISSING)
def annotate( # pylint: disable=too-many-arguments,too-many-locals
def annotate(
self,
vcf_in: str,
vcf_out: str | None = None,
Expand Down Expand Up @@ -266,7 +266,7 @@ def annotate( # pylint: disable=too-many-arguments,too-many-locals
info_field_desc = "REF and ALT" if compute_for_ref else "ALT"

vrs_data = {}
vcf_in = pysam.VariantFile(filename=vcf_in) # pylint: disable=no-member
vcf_in = pysam.VariantFile(filename=vcf_in)
vcf_in.header.info.add(
self.VRS_ALLELE_IDS_FIELD,
info_field_num,
Expand Down Expand Up @@ -310,7 +310,7 @@ def annotate( # pylint: disable=too-many-arguments,too-many-locals
)

if vcf_out:
vcf_out = pysam.VariantFile(vcf_out, "w", header=vcf_in.header) # pylint: disable=no-member
vcf_out = pysam.VariantFile(vcf_out, "w", header=vcf_in.header)

output_vcf = bool(vcf_out)
output_pickle = bool(vrs_pickle_out)
Expand Down Expand Up @@ -355,7 +355,7 @@ def annotate( # pylint: disable=too-many-arguments,too-many-locals
with open(vrs_pickle_out, "wb") as wf:
pickle.dump(vrs_data, wf)

def _get_vrs_object( # pylint: disable=too-many-arguments,too-many-locals
def _get_vrs_object(
self,
vcf_coords: str,
vrs_data: dict,
Expand Down Expand Up @@ -400,7 +400,7 @@ def _get_vrs_object( # pylint: disable=too-many-arguments,too-many-locals
vrs_obj = None
_logger.exception("AssertionError when translating %s from gnomad", vcf_coords)
raise
except Exception: # pylint: disable=broad-except
except Exception:
vrs_obj = None
_logger.exception("Unhandled Exception when translating %s from gnomad", vcf_coords)
raise
Expand Down Expand Up @@ -430,11 +430,11 @@ def _get_vrs_object( # pylint: disable=too-many-arguments,too-many-locals
vrs_field_data[self.VRS_ENDS_FIELD].append(end)
vrs_field_data[self.VRS_STATES_FIELD].append(alt)

def _get_vrs_data( # pylint: disable=too-many-arguments,too-many-locals
def _get_vrs_data(
self,
record: pysam.VariantRecord,
vrs_data: dict,
assembly: str, # pylint: disable=no-member
assembly: str,
additional_info_fields: list[str],
vrs_attributes: bool = False,
output_pickle: bool = True,
Expand Down

0 comments on commit cdb2632

Please sign in to comment.