Create Bed File With 3 Tab Delimited Columns Using Matlab
1
1
Entering edit mode
12.5 years ago
wdaali99 ▴ 10

I have MeDIP-seq read counts that is just an array of numbers for each chromosome. For example chr1.txt is just a text file: 0 1 0 0 0 0 2 4 5 6 7 . ......

The resolution is 100 bp.

My question is how can I convert this text file to 3 tab delimited columns using Matlab:

chr                start       end     read_counts 
chr1               1          100            0
chr1            101          200          20
chr1            201           300          0

Thanks !

Amy-

bed • 3.2k views
ADD COMMENT
1
Entering edit mode
12.5 years ago
Rm 8.3k

in shell command-line you can try this:

count=0; cat chr1.txt | tr "\t" "\n" |  while read line ; do echo "$((count+1))  $((count+100)) $line" ; count=$((count+100)); done
ADD COMMENT
0
Entering edit mode

Thank you so much!

ADD REPLY

Login before adding your answer.

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