Skip to content

Releases: akikuno/cstag

1.1.0

28 Jul 05:46
830078d
Compare
Choose a tag to compare

🔥 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

06 Oct 03:31
Compare
Choose a tag to compare

New features

  • None

Maintenance

  • fix typo
  • add test cases described in README

1.0.3

04 Oct 02:35
a5a46f1
Compare
Choose a tag to compare

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

04 Oct 00:05
adb7030
Compare
Choose a tag to compare

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.

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

03 Oct 08:17
bac87ad
Compare
Choose a tag to compare
  • 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
  • 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
  • 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

02 Oct 21:08
Compare
Choose a tag to compare

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

14 Sep 02:12
07cee1a
Compare
Choose a tag to compare

New Features

Core Enhancements

  • Enhanced cstag.to_vcf to support multiple cs_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 within cstag.consensus.
  • Added Vcf and VcfInfo classes to to_vcf.

Maintenance Updates

  • Revised normalize_read_lengths to eliminate deque output.
  • Debugged to_html to properly handle =N.

0.6.1

03 Sep 01:51
Compare
Choose a tag to compare

bug fix: cstag.consensus

  • POS does not consider CIGAR's softclips, so removed extract_softclips and calculate_read_starts function

0.6.0

02 Sep 23:51
ca67532
Compare
Choose a tag to compare
  • add cstag.to_vcf function

0.5.1

02 Sep 02:40
cfcaced
Compare
Choose a tag to compare
  • add prefix
  • convert the argument from uppercase to lowercase and standardize the format (e.g. CSTAG -> cs_tag)
  • add utils.validator.py
  • add python requirements >= 3.7