Tags: dutser/vrs-python
Tags
fix-logging-warnings (ga4gh#552) This PR stops logging unnecessary warnings like: ``` Derived sequence '' is different from provided state.sequence 'root=''' Derived sequence 'CCCC' is different from provided state.sequence 'root='CCCC'' ``` An example for reproducing the warning log. Functionality is correct, but the condition for logging has a small bug. ```python >>> from ga4gh.vrs.extras.translator import AlleleTranslator >>> from ga4gh.vrs.dataproxy import create_dataproxy >>> dp = create_dataproxy('seqrepo+file:///usr/local/share/seqrepo/2024-12-20') >>> translator = AlleleTranslator(data_proxy=dp) >>> allele = translator.translate_from('21-5030497-C-CACCT', 'gnomad') >>> translator.translate_to(allele, 'spdi') Derived sequence 'ACCTACCT' is different from provided state.sequence 'root='ACCTACCT'' ['NC_000021.9:5030497:4:ACCTACCT'] ```
Fix allele translator to_spdi issue for RLE deletion. Add RLE reconst… …ruction when longer than rle_seq_limit. (ga4gh#542) This fixes a bug for `_to_spdi` for ReferenceLengthExpressions. It also adds an optional argument to `translate_to` called `ref_seq_limit` which works similarly to `rle_seq_limit`, but for SPDI expressions. If `ref_seq_limit` is nonzero, the 3rd term of the SPDI expression will be the actual reference sequence, not the length. To round-trip a clinvar SPDI expression which contains the reference sequence: ``` spdi = "NC_000019.10:44908821:C:T" vrs = translator.translate_from(spdi, "spdi") to_spdi = translator.translate_to(vrs, "spdi", ref_seq_limit=None) # or some number >=1 since len("C")==1 assert spdi == to_spdi ``` To continue the existing behavior of using the reference sequence length: ``` spdi = "NC_000019.10:44908821:1:T" vrs = translator.translate_from(spdi, "spdi") to_spdi = translator.translate_to(vrs, "spdi") # ref_seq_limit defaults to 0 assert spdi == to_spdi ``` --------- Co-authored-by: Kori Kuzma <korikuzma@gmail.com>
feat: add optional suppression of allele collection (ga4gh#545) * VCF annotator should not collect alleles if no output is requested by user. This has major implications for memory usage, apparently. * Provide this in a relatively OOP-friendly way without producing a breaking change At the next major version, there is a cleaner way to do this and it should be implemented at that point
cicd: do not install setuptools (ga4gh#539) We were missing an issue upstream about a deprecated stdlib module because `setuptools` comes with an in-place fix -- but `setuptools` wasn't an explicit dependency declared for downstream users. I think we should just start with whatever `setup-python` gives us unless there's a pressing need.
feat!: update models to vrs 2.0.0 community review ballot (ga4gh#471) close ga4gh#469 * Update modules to vrs [2.0.0-ballot.2024-11.3](https://github.com/ga4gh/vrs/tree/2.0.0-ballot.2024-11.3) tag * Rename class `_Ga4ghIdentifiableObject` to `Ga4ghIdentifiableObject` * Removes `entity_models` and `domain_models` from `ga4gh.core`. Now, all gks-core models are in `ga4gh.core.models`. * gks-core includes `date` and `datetime` as primitives, however the builtin `datetime` module already provides these. Initially, I kept them as Pydantic Root Models but I think we should just leverage the `datetime` module instead.
PreviousNext