Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with bwa mem, samtools compatibility #6

Open
MorkYoung opened this issue Aug 10, 2022 · 1 comment
Open

Issue with bwa mem, samtools compatibility #6

MorkYoung opened this issue Aug 10, 2022 · 1 comment
Assignees

Comments

@MorkYoung
Copy link

Hi,

FADU is a great tool, especially for measuring transcription of operons. Unfortunately, I've run into a couple issues with FADU's compatibility with other common tools, such as bwa mem, bowtie2, and samtools.

First, from what I can tell, FADU only uses the optional "NH" sam attribute to detect multi-mapped reads. Neither bowtie2 nor bwa mem annotate alignments with NH. FADU does not return an error/ warning message when run on alignments lacking the NH attribute. Rather, it appears to just treat all reads as individually mapped. It might be helpful to include a warning, or even a script for annotating .bam files with the NH attribute.

Second, FADU will frequently fail on .bam files that have been processed with samtools view. I'm not sure why this is, but it occurs for roughly half of my samples. The error always occurs after the info message:

[ Info: Now finding overlaps between alignment and annotation records...

And the stack trace always ends with:

Stacktrace:
   [1] getindex
    @ ./array.jl:861 [inlined]
  [2] virtualoffset(stream::BGZFStreams.BGZFStream{IOStream})
    @ BGZFStreams ~/.julia/packages/BGZFStreams/qApsr/src/bgzfstream.jl:156
  [3] iterate(iter::OverlapIterator{IOStream}, state::XAM.BAM.OverlapIteratorState)
    @ Main /gsap/archive-bacterial/Users/Mark/conda/envs/fadu/bin/FADU/alignment_overlaps.jl:76
  [4] iterate(iter::OverlapIterator{IOStream})
    @ Main /gsap/archive-bacterial/Users/Mark/conda/envs/fadu/bin/FADU/alignment_overlaps.jl:63
  [5] process_feature_overlaps!(feat_overlaps::Dict{String, FeatureOverlap}, multimapped_dict::Dict{String, StructArray}, reader::XAM.BAM.Reader{IOStream}, feature::GFF3.Record, args::Dict{String, Any})

I've tried messing around with the samtools view parameters but still consistently get the error. It always occurs for some samples, and never for others. FADU runs without error on the original, pre samtools view alignment file, or .bam files created with pysam using the original alignment file as template.

@adkinsrs adkinsrs self-assigned this Aug 15, 2022
@adkinsrs
Copy link
Member

Hi @MorkYoung.

Thank you for the advice for the first issue... I will consider which is the best course of action between adding a warning or implementing alternative detection methods. For the second issue, can you list which version of FADU you are currently using? The latest version is v1.8.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants