A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/samtools/samtools/issues/2160 below:

samtools cat fails to accept -@ option · Issue #2160 · samtools/samtools · GitHub

Are you using the latest version of samtools and HTSlib?

Yes (both v1.21).

Please describe your environment. Please specify the steps taken to generate the issue, the command you are running and the relevant output.

Running samtools cat with option -@n (replacing n with some INT number of threads, in my case 2) yields the following error:

cat: invalid option -- '@'
cat: invalid option -- '2'

followed by the usage/help message. Note that the usage message does not mention the -@ option, however, the man page does (man samtools-cat):

       -@, --threads INT
               Number of input/output compression threads to use in addition to main thread [0].

Using samtools cat --threads 2 does not display the same error message, but it does fail to concatenate the files. This causes any subsequent command in a pipeline to see no input on its stdin. As a simple example, piping the output to samtools view yields the following (perfectly reasonable) error (samtools cat --threads 2 -b bams.list | samtools view):

[main_samview] fail to read the header from "-".

Notably, using --output-fmt-option nthreads=2 does not yield any errors and I do see output (though I tested with only a quick pipe to head, so I don't technically know if the full file would have worked).

Note that a similar issue was reported in 2020: #1336. It was addressed with pull request #1337, though these changes appear not to persist in v1.21.

If samtools cat is able to make use of additional threads, then some changes need to be made to the getopt argument parsing and possibly other places to pass the correct things to subsequent functions. If it is not able to make use of additional threads, then the manual page should be modified to at least remove -@, --threads and possibly also add a note that additional threads cannot be utilized here.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4