Dear all,
I downloaded a file in .BAM format and want to transform it into .BED format. What can I do? Thanks a lot!
Zhen
I downloaded a file in .BAM format and want to transform it into .BED format. What can I do? Thanks a lot!
Zhen
You are currently viewing the SEQanswers forums as a guest, which limits your access. Click here to register now, and join the discussion
$ bamToBed -i reads.bam > reads.bed
$ bamToBed -i reads.bam -ed > reads.bed
$ bamToBed -i reads.bam -bedpe > reads.bedpe
$ pairToBed -abam reads.bam -b SSRs.bed -type neither > reads.noSSRs.bam
$ pairToBed -abam reads.bam -b segdups.bed -type both > reads.SSRs.bam
$ pairToBed -abam reads.bam -b segdups.bed -type notboth > reads.notbothSSRs.bam
samtools view -F 0x0004 $filein | awk '{OFS="\t"; if (and($2, 16)) print $3,$4,$4+length($10),$1,$5,"-"; else print $3,$4,$4+length($10),$1,$5,"+" }
samtools view in.bam |
awk '{split ($6,a,"[MIDNSHP]"); bp=$4-1; n=0;
for (i=1; i<=length(a); i++) {
n+=1+length(a[i]);
if (substr($6,n,1)=="M") print $3"\t"bp"\t"(bp+=a[i]);
if (substr($6,n,1)=="D") bp+=a[i];
}
}' > out.bed
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by SEQadmin2, 06-05-2026, 10:09 AM
|
0 responses
14 views
0 reactions
|
Last Post
by SEQadmin2
06-05-2026, 10:09 AM
|
||
|
Started by SEQadmin2, 06-04-2026, 08:59 AM
|
0 responses
24 views
0 reactions
|
Last Post
by SEQadmin2
06-04-2026, 08:59 AM
|
||
|
Started by SEQadmin2, 06-02-2026, 12:03 PM
|
0 responses
28 views
0 reactions
|
Last Post
by SEQadmin2
06-02-2026, 12:03 PM
|
||
|
Started by SEQadmin2, 06-02-2026, 11:40 AM
|
0 responses
22 views
0 reactions
|
Last Post
by SEQadmin2
06-02-2026, 11:40 AM
|
Comment