ot;S3"), Chr = 1, Position = c(3000, 6000,
> 1000), key = "Chr") instead of data.frame(Name = c("S1", "S2", "S3"), Chr =
> 1, Position = c(3000, 6000, 1000), key = "Chr").
>
> HTH,
> Denes
>
>
>
> On 01/30/2016 0
cur.row <- Chr.Arms[i, ]
mapfile$Arm[ mapfile$Chr == cur.row$Chr & mapfile$Position >=
cur.row$Start & mapfile$Position <= cur.row$End] <- cur.row$Arm
}
This took out the need for the intermediate table/vector. This worked for
me, and was VERY fast. Took <5 minutes on a
ly(Chr.Arms, .variables = "Arm", function(cur.row, mapfile){
> mapfile <- mapfile[ Position >= cur.row$Start & Position <= cur.row$End]
> mapfile <- mapfile[ , Arm:=cur.row$Arm][]
> return(mapfile)
> }, mapfile = mapfile)
>
> I have just started to u
I have two dataframes. One has chromosome arm information, and the other
has SNP position information. I am trying to assign each SNP an arm
identity. I'd like to create this new column based on comparing it to the
reference file.
*1) Mapfile (has millions of rows)*
NameChr Position
S1
4 matches
Mail list logo