Is it possible to get .bed file of sequenced regions after NGS experiment?
1
0
Entering edit mode
6.0 years ago
Adam ▴ 40

Hello,

As it is in post title, Is it possible to get .bed file of sequenced regions after NGS experiment? I mean that you have results of NGS experiment, let's take WES of 6 samples. Than I'd like to generate .bed file with regions of sequenced regions.

To be honest I need this to generate opportunity matrix which is created from those regions:

3.1 of below vignette https://www.bioconductor.org/packages/3.7/bioc/vignettes/signeR/inst/doc/signeR-vignette.html

Unfortunately I didn't recieve any of .bed files from the company that performed the experiment. All I got are .bam's.

In addition to this, can I take regions of coding sequences from UCSC's table browser?

Best regards, Adam

NGS bed • 1.4k views
ADD COMMENT
2
Entering edit mode
6.0 years ago

You can use BEDOPS bam2bed:

$ bam2bed < reads.bam > reads.bed

Or BEDOPS convert2bed, to do the same thing:

$ convert2bed -i bam < reads.bam > reads.bed

If you have a bunch of BAM files in one directory and you're running bash:

$ for fn in `ls *.bam`; do bam2bed < ${fn} > ${fn%.*}.bed; done

To get coding sequences, you could download Gencode records and filter them for CDS entries (assuming hg38):

$ wget -qO- ftp://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_28/gencode.v28.annotation.gff3.gz \
    | gunzip --stdout - \
    | awk '$3 == "CDS"' - \
    | convert2bed -i gff - \
    > CDS.bed
ADD COMMENT
0
Entering edit mode

Amazing! That is what I need, many thanks!

ADD REPLY
0
Entering edit mode

Gencode latest release is 27, not 28 (as per URL available in my region- ftp://ftp.sanger.ac.uk/pub/gencode/Gencode_human/.

you can use parallel instead of loop:

$ parallel bam2bed {} {.}.bed ::: *.bam

ADD REPLY
0
Entering edit mode

GNU Parallel is great, but it is IO limited when running on serial hardware.

ADD REPLY
0
Entering edit mode

If you really want to take advantage of parallelization, and you have indexed BAM files, and you have a Slurm or SGE cluster, take a look at bam2bed_slurm or bam2bed_sge. Or, preferably, bam2starch_slurm or bam2starch_sge to make Starch archives.

ADD REPLY
0
Entering edit mode

I fixed the link to the Gencode v28 URL.

ADD REPLY
0
Entering edit mode

URL fixed. Thanks.@Alex.

ADD REPLY
0
Entering edit mode

BEDOPS and Unix streams are an awesome combination. Use them where you can!

ADD REPLY

Login before adding your answer.

Traffic: 2517 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6