concat, head-genome, rename, range: descriptions cut or lost, rename -m overwrites, range wraps, concat -F misplaces fill (exit 0)

オープン
#614 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
go

調査の方向性

The issue gives reproducible examples for concat, head-genome, rename, and range, but names no source files or tests. Start by locating those command implementations and their existing tests, then run the supplied small FASTA cases against each affected command. Done means descriptions are preserved, duplicate rename outputs fail before writing, negative ranges select no records when they end before the first record, and empty concat inputs do not change output.

索引モデルが issue の本文から書いたものです。

説明

Version: seqkit v2.14.0 (bioconda), Linux x86_64

Five problems found with small test files. Each one changes or loses data and
the command exits 0.

concat, head-genome, rename: the description loses its first letter

What happens

When the ID and the description are separated by an even number of spaces or
tabs (2, 4, 6), the first letter of the description is lost.

$ printf '>A  two\nACGT\n>B   three\nACGT\n' > d.fa
$ seqkit concat d.fa d.fa
>B three|three
ACGTACGT
>A wo|wo
ACGTACGT

$ printf '>a  even\nACGT\n>a  even\nACGT\n' > rn.fa
$ seqkit rename rn.fa
>a  even
ACGT
>a_2 ven
ACGT

In head-genome the cut changes which records are written. With one space,
only a1 is written. With two spaces, both descriptions read as A B, so
a2 is written too:

$ printf '>a1  XA B\nACGT\n>a2  YA B\nACGT\n' > e.fa
$ seqkit head-genome e.fa
>a1  XA B
ACGT
>a2  YA B
ACGT

A one-letter description becomes empty: >a1 A gives
[ERRO] no description: a1.

Expected

The description is all the text after the spaces and tabs that follow the ID.
No letter is lost.

concat, head-genome, rename: --id-regexp or --id-ncbi drops every description

What happens

With any --id-regexp other than the exact default text ^(\S+)\s?, or with
--id-ncbi, every description is empty.

$ printf '>a1 desc one\nACGT\n>a1 desc two\nACGT\n' > r.fa
$ seqkit rename --id-regexp '^(\S+)\s' r.fa
>a1 desc one
ACGT
>a1_2
ACGT

$ seqkit concat --id-regexp '^(\S+)\s' r.fa r.fa
>a1
ACGTACGT
...

$ seqkit head-genome --id-regexp '^(\S+)\s' r.fa
[ERRO] no description: a1
Expected

The description stays the same when the expression finds the ID.

rename -m: two inputs with the same base name write one file

What happens

With -m, the output file name is the input base name. Two inputs with the
same base name (or one file given twice) write the same output file. The
second replaces the first. There is no warning.

$ printf '>x\nAAAA\n' > in/ex.fa
$ printf '>y\nCCCC\n' > in2/ex.fa
$ seqkit rename -m -O o in/ex.fa in2/ex.fa; echo $?
0
$ ls o; cat o/ex.fa
ex.fa
>y
CCCC
Expected

An error before any file is written, and a non-zero exit code.

range: two negative numbers past the start select wrong records

What happens

On a file of 10 records, a range that ends before the first record should
give nothing. The end index wraps around instead.

$ printf '>r%d\nA\n' 1 2 3 4 5 6 7 8 9 10 > ten.fa
$ seqkit range -r -11:-11 ten.fa | grep '>' | tr '\n' ' '
>r1 >r2 >r3 >r4 >r5 >r6 >r7 >r8 >r9 >r10
$ seqkit range -r -100:-95 ten.fa | grep '>' | tr '\n' ' '
>r1 >r2 >r3 >r4 >r5 >r6
Expected

-11:-11 and -100:-95 give no records on a 10-record file. A start before
the first record is cut to record 1, as -15:-8 gives r1 to r3.

concat -f -F: an empty first file moves the fill

What happens

An input file with no records changes the fill when it comes first.

$ printf '>x\nAAA\n>y\nCCC\n' > a.fa
$ printf '>x\nGG\n' > b.fa
$ : > empty.fa
$ seqkit concat -f -F N a.fa b.fa
>x
AAAGG
>y
CCCNN
$ seqkit concat -f -F N empty.fa a.fa b.fa
>x
AAAGGNN
>y
CCCNNNNN

With a.fa empty.fa b.fa, x also gets AAAGGNN.

Expected

A file with no records adds nothing. The output is the same as without it.

主要言語
Go
スター
1.6k
フォーク
188
平均マージ
5日 12時間
マージ済み PR(30日)
1

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

shenwei356/seqkit のほかの issue

shenwei356/seqkit の issue をすべて見る

似ている issue

Go の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。