hansenlab / minfi

Devel repository for minfi
58 stars 70 forks source link

getSnpBeta on combined array #95

Closed wac closed 7 years ago

wac commented 7 years ago

getSnpBeta should probably not use the manifest at all? I was getting errors

snps=getSnpBeta(RGset) Error in getRed(object)[snpProbesI.Red$AddressB, , drop = FALSE] : subscript out of bounds

when applying getSnpBeta on a combined 450k and EPIC RGset. Changing all the references from manifest to object seems to have resolved this (some of the probes in the manifest aren't present in the object)

==== Code I ran follows =====

getSnpBeta <-
function (object)
{
#    .isRGOrStop(object)
    manifest <- getManifest(object)
    snpProbesII <- getProbeInfo(object, type = "SnpII")$Name
    M.II <- getGreen(object)[getProbeInfo(object, type = "SnpII")$AddressA,
        , drop = FALSE]
    U.II <- getRed(object)[getProbeInfo(object, type = "SnpII")$AddressA,
        , drop = FALSE]
    snpProbesI.Green <- getProbeInfo(object, type = "SnpI")[getProbeInfo(object,
        type = "SnpI")$Color == "Grn", ]
    snpProbesI.Red <- getProbeInfo(object, type = "SnpI")[getProbeInfo(object,
        type = "SnpI")$Color == "Red", ]
    M.I.Red <- getRed(object)[snpProbesI.Red$AddressB, , drop = FALSE]
    U.I.Red <- getRed(object)[snpProbesI.Red$AddressA, , drop = FALSE]
    M.I.Green <- getGreen(object)[snpProbesI.Green$AddressB,
        , drop = FALSE]
    U.I.Green <- getGreen(object)[snpProbesI.Green$AddressA,
        , drop = FALSE]
    M <- rbind(M.II, M.I.Red, M.I.Green)
    U <- rbind(U.II, U.I.Red, U.I.Green)
    rownames(M) <- rownames(U) <- c(snpProbesII, snpProbesI.Red$Name,
        snpProbesI.Green$Name)
    beta <- M/(U + M + 100)
    return(beta)
}
kasperdanielhansen commented 7 years ago

This is a bug. I need to spend some time to be sure to locate the exact place and what the different functions promises, but guess that it will be fixed by making sure that getProbeInfo(object) only returns probe addresses which are present in object. This may be because SNP probes are treated differently upstream.

This is because we only recently added the possibility of an RGChannelSet not containing all probes from the manifest. Most functions work, but I clearly didn't test this one. Thanks.

kasperdanielhansen commented 7 years ago

Fixed in minfi 1.21.5.

simonwang1012 commented 6 years ago

I got an error after combing 450K and EPIC RGset as follows,

> mySampleSet <- fromRGChannelSet(RGsetEx_combined)
Error in minfi::getRed(myRGChannelSet)[controlTable$Address, ] : 
  subscript out of bounds

How should I deal with this please.

wac commented 6 years ago

This was resolved for me by the new version of minfi. Note that you might need to update your version of R to be able to install a recent version of minfi!

--Warren

On Tue, 6 Feb 2018 at 06:53 simonwang1012 notifications@github.com wrote:

I got an error after combing 450K and EPIC RGset as follows,

mySampleSet <- fromRGChannelSet(RGsetEx_combined) Error in minfi::getRed(myRGChannelSet)[controlTable$Address, ] : subscript out of bounds

How should I deal with this please.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/kasperdanielhansen/minfi/issues/95#issuecomment-363413195, or mute the thread https://github.com/notifications/unsubscribe-auth/AABxHsg-KLiMP77OYJVvNcH6wz8N_d4Lks5tSEtWgaJpZM4L6FNL .

-- --Warren A. Cheung Sr. Computational Biologist Center for Pediatric Genomic Medicine, Children's Mercy Hospital Kansas City, MO