Biostar Beta. Not for public use.
Is it possible to get .bed file of sequenced regions after NGS experiment?
0
Entering edit mode
20 months ago
Adam • 20

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 • 356 views
ADD COMMENTlink
2
Entering edit mode
15 months ago
Seattle, WA USA

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 COMMENTlink
0
Entering edit mode

Amazing! That is what I need, many thanks!

ADD REPLYlink
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 REPLYlink
0
Entering edit mode

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

ADD REPLYlink
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 REPLYlink
0
Entering edit mode

I fixed the link to the Gencode v28 URL.

ADD REPLYlink
0
Entering edit mode

URL fixed. Thanks.@Alex.

ADD REPLYlink
0
Entering edit mode

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

ADD REPLYlink

Login before adding your answer.

Similar Posts
Loading Similar Posts
Powered by the version 2.1