3:1000-2000 is unlikely to have any reads, it's a hard-masked
telomere. As you surmised, your problem is using a BED file with UCSC
chromosome names and a BAM file with Ensembl chromosome names. If you
fix that then you should get reasonable results.

Devon
--
Devon Ryan, Ph.D.
Email: dpr...@dpryan.com
Data Manager/Bioinformatician
Max Planck Institute of Immunobiology and Epigenetics
Stübeweg 51
79108 Freiburg
Germany


On Thu, May 19, 2016 at 12:51 PM, Bayazit Yunusbayev <yunu...@gmail.com> wrote:
> Dear All,
>
> I have a BAM file with reads from full genome sequencing
>
> and I wanted to extract only reads that match exome sequencing reads
>
> stored in my bed file.
>
> 1) here is the command that I used:
>
> samtools view -b -L CTR9_FEB2015.merged.realigned.bed V54120.bam -o
> exom.V54120.bam
>
> So I got bam file that has only header lines
>
> when checked using: samtools view -H exom.V54120.bam
>
> but no reads! when trying : samtools view exom.V54120.bam
>
> and indeed it is very small in size (5.4 Kb)
>
>
> I am new to samtools and below is my short investigation which, however, did
> not help ;(
>
> I wonder whether I am missing something in my commands? Could anyone help me
> with this?
>
> Thank you!
>
>
> First I tried to check whether anything can be retrieved from the bam file:
>
> samtools view V54120.bam chr1:1000-2000
>
> and got the following error message:
>
> [main_samview] region "chr1:1000-2000" specifies an unknown reference name.
> Continue anyway.
>
>
> Then I checked chromosome names:
>
> samtools view -H /gpfs/rocket/gv/V54120.bam | awk '/@SQ/'
> @SQ   SN:1    LN:249250621    
> UR:http://www.broadinstitute.org/ftp/pub/seq/references/Homo_sapiens_assembly19.fasta
>    AS:GRCh37       M5:1b22b98cdeb4a9304cb5d48026a85128     SP:Homo
> Sapiens
> @SQ   SN:2    LN:243199373    
> UR:http://www.broadinstitute.org/ftp/pub/seq/references/Homo_sapiens_assembly19.fasta
>    AS:GRCh37       M5:a0d9851da00400dec1098a9255ac712e     SP:Homo
> Sapiens
>
>
> Then assuming that 'chr1' should be '1',I tried:
>
> samtools view V54120.bam 3:1000-2000
>
> this produced nothing ;(
>
> no errors and no output to standard output
>
>
>
>
> ------------------------------------------------------------------------------
> Mobile security can be enabling, not merely restricting. Employees who
> bring their own devices (BYOD) to work are irked by the imposition of MDM
> restrictions. Mobile Device Manager Plus allows you to control only the
> apps on BYO-devices by containerizing them, leaving personal data untouched!
> https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
> _______________________________________________
> Samtools-help mailing list
> Samtools-help@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/samtools-help
>

------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Samtools-help mailing list
Samtools-help@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/samtools-help

Reply via email to