Bedtools nuc : calculating the GC content in a sliding window
1
1
Entering edit mode
24 months ago
mera El ▴ 10

Hello everyone!

I found in an article that they used bedtools nuc to calculate : GC content within a 50-bp window, & GC content within a 1000-bp window.

When I try to read the manual of bedtools nuc I found this:

Usage:   bedtools nuc [OPTIONS] -fi <fasta> -bed <bed/gff/vcf>

Output format:

    The following information will be reported after each BED entry:
        1) %AT content
        2) %GC content

So I tried to run this command but I don't get the output that I want :

bedtools nuc -fi hg19.fasta -bed file.bed > output_bedtoolsnuc.tsv

#1_usercol      2_usercol       3_usercol       4_usercol       5_usercol       6_pct_at        7_pct_gc        8_num_A 9_num_C 10_num_G        11_num_T        12_num_N        13_num_oth      14_seq_len
1       133322   133323   ACCCTAACCCTAACCCTAACCCTAACCCTAACCCTAAC/A        +       1.000000        0.000000        1       0       0
       0       0       0       1

How can I get gc_50 & gc_1000 by using bedtools nuc?

Thank you

gc bedtools • 3.4k views
ADD COMMENT
4
Entering edit mode
24 months ago
ATpoint 82k

The BED file you provide -bed must provide either 50 or 1000bp intervals. Use bedtools makewindows for that.

ADD COMMENT
0
Entering edit mode

Okay thank youuu, I have another question, how can i construct the bed file ? I only have vcf file. I there a way to convert vcf file to bed ?

ADD REPLY
1
Entering edit mode

You mean the interval file? Just use bedtools makewindows, it will provide you with a BED file of bins of user-defined size for any genome. If you want to subset it for your variant file then use bedtools intersect to only retain windows that overlap your variants.

ADD REPLY
0
Entering edit mode

thank you so much

ADD REPLY

Login before adding your answer.

Traffic: 2065 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