Hi,
The genomeCoverageBed program made each line without the "Chr" start making it hard to use in UCSC Genome browser.
i.e.
17 422997 422999 26
17 422999 423001 27
17 423001 423003 29
There are over 10,000,000 lines so how do I add "chr" to the beginning of each like this:
chr17 422997 422999 26
chr17 422999 423001 27
chr17 423001 423003 29
I have tried:
awk '{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
awk '/^/{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
sed -i .bak 's/^/chr/'inputFile.bed > outputFile.bed
sed -i '''s/^/chr/' inputFile.bed > outputFile.bed
sed 's/^/^chr/' inputFile.bed > outputFile.bed
and others…
All of which do the first line and nothing more?
When I use $ head ch17.txt | od -c
I get lots of weird charters
0000000 t r a c k t y p e = b e d G r
0000020 a p h n a m e = V a n i t a
0000040 c o l o r = 0 , 1 2 8 , 0 \n 1 7
0000060 \t 3 9 7 1 4 2 \t 3 9 7 1 5 2 \t 1
0000100 \n 1 7 \t 3 9 7 1 5 2 \t 3 9 7 1 7
0000120 1 \t 2 \n 1 7 \t 3 9 7 1 7 1 \t 3 9
0000140 7 1 8 3 \t 3 \n 1 7 \t 3 9 7 1 8 3
0000160 \t 3 9 7 1 9 2 \t 4 \n 1 7 \t 3 9 7
0000200 1 9 2 \t 3 9 7 2 0 2 \t 3 \n 1 7 \t
0000220 3 9 7 2 0 2 \t 3 9 7 2 2 1 \t 2 \n
0000240 1 7 \t 3 9 7 2 2 1 \t 3 9 7 2 3 3
0000260 \t 1 \n 1 7 \t 3 9 7 5 7 5 \t 3 9 7
0000300 6 2 7 \t 1 \n 1 7 \t 3 9 7 7 7 1 \t
0000320 3 9 7 7 9 6 \t 1 \n
0000331
Are people finding this problem as well and has anyone got a solution so that my BEDTools files can be used on UCSC Genome Browser?
The genomeCoverageBed program made each line without the "Chr" start making it hard to use in UCSC Genome browser.
i.e.
17 422997 422999 26
17 422999 423001 27
17 423001 423003 29
There are over 10,000,000 lines so how do I add "chr" to the beginning of each like this:
chr17 422997 422999 26
chr17 422999 423001 27
chr17 423001 423003 29
I have tried:
awk '{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
awk '/^/{print "chr"$1,$2,$3,$4}' inputFile.bed > outputFile.bed
sed -i .bak 's/^/chr/'inputFile.bed > outputFile.bed
sed -i '''s/^/chr/' inputFile.bed > outputFile.bed
sed 's/^/^chr/' inputFile.bed > outputFile.bed
and others…
All of which do the first line and nothing more?
When I use $ head ch17.txt | od -c
I get lots of weird charters
0000000 t r a c k t y p e = b e d G r
0000020 a p h n a m e = V a n i t a
0000040 c o l o r = 0 , 1 2 8 , 0 \n 1 7
0000060 \t 3 9 7 1 4 2 \t 3 9 7 1 5 2 \t 1
0000100 \n 1 7 \t 3 9 7 1 5 2 \t 3 9 7 1 7
0000120 1 \t 2 \n 1 7 \t 3 9 7 1 7 1 \t 3 9
0000140 7 1 8 3 \t 3 \n 1 7 \t 3 9 7 1 8 3
0000160 \t 3 9 7 1 9 2 \t 4 \n 1 7 \t 3 9 7
0000200 1 9 2 \t 3 9 7 2 0 2 \t 3 \n 1 7 \t
0000220 3 9 7 2 0 2 \t 3 9 7 2 2 1 \t 2 \n
0000240 1 7 \t 3 9 7 2 2 1 \t 3 9 7 2 3 3
0000260 \t 1 \n 1 7 \t 3 9 7 5 7 5 \t 3 9 7
0000300 6 2 7 \t 1 \n 1 7 \t 3 9 7 7 7 1 \t
0000320 3 9 7 7 9 6 \t 1 \n
0000331
Are people finding this problem as well and has anyone got a solution so that my BEDTools files can be used on UCSC Genome Browser?
Comment