Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

getSnpBeta on combined array #95

Closed
wac opened this issue Feb 7, 2017 · 4 comments
Closed

getSnpBeta on combined array #95

wac opened this issue Feb 7, 2017 · 4 comments

Comments

@wac
Copy link

wac commented Feb 7, 2017

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
Copy link
Collaborator

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
Copy link
Collaborator

Fixed in minfi 1.21.5.

@simonwang1012
Copy link

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
Copy link
Author

wac commented Feb 19, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants