Hello everyone, I have a problem importing BED files in R, here is the code I'm using
bcat<- import("B_catenin_filtered_Peak.bed", format = "BED")
here is the output
Error in scan(file = file, what = what, sep = sep, quote = quote, dec = dec, :
scan() expected 'an integer', got '3.27363'
The BED file looks like this
1 11211 11311 B_catenin_peak_1 32 . 3.27363 3.22608 0.52408 71
1 14937 15010 B_catenin_peak_2 17 . 2.18242 1.78085 0.00000 7
1 27112 27155 B_catenin_peak_3 20 . 2.62923 2.06618 0.04042 12
1 29097 29187 B_catenin_peak_4 36 . 3.60333 3.68581 0.74558 66
1 29327 29437 B_catenin_peak_5 58 . 4.74450 5.81076 2.00646 86
1 32834 32877 B_catenin_peak_6 41 . 3.91863 4.14593 1.07837 31
1 34997 35040 B_catenin_peak_7 22 . 2.79038 2.27548 0.04042 13
1 35547 35590 B_catenin_peak_8 21 . 2.72769 2.19294 0.04042 34
1 37762 37841 B_catenin_peak_9 17 . 2.34908 1.72152 0.00000 2
1 38619 38805 B_catenin_peak_10 47 . 3.15853 4.70046 1.29972 88
Do you guys have any suggestions?
thank you for your help
Hi James, thank you for the answer, as in your script, my genomic range is the second and third column, which I think are the only important for further analysis ... I'm getting another error tho :/
I solve by not importing the strand informations but I'm not sure if I can do it, what do you think ?
thank you
Right. The strand has to be one of "-", "+", or "*"
So you could do something like
Which will convert all the periods to asterisks, assuming that a period indicates no strand information. But that assumes there are any non-period values in the sixth column. If not, what you have done will accomplish the same thing.