Error in "getZScores()" while running FourCSeq package
2
0
Entering edit mode
MaddieS • 0
@maddies-9884
Last seen 5.4 years ago
United States, Boston

Hi,

I was able to run FourCSeq successfully till I hit the following error:

> getZScores(fcAce)
[1] "viewpoint_1"
Error in object[seqnames(object) == unique(colData(object)$chr), ] :
  error in evaluating the argument 'i' in selecting a method for function '[': Error in .Call2("Rle_constructor", values, lengths, check, 0L, PACKAGE = "S4Vectors") :
  Rle of type 'list' is not supported

Here's what I ran before getZScores():

>library(FourCSeq)
>exptDataAce=SimpleList(projectPath=getwd(), fragmentDir='bams/', referenceGenomeFile='/home/user/ref/mm9/bt2/chr_fa/chr7.fa', reSequence1='GATC', reSequence2='GTAC', primerFile='Primers.fa', bamFilePath='bams/')
>colDataAce=DataFrame(viewpoint="viewpoint_1", condition=factor(c("WT","WT","KO","KO")),levels = c("WT1","WT2","KO1","KO2"), replicate = c(1,2,1,2), bamFile = c('wt1.bam','wt2.bam','ko1.bam','ko2.bam'), sequencingPrimer="first")
>fcAce=FourC(colDataAce,exptDataAce)
>fcAce=addFragments(fcAce,save=TRUE)
>findViewpointFragments(fcAce)
>load('bams/primerFragments.rda')
>colData(fcAce)$chr = vpFrag[2]
>colData(fcAce)$start = vpFrag[3]
>colData(fcAce)$end = vpFrag[4]
>fcAce=countFragmentOverlaps(fcAce, trim=4)
>fcAce=combineFragEnds(fcAce)
>writeTrackFiles(fcAce)
>fcAceZ=getZScores(fcAce)

The error is probably coming from :

object <- object[seqnames(object) == unique(colData(object)$chr),]
of FourCSeq/R/functions.R (line 418).

Running this :
seqnames(fcAce) == unique(colData(fcAce)$chr)
produces the error : Error in .Call2("Rle_constructor", values, lengths, check, 0L, PACKAGE = "S4Vectors") :
  Rle of type 'list' is not supported

 

> seqnames(fcAce)
factor-Rle of length 160846 with 1 run
  Lengths: 160846
  Values :   chr7
Levels(1): chr7

AND
> unique(colData(fcAce)$chr)
[[1]]
[1] chr7
Levels: chr7

are the input objects. It appears that all of our elements in seqnames(fcAce) are ALREADY limited to chr7 because of how we aligned.

Upon searching I also found similar errors thrown by some other packages. Is there another method called by getZScores() which is incompatible with RleList object? Any suggestions/fixes will be much appreciated.

Thanks,

Maddie

P.S. R sessionInfo()

R version 3.2.2 (2015-08-14)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 14.04.2 LTS

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C             
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8   
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8  
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                
 [9] LC_ADDRESS=C               LC_TELEPHONE=C           
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C      

attached base packages:
 [1] splines   stats4    parallel  stats     graphics  grDevices utils   
 [8] datasets  methods   base    

other attached packages:
 [1] FourCSeq_1.2.0            LSD_3.0                 
 [3] DESeq2_1.8.2              RcppArmadillo_0.6.500.4.0
 [5] Rcpp_0.12.3               ggplot2_2.1.0           
 [7] GenomicRanges_1.20.8      GenomeInfoDb_1.4.3      
 [9] IRanges_2.2.9             S4Vectors_0.6.6         
[11] BiocGenerics_0.14.0     

loaded via a namespace (and not attached):
 [1] locfit_1.5-9.1            biovizBase_1.16.0       
 [3] lattice_0.20-33           gtools_3.5.0            
 [5] Rsamtools_1.20.5          Biostrings_2.36.4       
 [7] plyr_1.8.3                futile.options_1.0.0    
 [9] acepack_1.3-3.3           RSQLite_1.0.0           
[11] zlibbioc_1.14.0           GenomicFeatures_1.20.6  
[13] annotate_1.46.1           rpart_4.1-10            
[15] Matrix_1.2-4              ggbio_1.16.1            
[17] BiocParallel_1.2.22       geneplotter_1.46.0      
[19] stringr_1.0.0             foreign_0.8-66          
[21] RCurl_1.95-4.8            biomaRt_2.24.1          
[23] munsell_0.4.3             rtracklayer_1.28.10     
[25] nnet_7.3-12               gridExtra_2.2.1         
[27] Hmisc_3.17-2              XML_3.98-1.4            
[29] reshape_0.8.5             GenomicAlignments_1.4.2 
[31] bitops_1.0-6              RBGL_1.44.0             
[33] grid_3.2.2                xtable_1.8-2            
[35] GGally_1.0.1              gtable_0.2.0            
[37] DBI_0.3.1                 magrittr_1.5            
[39] scales_0.4.0              graph_1.46.0            
[41] stringi_1.0-1             XVector_0.8.0           
[43] reshape2_1.4.1            genefilter_1.50.0       
[45] latticeExtra_0.6-28       futile.logger_1.4.1     
[47] Formula_1.2-1             lambda.r_1.1.7          
[49] RColorBrewer_1.1-2        tools_3.2.2             
[51] dichromat_2.0-0           BSgenome_1.36.3         
[53] Biobase_2.28.0            OrganismDbi_1.10.0      
[55] survival_2.38-3           AnnotationDbi_1.30.1    
[57] colorspace_1.2-6          cluster_2.0.3           
[59] fda_2.4.4                 VariantAnnotation_1.14.13

fourcseq • 809 views
ADD COMMENT
0
Entering edit mode
felix.klein ▴ 150
@felixklein-6900
Last seen 3.1 years ago
Germany
Hello Maddie, thanks a lot for your detailed example. As you pointed out |unique(colData(fcAce)$chr |seems to return a list now. I will have a look into this on the weekend. In the meanwhile you could try to wrap this call in an unlist() statement by copying the code from the function and creating your customized function. Some function used inside getZScore might not be available in the NAMESPACE (-> function not found error). In these cases you can call the function specifically by FourCSeq:::FUNCTIONNAME. Best regards, Felix ||
ADD COMMENT
0
Entering edit mode
MaddieS • 0
@maddies-9884
Last seen 5.4 years ago
United States, Boston

Hi Felix,

Thanks for your response. I am posting this as an answer because I think we figured out the error we were making. Using the following,

>colData(fcAce)$chr = vpFrag[2]
>colData(fcAce)$start = vpFrag[3]
>colData(fcAce)$end = vpFrag[4]

was adding chr, start and end as "empty lists" to colData(fcAce) instead of factor, integer and integer respectively. We were not able to use fcAce <- addViewpointFrags(fcAce)as suggested because it was giving an error on our Ubuntu (which we still have to figure out why, but that's a separate issue). But anyways for now, when we run

colData(fcAce)$chr = as.vector(as.character(vpFrag[2][1,1]))
colData(fcAce)$start = as.integer(vpFrag[3])

colData(fcAce)$end = as.integer(vpFrag[4])

instead of previous versions, everything works including getZScores and the subsequent methods. Thanks again for your reply and please let me know if you have any further suggestions.

Best,

Maddie

ADD COMMENT
0
Entering edit mode
Hello Maddie, I am glad it is working now. In the vignette I describe in detail how the colData can be set up manually. Maybe you can have a look there which might help you as well. Best regards, Felix
ADD REPLY

Login before adding your answer.

Traffic: 463 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