Hi Eric,

You have NA in your name column. One fix for you without creating a name
column is to just use the following code to create RangedData from your
dataframe.

RangedData(Iranges(start=as.numeric(as.character(TwoLplus[,2])),
end=as.numeric( as.character(TwoLplus[,3])),names=paste(TwoLplus[,1],
TwoLplus[,2], TwoLplus[,3])), space= as.character(TwoLplus[,1]), strand=
as.character(TwoLplus[,6]))

Best regards,

Julie


*******************************************
Lihua Julie Zhu, Ph.D
Research Associate Professor
Program Gene Function and Expression
University of Massachusetts Medical School
364 Plantation Street, Room 613
Worcester, MA 01605
508-856-5256
http://www.umassmed.edu/pgfe/faculty/zhu.cfm



On 2/26/10 3:20 PM, "Eric Bremer" <ericgbremer@gmail.com> wrote:

> Hi Julie,
> Thanks so much for your help so far.  I have been trying to convert some of my
> data from a BED format into the ranged data and seem to run into a couple of
> errors that I can not seem to fix.  Here is an example:
> 
>> > TwoLplus = read.table("2Lplus_bed2.txt", header=TRUE, sep="\t", fill=TRUE)
>> > test = BED2RangedData(TwoLplus, header=TRUE)
> Error in `rownames<-`(`*tmp*`, value = c(NA_character_, NA_character_,  :
>   missing values not allowed in rownames
> In addition: Warning messages:
> 1: In `[<-.factor`(`*tmp*`, strand == "+", value = 1) :
>   invalid factor level, NAs generated
> 2: In `[<-.factor`(`*tmp*`, strand == "-", value = -1) :
>   invalid factor level, NAs generated
>> > head(TwoLplus)
>   chrom peakStart peakEnd name score strand
> 1 chr2L      9115    9140   NA    NA      +
> 2 chr2L      9410    9489   NA    NA      +
> 3 chr2L     12342   12368   NA    NA      +
> 4 chr2L     25256   25281   NA    NA      +
> 5 chr2L     27909   27934   NA    NA      +
> 6 chr2L     30731   30756   NA    NA      +
>> > 
> 
> 
> I have also attached the origninal .txt file that I am starting with.  I
> suspect that I am missing something simple (at least I hope so)
> Thanks!
> Eric


	[[alternative HTML version deleted]]

