Biostar Beta. Not for public use.
Count mismatchs/Indel number per position in BAM file ?
0
Entering edit mode
23 months ago
Chadi Saad • 60
France

how to count mismatchs number at each position in BAM file ? I found BAM-readcound, but it seems that the bug isn't solved yet : https://github.com/genome/bam-readcount/issues/19 any alternative method ?

alignment • 809 views
ADD COMMENTlink
0
Entering edit mode

Can't you provide non-overlapping intervals?

ADD REPLYlink
0
Entering edit mode

To clarify, are you talking about positions in the read, or in the reference?

ADD REPLYlink
2
Entering edit mode
17 months ago
WCIP | Glasgow | UK

I think pysamstats will do the job here with something like:

pysamstats -f ref.fa --type variation_strand aln.bam > aln.var.txt
ADD COMMENTlink
2
Entering edit mode
17 months ago
France/Nantes/Institut du Thorax - INSE…

my tool FindAllCoverageAtPosition do this job:

http://lindenb.github.io/jvarkit/FindAllCoverageAtPosition.html

$ find ./testdata/ -type f -name "*.bam" | \
 java -jar dist/findallcoverageatposition.jar -p rotavirus:100


#File              CHROM      POS  SAMPLE  DEPTH  M    I  D  N  S   H  P  EQ  X  Base(A)  Base(C)  Base(G)  Base(T)  Base(N)  Base(^)  Base(-)
./testdata/S4.bam  rotavirus  100  S4      126    126  0  0  0  29  0  0  0   0  5        0        0        121      0        0        0
./testdata/S1.bam  rotavirus  100  S1      317    317  1  0  0  50  0  0  0   0  27       0        1        289      0        1        0
./testdata/S2.bam  rotavirus  100  S2      311    311  0  1  0  60  0  0  0   0  29       1        0        281      0        0        1
./testdata/S3.bam  rotavirus  100  S3      446    446  1  0  0  86  0  0  0   0  39       0        1        406      0        1        0

or you can use sam2tsv: http://lindenb.github.io/jvarkit/Sam2Tsv.html

samtools view your.bam "chr1:1234-1234" | java -jar dist/sam2tsv.jar    -r  ref.fa
ADD COMMENTlink
0
Entering edit mode

thank you ! but can I do it for all positions without -p option ?

ADD REPLYlink
0
Entering edit mode

at this point you should just parse the output of samtools mpileup....

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.3.1