I have a chip-seq data file, where the QC and trimming has already been done, as well as the mapping to the reference genome. Now I have data as follow:
GRanges object with 2288 ranges and 0 metadata columns:
seqnames ranges strand
<Rle> <IRanges> <Rle>
[1] chr1 [16174360, 16175609] *
[2] chr1 [20811067, 20812439] *
[3] chr1 [22783676, 22784321] *
[4] chr1 [26735004, 26735693] *
[5] chr1 [27023038, 27023988] *
How do I go about changing the "*" character to "+" seeing that the
fraglen <- estimate.mean.fraglen(reads, method = "correlation")
gives the following error:
Error in .local(x, ...) : x must have named elements '+' and '-'
I have tried using gsub, sub and chartr, and specifying the column, but then the whole data frame changes. Any recommendations?
What have you tried exactly ? And what do you mean by 'the whole data frame changes' ?