Samtools view -e not work
0
0
Entering edit mode
24 months ago
octpus616 ▴ 120

Hi,

I recall that samtools provided a powerful expression based filtering feature samtools view -e 'filter_expression', which seemed to work fine in the past, but doesn't work anymore, and I don't know why.

$ samtools view -e 'length(seq)>30' input.bam
view: invalid option -- 'e'
[E::hts_open_format] fail to open file 'length(seq)>30'
samtools view: failed to open "length(seq)>30" for reading: No such file or directory
$ samtools --help

Program: samtools (Tools for alignments in the SAM format)
Version: 1.3.1 (using htslib 1.3.1)

Usage:   samtools <command> [options]

Commands:
  -- Indexing
     dict           create a sequence dictionary file
     faidx          index/extract FASTA
     index          index alignment
...
NGS bam sam samtools • 2.1k views
ADD COMMENT
0
Entering edit mode

Can you update samtools to the newest version?

ADD REPLY
0
Entering edit mode

I also update to 1.16.1, but it also not work. Another command --input-fmt-option is available in 1.16.1. I noted that can be used to instead samtools view -e 'filter_expression'. I still don't know why the previous command is no longer available

ADD REPLY
0
Entering edit mode

also update to 1.16.1, but it also not work

( https://meta.stackexchange.com/questions/147616 ) what was the command ? did you check the $PATH ?

ADD REPLY
0
Entering edit mode

I checked, In fact, I also tried it with an absolute path

$ ~/bin/samtools view -e 'length(seq)>30' input.bam
samtools view: invalid option -- 'e'

Usage: samtools view [options] <in.bam>|<in.sam>|<in.cram> [region ...]
$ ~/bin/samtools --help

Program: samtools (Tools for alignments in the SAM format)
Version: 1.16.1 (using htslib 1.16)

I downloaded the source code from https://sourceforge.net/projects/samtools/ and compile it, and get the binary samtools, I think This is the lastest version

ADD REPLY
0
Entering edit mode

zhangfish Why did you delete this post?

ADD REPLY
0
Entering edit mode

I deleted my existing conda environment and recreated it, then recompiled samtools and now he is able to work, this seems to be a strange problem, I can no longer reproduce it, I don't want this post to be misleading if it cannot reproduce

ADD REPLY
0
Entering edit mode

The comment you added above is more informative and useful to the community than you merely deleting the post. Someone could run into the exact same unreproducible error then try your delete+recreate solution and that might work for them. Don't delete your posts unless you're sure there's no value in them. When someone's given you feedback on the subject matter and you've interacted with them, that interaction is of value and you should no longer feel the need to delete the post.

ADD REPLY

Login before adding your answer.

Traffic: 2331 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6