How to convert the data from .wig file to .table or .csv?
3
1
Entering edit mode
8.6 years ago
wql_zcq ▴ 40

Hi, all I read a data from wig file with import.wig function of rtracklayer package. The class() of this data showed :"UCSCdata". I am failed to write the data to other format with "write.table/csv(XXX,file="XX",sep=" ")". Could you tell me which funtion/methods can convert the data to other format(.txt, .csv or excel)?

R next-gen ChIP-Seq • 5.9k views
ADD COMMENT
1
Entering edit mode
8.6 years ago

Use export.wig from rtracklayer with dataFormat to BED. BED format is text based.

ADD COMMENT
0
Entering edit mode
8.6 years ago

Does this bed format contain the signal intensity column?

ADD COMMENT
0
Entering edit mode

This question is not directly related to parent thread. You should have asked it in a new thread.
As indicated in this link BED format is plain text and only requires three columns by default (chromosome, chromStart, chromEnd). You could include signal intensity as an optional additional column.

ADD REPLY
0
Entering edit mode
8.6 years ago

You can convert to BED with wig2bed. BED is a tab-delimited text file:

$ wig2bed < in.wig > out.bed

From there, you can bring it into Excel and re-save as CSV, if you need a different delimiter.

Add the --keep-header option if you want that metadata in the output.

ADD COMMENT

Login before adding your answer.

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