-
Notifications
You must be signed in to change notification settings - Fork 16
Nextflow #145
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
Nextflow #145
Changes from all commits
0a5f395
474602e
06b9297
5ef6b3f
98e570d
8edd58c
abb66ca
c2e020f
83cc13c
cafd7a2
a47c121
3acecbb
dae6ad4
453c447
b4e10fc
364d823
859f1e3
9ee7261
ecee6a4
583a868
d1caed3
852e993
40f49d9
7b7eca1
61fb147
3dacec4
a8a8060
b84c3c5
96f767b
f629a8c
51fd4a4
5a1fb73
39ca1c2
30eabcd
71f6b15
3616fce
200e0fe
c9cced7
2d7ee68
7f3d754
f84b1b6
575dbef
b4e327f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -87,7 +87,7 @@ distributedCogaps <- function(data, allParams, uncertainty) | |
| allParams$gaps@fixedPatterns <- matchedPatterns$consensus | ||
| allParams$gaps@whichMatrixFixed <- ifelse(allParams$gaps@distributed | ||
| == "genome-wide", "P", "A") | ||
|
|
||
| # run final phase with fixed matrix | ||
| gapsCat(allParams, "Running Final Stage...\n\n") | ||
| finalResult <- bplapply(1:length(sets), BPPARAM=allParams$BPPARAM, | ||
|
|
@@ -233,7 +233,7 @@ stitchTogether <- function(result, allParams, sets) | |
| Asd <- do.call(rbind, lapply(result, function(x) x@loadingStdDev)) | ||
|
|
||
| # copy P matrix - same for all sets | ||
| Pmean <- result[[1]]@sampleFactors | ||
| Pmean <- result[[1]]@metadata$params@fixedPatterns | ||
|
||
| Psd <- matrix(0, nrow=nrow(Pmean), ncol=ncol(Pmean)) | ||
|
|
||
| # if each feature was used once, re-order to match data | ||
|
|
@@ -255,7 +255,7 @@ stitchTogether <- function(result, allParams, sets) | |
| Psd <- do.call(rbind, lapply(result, function(x) x@factorStdDev)) | ||
|
|
||
| # copy A matrix - same for all sets | ||
| Amean <- result[[1]]@featureLoadings | ||
| Amean <- result[[1]]@metadata$params@fixedPatterns | ||
|
dimalvovs marked this conversation as resolved.
|
||
| Asd <- matrix(0, nrow=nrow(Amean), ncol=ncol(Amean)) | ||
|
|
||
| # if each sample was used once, re-order to match data | ||
|
|
@@ -276,4 +276,3 @@ stitchTogether <- function(result, allParams, sets) | |
| "sampleNames"=rownames(Pmean), | ||
| "meanChiSq"=sum(sapply(result, function(r) r@metadata$meanChiSq)))) | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,47 @@ | ||
| test_that("featureLoadings and sampleFactors are not all 0s in single-cell", { | ||
| params <- CogapsParams(seed=42, | ||
| nIterations = 100, | ||
| nPatterns = 2, | ||
| sparseOptimization = as.logical(0), | ||
| distributed="single-cell") | ||
|
|
||
| params <- setDistributedParams(params, nSets = 2) | ||
| data(GIST) | ||
| cg <- CoGAPS(GIST.matrix, params=params) | ||
|
|
||
| featureLoadings <- cg@featureLoadings | ||
| sampleFactors <- cg@sampleFactors | ||
|
|
||
| # Check featureLoadings and sampleFactors: smaller dimension is nPatterns | ||
| # and larger dimension matches data dimensions | ||
| expect_false(all(featureLoadings == 0)) | ||
| expect_false(all(sampleFactors == 0)) | ||
| expect_true(sort((dim(sampleFactors)))[1] == params@nPatterns) | ||
| expect_true(sort((dim(featureLoadings)))[1] == params@nPatterns) | ||
| expect_true(sort((dim(sampleFactors)))[2] == ncol(GIST.matrix)) | ||
| expect_true(sort((dim(featureLoadings)))[2] == nrow(GIST.matrix)) | ||
| }) | ||
|
|
||
| test_that("featureLoadings and sampleFactors are not all 0s in genome-wide", { | ||
| params <- CogapsParams(seed=42, | ||
| nIterations = 100, | ||
| nPatterns = 2, | ||
| sparseOptimization = as.logical(0), | ||
| distributed="genome-wide") | ||
|
|
||
| params <- setDistributedParams(params, nSets = 2) | ||
| data(GIST) | ||
| cg <- CoGAPS(GIST.matrix, params=params) | ||
|
|
||
| featureLoadings <- cg@featureLoadings | ||
| sampleFactors <- cg@sampleFactors | ||
|
|
||
| # Check featureLoadings and sampleFactors: smaller dimension is nPatterns | ||
| # and larger dimension matches data dimensions | ||
| expect_false(all(featureLoadings == 0)) | ||
| expect_false(all(sampleFactors == 0)) | ||
| expect_true(sort((dim(sampleFactors)))[1] == params@nPatterns) | ||
| expect_true(sort((dim(featureLoadings)))[1] == params@nPatterns) | ||
| expect_true(sort((dim(sampleFactors)))[2] == ncol(GIST.matrix)) | ||
| expect_true(sort((dim(featureLoadings)))[2] == nrow(GIST.matrix)) | ||
| }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume this version bump makes sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, Bioconductor is strict about versions: in x.y.z, y is always odd in devel and even in release. Current release is 28, so current devel must be 29. Although ir may be 29.0, will find out when pushing to Bioconductor.