Cstag

Latest version: v1.1.0

Safety actively analyzes 681812 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 4

1.1.0

🔥 Breaking

- Remove `to_pdf` because the dependencies of `weasyprint` are complex, and installation fails on macOS (osx-arm64).
- We would like to leave the saving of HTML to PDF to the browser's functionality.

1.0.4

New features
- None
Maintenance
- fix typo
- add test cases described in README

1.0.3

New feature

+ None

Maintenance

+ Fixed a bug in the RD calculation
+ For instance, in the case of ["=C-g", "=C"], the correct approach is to separate the REF's CG and C to calculate RD (initially RD=1, next RD=1). However, since it was counting all the Cs (RD=2), it has been modified to calculate them separately.

python
import cstag

cs_tags = [
'=A*cg=GTAC',
'=AC-g=TAC',
'=ACGT+ggAC',
]
chroms = ["chr1", "chr1", "chr1"]
positions = [10, 10, 10]

x = cstag.to_vcf(cs_tags, chroms, positions)
print(x)


Before:

chr1 11 . CG C . . DP=4;RD=3;AD=1;VAF=0.25
chr1 11 . C G . . DP=4;RD=3;AD=1;VAF=0.25
chr1 13 . T TGG . . DP=3;RD=2;AD=1;VAF=0.333


After:

chr1 11 . CG C . . DP=2;RD=1;AD=1;VAF=0.5
chr1 11 . C G . . DP=3;RD=2;AD=1;VAF=0.333
chr1 13 . T TGG . . DP=3;RD=2;AD=1;VAF=0.333

1.0.2

Maintenance

+ Fixed a calculation error in RD in `to_vcf.call_reference_depth`
+ Previously, only the Cs tags that matched the reference were considered, resulting in a match (adding 1 to RD) for sequences like deletions (e.g., `=T, -c, -c`).
+ Changed the policy to add 1 to RD if the sequence corresponding to `v.ref` exists in the CS tags.

+ Due to the change in `cstag.consensus.normalize_read_lengths` in v1.0.1, where insufficient read lengths are now padded with `None` instead of `N`, a bug arose in `to_vcf.call_reference_depth` where it referred to `None`. This has been fixed.

python
import cstag

cs_tags = [
'=A*cg=G+aa=T-ac=G',
'*cg=G+aa=T-ac=G',
'=G-t=ACG'
]
chroms = ['chr1', 'chr1', 'chr1']
positions = [10, 11, 12]

print(cstag.to_vcf(cs_tags, chroms, positions))
before
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/kuno/miniconda3/lib/python3.10/site-packages/cstag/to_vcf.py", line 340, in to_vcf
return process_cs_tags(cs_tags, chroms, positions)
File "/home/kuno/miniconda3/lib/python3.10/site-packages/cstag/to_vcf.py", line 285, in process_cs_tags
reference_depth = call_reference_depth(variant_annotations, cs_tags_list, positions_list)
File "/home/kuno/miniconda3/lib/python3.10/site-packages/cstag/to_vcf.py", line 202, in call_reference_depth
if cs[i][0] in ACGT:
TypeError: 'NoneType' object is not subscriptable

after
fileformat=VCFv4.2
INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
INFO=<ID=RD,Number=1,Type=Integer,Description="Depth of Ref allele">
INFO=<ID=AD,Number=1,Type=Integer,Description="Depth of Alt allele">
INFO=<ID=VAF,Number=1,Type=Float,Description="Variant allele fractions (AD/DP)">
CHROM POS ID REF ALT QUAL FILTER INFO
chr1 11 . C G . . DP=2;RD=0;AD=2;VAF=1.0
chr1 12 . GT G . . DP=2;RD=1;AD=1;VAF=0.5
chr1 12 . G GAA . . DP=3;RD=1;AD=2;VAF=0.667
chr1 13 . TAC T . . DP=2;RD=0;AD=2;VAF=1.0

1.0.1

- [x] Made changes in `consensus` to not consider `N` due to insufficient read numbers.


cs_tags = [
'=A*cg=G+aa=T-ac=G',
'*cg=G+aa=T-ac=G',
'=G-t=ACG'
]
positions = [10, 11, 12]

cstag.consensus(cs_tags, positions)
result: =N*cg=G+aa=T-ac=G
expected: =A*cg=G+aa=T-ac=G



- [x] Modified `consensus` to split the deletion tags.
- Added `expand_deletion_tags` to split the deletions.


cs_tags = [
'=A*cg=G+aa=T-ac=G',
'*cg=G+aa=T-ac=G',
'=G-t=ACG'
]
positions = [10, 11, 12]

cstag.consensus(cs_tags, positions)
result: =N*cg=G+aa=T-ac=GN
expected: =N*cg=G+aa=T-ac=G


- [x] Tried other libraries as installing weasyprint is challenging on mac and windows. However, continued using weasyprint as CSS was not applied.
+ fpdf2
+ borb
+ xhtml2pdf

1.0.0

Breaking changes

- Removed -f/--file and allowed direct file input

Enhancements

- None

Maintenance Updates

- Validated that no errors occur with real BAM files
- If an error occurred, modified to output the query_name of the read that caused the error
- Confirmed visualizability in IGV
- Fixed the bug where the program would hang when input was empty
- Modified to display a help message using the select module when there is no IO
- Aligned supported Operating Systems with Pysam
- POSIX, Unix, MacOS
+ Added COC (Code of Conduct)
+ Added GitHub Issue templates (bug and feature)
+ pysam -> bamnostic (failed)
+ We've decided to continue using Pysam, as [Bamnostic](https://github.com/betteridiot/bamnostic) was unable to convert SAM to AlignmentFile format
+ Changed the build backend in pyproject.toml from setuptools to poetry
+ As homepage wasn't reflected in grayskull's meta.yaml when using setuptools
+ Translate all Japanese to English

Page 1 of 4

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.