![]() |
Unable to intersect BAM file with bedtools
Hi everyone, I'm trying to use bedtools intersect to check the number of mapped reads in target regions (in a .bed file) originated by targeted bisulfite sequencing experiment (EpiSeq Roche).
I used the following command. Code:
./bedtools intersect -bed -abam sample2.bam -b Code:
* WARNING: File sample2.bam has inconsistent naming convention for record: Can someone help us? Thank you. Nicola |
Check your chromosome names.
Are they "chr" style in both bed and bam? |
Quote:
About your question, I think not. In the bed file I have record like this: Code:
chr1 11123000 11123242 chr1:11123018-11123218 Code:
M03971:33:000000000-BN5NL:1:2114:12003:16132 99 NC_000016.9 24163387 255 151M = 24163431 194 TGATCGGTGGTGA Is this the problem? How can I resolve it? Nicola |
NC_000016 is a name used for "chr16".
This the "official" name used at NCBI : https://www.ncbi.nlm.nih.gov/nuccore/NC_000016.10/ You have to convert the "NCBI name" to "chr" names (or vice versa). There are many ways to rename fields. You can always brute force it using a custom simple program or script using your favorite programming language : bash, python, perl, C, etc. Any easy way would be to reheader the bam file. Please see samtools documentation for this. |
Quote:
I'm sorry for the triviality of the problem, but I'm not very practical with this stuff and the bedtools message wasn't very helpful. Again, thank you! Best regards Nicola |
All times are GMT -8. The time now is 11:07 AM. |
Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2021, vBulletin Solutions, Inc.