semvec/pypi-packages huggingface dataset:
qwen-token-counter 0.2.1
A simple token counter for Qwen model series
Requires Python: >=3.7

# Qwen Token Counter

一个简单的Qwen模型系列token计数工具。

## 安装

```bash
pip install qwen-token-counter
```

## 使用方法

有两种使用方式：

1. 快速单次使用：

```python
from qwen_token_counter import get_token_count

text = "你好，世界！"
count = get_token_count(text)
print(f"Token数量: {count}")
```

2. 多次使用（推荐）：

```python
from qwen_token_counter import TokenCounter

counter = TokenCounter()
text1 = "你好，世界！"
text2 = "Hello, World!"

count1 = counter.count_tokens(text1)
count2 = counter.count_tokens(text2)

print(f"文本1的Token数量: {count1}")
print(f"文本2的Token数量: {count2}")
```

## 特点

- 轻量级：只包含必要的tokenizer文件
- 易用：简单的API设计
- 高效：支持批量文本处理
- 准确：使用官方Qwen tokenizer

## 依赖

- Python >= 3.7
- transformers >= 4.51.0

## License

MIT License
QuantNado 0.2.5
Quantile-based peak calling from RPKM bigWig files
Requires Python: >=3.8

# QuantNado

`quantnado-call-peaks` is a quantile-based peak caller for CUT&Tag or ChIP-seq **RPKM-scaled bigWig** files. It tiles the genome, extracts log1p-transformed signal, and outputs BED files of high-signal regions using quantile thresholding. 

`quantnado-make-dataset` generates an `.h5ad` (AnnData) file representing signal matrices across defined regions, using signal from multiple bigWigs.

---

## 📦 Installation

Install from PyPI:

```bash
pip install quantnado
```

Requires Python ≥ 3.8

---

## 🚀 Usage

### 🔹 Call Peaks

```bash
quantnado-call-peaks \
  --bigwig-dir path/to/bigwigs/ \
  --output-dir path/to/output/ \
  --chromsizes path/to/hg38.chrom.sizes \
  --tilesize 128 \
  --quantile 0.98 \
  --merge \
  --blacklist path/to/hg38-blacklist.bed \
  --tmp-dir tmp/
```

This will:
- Tile the genome in 128bp bins
- Extract log1p(RPKM) signal from each bigWig file
- Threshold each track at the 98th percentile (default)
- Output BED files of high-signal bins per track

---

### 🔹 Make Dataset

```bash
quantnado-make-dataset \
  --bigwig-dir path/to/bigwigs/ \
  --output-file dataset.h5ad \
  --chromsizes path/to/hg38.chrom.sizes \
  --regions promoters_1024bp.bed \
  --blacklist hg38-blacklist.bed
```

If `--regions` is not provided, the genome will be tiled using `--binsize` (default: 128 bp).

The resulting `.h5ad` will contain:
- `.X`: matrix of mean RPKM per region per bigwig
- `.obs`: region metadata (chrom, start, end)
- `.var`: track names (from bigWig filenames)

---

## ⚙️ Options

| Option          | Description                                               |
|-----------------|-----------------------------------------------------------|
| `--bigwig-dir`  | Folder with `.bw` or `.bigWig` files                      |
| `--chromsizes`  | Tab-separated chrom.sizes file (`chr\tlength`)            |
| `--blacklist`   | BED file of regions to exclude                            |
| `--tilesize`    | Genomic bin size for peak calling (default: 128 bp)       |
| `--quantile`    | Quantile threshold for peaks (default: 0.98)              |
| `--merge`       | Merge adjacent bins into broader peaks                    |
| `--regions`     | BED file of regions to extract signal over                |
| `--binsize`     | Bin size used if `--regions` is not specified (default: 128) |
| `--output-file` | Path to save `.h5ad` or `.h5mu`                           |

---

## 📁 Output Files

**Peak caller (`quantnado-call-peaks`)**
- `*.bed`: BED files of peaks for each bigwig

**Dataset maker (`quantnado-make-dataset`)**
- `.h5ad`: AnnData file with signal matrix
husky-spider-utils 0.0.1
pyqt-echarts 通过QWebEngine和pyecharts进行处理
Requires Python: >=3.10

# QT-Echarts

## 例子

```python

import sys
from pyecharts.charts import Tree
from PyQt5.QtWidgets import QApplication
from pyecharts import options as opts

from qtecharts.charts_engine import ChartEngine

if __name__ == '__main__':
    data = [
        {
            "children": [
                {"name": "B"},
                {
                    "children": [{"children": [{"name": "I"}], "name": "E"}, {"name": "F"}],
                    "name": "C",
                },
                {
                    "children": [
                        {"children": [{"name": "J"}, {"name": "K"}], "name": "G"},
                        {"name": "H"},
                    ],
                    "name": "D",
                },
            ],
            "name": "A",
        }
    ]
    tree = Tree()
    tree.add("",data)
    tree.set_global_opts(title_opts=opts.TitleOpts(title="Tree-基本示例"))
    app = QApplication(sys.argv)

    engine = ChartEngine(chart=tree)

    engine.show()

    sys.exit(app.exec_())


```
casrel-datautils-LJ 22.1.5
A Chinese relation extraction data utility toolkit based on CasRel model
Requires Python: >=3.7

CasRel 数据处理工具包

这是一个基于 CasRel 模型的中文关系抽取数据处理工具包，支持 BERT 预训练模型。

## 支持的 BERT 模型

- **bert-base-chinese**: 默认中文 BERT 基础模型，适用于通用中文任务，参数量适中，bert_dim=768。

## 安装

- pip install casrel_datautils

## 使用示例

以下是一个使用 `casrel_datautils` 进行数据加载和单条样本处理的示例代码：

```python
from casrel_datautils.Base_Conf import BaseConfig
from casrel_datautils.data_loader import get_dataloader
from casrel_datautils.process import single_sample_process

# 配置基础参数
baseconf = BaseConfig(
    bert_path=r"C:\Lucky_dt\2_bj\BJ_AI23_KG\12days\KG_code\chapter4_code\CasRel_RE\bert-base-chinese", #模型路径
    train_data=r"本地数据路径train.json",
    test_data=r"本地数据路径test.json",
    rel_data=r"本地关系数据路径relation.json",
    batch_size=2
)

# 获取数据加载器
dataloaders = get_dataloader(baseconf)

# 单条样本处理
sample = {"text": "这是一个测试句子"}
input_tensor, mask_tensor = single_sample_process(baseconf, sample)
print(input_tensor.shape)
print(mask_tensor.shape)
```

### 说明

- **BaseConfig**: 用于设置 BERT 模型路径、数据路径和批次大小等参数。
- **get_dataloader**: 返回训练、验证和测试的数据加载器。
- **single_sample_process**: 处理单条文本样本，返回输入张量和掩码张量。

## 注意事项

- 确保数据文件（如 `train.json`、`test.json`、`relation.json`）路径正确。
- 根据任务需求选择合适的 BERT 模型。