Question: RAPIDR mask and build the reference
0
gravatar for martyferr90
3 months ago by
martyferr9030
martyferr9030 wrote:

Hi all! I'm new to RAPIDR usage and i have some problems.

First of all I would to know how I can obtain a mask bed file to perform the makeBinnedCountsFile with the mask.

The second question is: I'm trying to build a reference and using the code on the exemple (demo file in the package), but I receive this error:

Checking every sampleID has an outcome
No outcomes for Sample Sample1
No outcomes for Sample Sample2
No outcomes for Sample Sample3
No outcomes for Sample Sample4
Error in `[.data.frame`(sampleIDs.with.outcomes, , "Gender") : 
  undefined columns selected

and my code is:

> data(outcomes) 
> data(gcContent)
> T21.pos <- which(outcomes$Dx == "T21") 
> chr.lens <- sapply(gcContent, length)
> chr.names <- names(chr.lens) 
> header <- c("SampleID") 
> for (i in 1:length(chr.lens)) { 
+    header <- c(header, rep(chr.names[i], chr.lens[i]))
+ }
> nbins <- sum(chr.lens)
> ncols <- nbins + 1 
> 
> binned.counts <- matrix(nrow = nrow(outcomes), ncol = ncols) 
> for (i in 1:nrow(binned.counts)) { 
+    binned.counts[i,] <- rpois(ncols, lambda = 100) 
+    if (i %in% T21.pos) {
+       binned.counts[i, 139087:141493] <- rpois(chr.lens[21], lambda = 115) 
+    }
+ }
> binned.counts[,1] <- outcomes$SampleID 
> colnames(binned.counts) <- header 
> t <- tempfile()
> write.table(binned.counts, file = t, col.names = TRUE, row.names = FALSE, quote = FALSE, sep = ",") 
> 
> "mybinnedfile.fname" <- t
> message(t)
> rapidr.dir <- system.file(pakage = "RAPIDR")
> gcContent.fname <- paste(rapidr.dir, "data/gcContent.RData", sep="")
> head(outcomes)
  SampleID     Dx Gender
1     1000 Normal Female
2     1001 Normal Female
3     1002    T21 Female
4     1003 Normal   Male
5     1004 Normal   Male
6     1005 Normal   Male
> ref.set  <- createReferenceSetFromCounts("mybinnedfile.fname", outcomes, gcCorrect = FALSE, PCA = FALSE, method = "NCV")

Where I'm wrong? Is it normal that the outcomes has 9 sample whilst I loaded only 4 sample?

nipt rapdir bam ngs R • 273 views
ADD COMMENTlink modified 4 weeks ago by roser.navarro0 • written 3 months ago by martyferr9030
0
gravatar for roser.navarro
4 weeks ago by
roser.navarro0 wrote:

Hi martyferr90, Did you obtain the mask file at the end? We are facing the same problem as you comment here. We don't know how to create it neither we were able to find it in the package. Thanks in advance!

ADD COMMENTlink written 4 weeks ago by roser.navarro0
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1531 users visited in the last hour