wally
wally copied to clipboard
Discrepancies between pysam and wally
Hi, I've been using pysam to extract positions in my target sequence. However, I've encountered some discrepancies when visualizing these alignment positions with Wally. Some positions are not equal. Did I need to consider the orientation of alignments when working with pysam or did it encounter problems when extracting positions of long-read sequences
For wally, forward matches are in blue, reverse matches in orange. I haven't used pysam.
Hi, my concern lies in the fact that both procedures should yield similar results
Does pysam report relative to the match (just the given SAM record) or relative to the primary alignment?
Can you try this with pysam:
echo -e ">ref\nATCTTTGGTGTCTGTGTGTGTGCGCGCGCACGTGCATGTGTGTGAGTTGTCATTGTTTTTGTTTGTTTTG\nTATTCCTCAGAAATAGAAAGCTCCCATTAGG" > ref.fa
echo -e ">query\nATCTTTGGTGTCTGTGTGTGTGCGCGCGCACGTGCATGTGTGTGAGTTGTCATTGTTTTTGTTTGTTTTG\nCCTAATGGGAGCTTTCTATTTCTGAGGAATA" > query.fa
bwa index ref.fa
bwa mem ref.fa query.fa | samtools sort -o query.bam -
samtools index query.bam
wally matches -x 600 -r query -g ref.fa query.bam
Dear @tobiasrausch, I get the following results:
Forward:
Reference Name: ref Reference Start: 0 Reference End: 70 Query Start: 0 Query End: 70
Reverse:
Reference Name: ref Reference Start: 70 Reference End: 101 Query Start: 0 Query End: 31
Dear Tobias, I know it's been a while since my last interaction, but I still don't understand the discrepancies between wally's and pysam's results, specially for reverse matches.