![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tophat uniquely mapped reads | mrfox | Bioinformatics | 2 | 05-23-2013 06:58 AM |
How to get uniquely mapped reads from Tophat | subeet | Bioinformatics | 10 | 11-28-2012 06:56 AM |
not uniquely mapped reads | unidodo | RNA Sequencing | 2 | 04-22-2011 03:07 PM |
DEGseq and uniquely mapped reads | PFS | Bioinformatics | 1 | 07-14-2010 10:37 AM |
cufflinks and non-uniquely mapped reads | clariet | Bioinformatics | 1 | 05-08-2010 12:13 PM |
![]() |
|
Thread Tools |
![]() |
#1 |
Member
Location: New York Join Date: Nov 2011
Posts: 19
|
![]()
Hi there,
I've aligned my ChIP-seq data with BWA and filtered for uniquely mapped reads with this command: samtools view file.bam | grep "XT:A:U" > file.unique.bam Then I tried to convert the file.unique.bam to .bed file with Bedtools but failed. The command I used is: bamToBed -i file.unique.bam > file.bed And I got error message like: BgzfStream ERROR: read block failed - invalid block header BamHeader ERROR: could not read magic number BamReader ERROR: Could not load header data for file.unique.bam Does anyone have this problem before? How can I solve it? Thanks! |
![]() |
![]() |
![]() |
#2 |
Senior Member
Location: Berlin Join Date: Jul 2011
Posts: 156
|
![]()
There are two reasons why it doesn't work:
1. "file.unique.bam" is not in the BAM format (look at "samtools view" for correct usage). 2. You stripped the SAM headers with your grep command. You might need find a better way of filtering for uniquely mapped reads which preserves the SAM headers, or you add the SAM headers back to the header-stripped SAM file you created with your first command afterwards (look at "samtools view"). Then, convert it to BAM with SAMtools and feed it into BEDTools. |
![]() |
![]() |
![]() |
#3 | |
Member
Location: Denver, CO Join Date: Mar 2011
Posts: 37
|
![]() Quote:
Code:
samtools view -H .bam > new.sam Code:
samtools view .bam | grep ... >> new.sam Code:
samtools view -Sb -o unique.bam new.sam |
|
![]() |
![]() |
![]() |
Thread Tools | |
|
|