Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 6025

samtools view -F option appears to not be functioning

$
0
0

Samtools version:samtools 1.13Using htslib 1.13+ds

Please describe your environment.

  • Windows CPU running Ubuntu 22.04.3 environment
  • machine architecture (run uname -m on Linux/Mac OS or wmic os get OSArchitecture on Windows)
  • ^ result from ubuntu cmd: x86_64
  • ^ Result from windows cmd:OSArchitecture64-bit
  • gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0

Hi,I am trying to separate a bam/sam file based on directionality of reads. Samtools does not have a way to do this from an aligned sam/bam file to a reference sequence that I can find. My attempted workaround was to use samtools view -F or -f options to attempt to separate reads based on alignment flags. I am using the -o option because I need an output to occur if any changes are to happen. The big issue I am running into is that it would appear that my commands are not doing anything at all.

$samtools view -o -F aligned-input.bamNo output message of any kind, no error, no new file produced in my file explorer, no modifications to the existing file in my file explorer

Similarly, the -f version did the same thing:$samtools view -o -f aligned-input.bamNo output message of any kind, no error, no new file produced in my file explorer, no modifications to the existing file in my file explorer

I tried the verbose version of the command:$samtools view -o --require-flags aligned-input.bamNo output message or error, this one did produce a new output file, but it's not a SAM or BAM file, it's just listed as file type "file", and its name is "--require-flags," clearly indicating that that option did not function as intended.

Same thing for the other verbose version:$samtools view -o --excl-flags aligned-input.bamNo output message or error, this one did produce a new output file, but it's not a SAM or BAM file, it's just listed as file type "file", and its name is "--excl-flags," clearly indicating that that option did not function as intended.

I tried to specify a flag (just to try to get it to do anything) in multiple different ways:$samtools view -o -f 0x4 aligned-input.bamOutput in return: "[E::hts_open_format] Failed to open file "0x4" : No such file or directorysamtools view: failed to open "0x4" for reading: No such file or directory"

^This same output happens no matter what tag I try, whether in hexidecimal format or octadecimal formatting, and it also does the same thing for -F and -f.

How do I get the $samtools view -o -F (or -f) aligned-input.bam to do something? Alternatively, if I am barking up the wrong tree, does anyone have a good idea on how to separate a .bam or .sam file based on flags.Thank you for your time, and I hope to get an answer!


Viewing all articles
Browse latest Browse all 6025

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>