dmgatti / DOQTL

QTL mapping for Diversity Outbred mice (and other multi-founder advanced intercrosses)
14 stars 14 forks source link

assoc.map should return Sanger ID #3

Open byandell opened 8 years ago

byandell commented 8 years ago

Dan, I made the following changes to assoc.scan1 on my local copy. I could not make changes to your github of course. These allow sanger ID to be row names of return data frame, helping user identify key SNPs. Below is diff part. That is, around line 427 of assoc.map.R I added row.sdps <- sdps$id which I then use at the end of the function: row.names(out) <- row.sdps I changed the return() to out <- in three places to have out available. Brian

426 426

Convert the DO haplotype probabilities to Sanger alleles.

427

Kludge: Preserve Sanger ID for output.

428 row.sdps <- sdps$id 427 429 sdps = cbind(pos = sdps[,2], sdp = sdps[,ncol(sdps)], sdps[,-c(1:5,ncol(sdps))]) ... 426 426

Convert the DO haplotype probabilities to Sanger alleles.

427

Kludge: Preserve Sanger ID for output.

428 row.sdps <- sdps$id 427 429 sdps = cbind(pos = sdps[,2], sdp = sdps[,ncol(sdps)], sdps[,-c(1:5,ncol(sdps))]) ... 426 426

Convert the DO haplotype probabilities to Sanger alleles.

427

Kludge: Preserve Sanger ID for output.

428 row.sdps <- sdps$id 427 429 sdps = cbind(pos = sdps[,2], sdp = sdps[,ncol(sdps)], sdps[,-c(1:5,ncol(sdps))]) ... 483

return(data.frame(chr = rep(markers[1,2], length(stat)), 

484

       sdp = sdps, LOD = stat))

485 out <- data.frame(chr = rep(markers[1,2], length(stat)),

486 sdp = sdps, LOD = stat)

487

489

Kludge to get row names, which are SNPs.

490 row.names(out) <- row.sdps

491 out