Question: Create Bed File With 3 Tab Delimited Columns Using Matlab
1
gravatar for wdaali99
7.4 years ago by
wdaali9910
wdaali9910 wrote:

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 file • 2.1k views
ADD COMMENTlink written 7.4 years ago by wdaali9910
1
gravatar for Rm
7.4 years ago by
Rm7.9k
Danville, PA
Rm7.9k wrote:

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 COMMENTlink written 7.4 years ago by Rm7.9k

Thank you so much!

ADD REPLYlink written 7.4 years ago by wdaali9910
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1225 users visited in the last hour