Releases: akikuno/cstag
1.1.0
1.0.4
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.
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.
- 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.,
-
Due to the change in
cstag.consensus.normalize_read_lengths
in v1.0.1, where insufficient read lengths are now padded withNone
instead ofN
, a bug arose into_vcf.call_reference_depth
where it referred toNone
. This has been fixed.
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
- Made changes in
consensus
to not considerN
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
- Modified
consensus
to split the deletion tags.- Added
expand_deletion_tags
to split the deletions.
- Added
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
- 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
New Features
- Added
to_pdf
function - Added COC (Code of Conduct)
- Added GitHub Issue templates (bug and feature)
Maintenance Updates
- Translated Japanese parts to English
- Updated the Docstring for
to_vcf
- Replaced
to_vcf
's NamedTuple with dataclass- Honestly, there wasn't much change
- Enhanced tests for
to_vcf
0.6.2
New Features
Core Enhancements
-
Enhanced
cstag.to_vcf
to support multiplecs_tags
(list[str]). This update introduces additional headers and content for better data representation:##INFO=<ID=DP,Number=1,Type=Integer,Description="Total Depth">
##INFO=<ID=RD,Number=1,Type=Integer,Description="Depth of Reference Allele">
##INFO=<ID=AD,Number=1,Type=Integer,Description="Depth of Alternate Allele">
##INFO=<ID=VAF,Number=A,Type=Float,Description="Variant Allele Frequency (AD/DP)"> -
Introduced
cstag.to_sequence
for reconstructing subsequences.
Supplementary Features
- Added
validate_cs_tag
for CS tag validation. - Introduced
validate_pos
for position validation. - Implemented
normalize_positions
withincstag.consensus
. - Added
Vcf
andVcfInfo
classes toto_vcf
.
Maintenance Updates
- Revised
normalize_read_lengths
to eliminate deque output. - Debugged
to_html
to properly handle=N
.