RAPIDR mask and build the reference
0
0
Entering edit mode
6.5 years ago
martyferr90 ▴ 30

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?

RAPDIR NIPT bam ngs R • 2.1k views
ADD COMMENT
0
Entering edit mode

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 REPLY
0
Entering edit mode

Your particular error is being thrown from line 112 of the R script: https://github.com/cran/RAPIDR/blob/master/R/createReference.R

You may want to take a look there to see what may be happening. I have searched the WWW and usually the problem relates to people having mis-spelled the column names for the outcomes, but you have them correct. For example, the column names have to be [exactly]:

c("Dx", "Gender", "SampleID")
ADD REPLY

Login before adding your answer.

Traffic: 1788 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6