Error using 'scanForHeterozygotes' function in AllelicImbalance package
1
0
Entering edit mode
JK ▴ 10
@jk-6972
Last seen 9.4 years ago
United States

Hi,

 

I generated BAM files using the STAR aligner. I am having some issues working with these BAM files in AllelicImbalance:

 

I would appreciate some help with the issue.

 

Best,

 

Jozsef

> pathToFiles='h:/AGP_hg19_filtered_fastq_bam'
> searchArea<-GRanges(seqnames = c("chr11"),ranges = IRanges(35228000, 35230000))
> reads <- impBamGAL(pathToFiles,searchArea,verbose=T)
Reading bam file 1 with filename AGP001_Aligned.sortedByCoord.out.bam 
stored AGP001_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 2 with filename AGP002_Aligned.sortedByCoord.out.bam 
stored AGP002_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 3 with filename AGP003_Aligned.sortedByCoord.out.bam 
stored AGP003_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 4 with filename AGP004_Aligned.sortedByCoord.out.bam 
stored AGP004_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 5 with filename AGP006_Aligned.sortedByCoord.out.bam 
stored AGP006_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 6 with filename AGP007_Aligned.sortedByCoord.out.bam 
stored AGP007_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 7 with filename AGP009_Aligned.sortedByCoord.out.bam 
stored AGP009_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 8 with filename AGP012_Aligned.sortedByCoord.out.bam 
stored AGP012_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 9 with filename AGP013_Aligned.sortedByCoord.out.bam 
stored AGP013_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 10 with filename AGP022_Aligned.sortedByCoord.out.bam 
stored AGP022_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 11 with filename AGP025_Aligned.sortedByCoord.out.bam 
stored AGP025_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 12 with filename AGP027_Aligned.sortedByCoord.out.bam 
stored AGP027_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 13 with filename AGP029_Aligned.sortedByCoord.out.bam 
stored AGP029_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 14 with filename AGP040_Aligned.sortedByCoord.out.bam 
stored AGP040_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 15 with filename AGP041_Aligned.sortedByCoord.out.bam 
stored AGP041_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 16 with filename AGP044_Aligned.sortedByCoord.out.bam 
stored AGP044_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 17 with filename AGP046_Aligned.sortedByCoord.out.bam 
stored AGP046_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 18 with filename AGP061_Aligned.sortedByCoord.out.bam 
stored AGP061_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 19 with filename H1_Aligned.sortedByCoord.out.bam 
stored H1_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 20 with filename H10_Aligned.sortedByCoord.out.bam 
stored H10_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 21 with filename H11_Aligned.sortedByCoord.out.bam 
stored H11_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 22 with filename H12_Aligned.sortedByCoord.out.bam 
stored H12_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 23 with filename H13_Aligned.sortedByCoord.out.bam 
stored H13_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 24 with filename H14_Aligned.sortedByCoord.out.bam 
stored H14_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 25 with filename H15_Aligned.sortedByCoord.out.bam 
stored H15_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 26 with filename H2_Aligned.sortedByCoord.out.bam 
stored H2_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 27 with filename H3_Aligned.sortedByCoord.out.bam 
stored H3_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 28 with filename H4_Aligned.sortedByCoord.out.bam 
stored H4_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 29 with filename H5_Aligned.sortedByCoord.out.bam 
stored H5_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 30 with filename H6_Aligned.sortedByCoord.out.bam 
stored H6_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 31 with filename H7_Aligned.sortedByCoord.out.bam 
stored H7_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 32 with filename H8_Aligned.sortedByCoord.out.bam 
stored H8_Aligned.sortedByCoord.out.bam in BamGAL 
Reading bam file 33 with filename H9_Aligned.sortedByCoord.out.bam 
stored H9_Aligned.sortedByCoord.out.bam in BamGAL 
> heterozygotePositions <- scanForHeterozygotes(reads, maxReads=1e+07, verbose=TRUE)
Investigating chromosome chr11 
Investigating sample 1 out of 33 
Error in new[start[i]:(start[i] + length(toKeep[[i]]) - 1), i] <- charList[[i]][toKeep[[i]]] : 
  number of items to replace is not a multiple of replacement length
> searchArea<-GRanges(seqnames = c("11"),ranges = IRanges(35228000, 35230000))
> reads <- impBamGAL(pathToFiles,searchArea,verbose=T)
Error in impBamGAL(pathToFiles, searchArea, verbose = T) : 
  The following seq name(s) not found in the bam files: 11
> sessionInfo()
R version 3.1.2 (2014-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)

locale:
[1] LC_COLLATE=English_United States.1252  LC_CTYPE=English_United States.1252    LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C                           LC_TIME=English_United States.1252    

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

other attached packages:
 [1] org.Hs.eg.db_3.0.0      RSQLite_1.0.0           DBI_0.3.1               AnnotationDbi_1.28.1    Biobase_2.26.0         
 [6] AllelicImbalance_1.4.0  GenomicAlignments_1.2.2 Rsamtools_1.18.3        Biostrings_2.34.1       XVector_0.6.0          
[11] GenomicRanges_1.18.4    GenomeInfoDb_1.2.4      IRanges_2.0.1           S4Vectors_0.4.0         BiocGenerics_0.12.1    

loaded via a namespace (and not attached):
 [1] acepack_1.3-3.3          base64enc_0.1-2          BatchJobs_1.5            BBmisc_1.8              
 [5] BiocParallel_1.0.3       biomaRt_2.22.0           biovizBase_1.14.1        bitops_1.0-6            
 [9] brew_1.0-6               BSgenome_1.34.1          checkmate_1.5.0          cluster_1.15.3          
[13] codetools_0.2-9          colorspace_1.2-4         dichromat_2.0-0          digest_0.6.4            
[17] fail_1.2                 foreach_1.4.2            foreign_0.8-61           Formula_1.1-2           
[21] GenomicFeatures_1.18.3   Gviz_1.10.10             Hmisc_3.14-6             iterators_1.0.7         
[25] lattice_0.20-29          latticeExtra_0.6-26      matrixStats_0.10.3       munsell_0.4.2           
[29] nnet_7.3-8               plyr_1.8.1               R.methodsS3_1.6.1        RColorBrewer_1.0-5      
[33] Rcpp_0.11.3              RCurl_1.95-4.4           rpart_4.1-8              rtracklayer_1.26.2      
[37] scales_0.2.4             sendmailR_1.2-1          splines_3.1.2            stringr_0.6.2           
[41] survival_2.37-7          tools_3.1.2              VariantAnnotation_1.12.9 XML_3.98-1.1            
[45] zlibbioc_1.12.0
allelicimbalance • 1.6k views
ADD COMMENT
0
Entering edit mode
@jesper-robert-gadin-6326
Last seen 9.5 years ago
European Union

Hello,

There are two errors here,

1) 

Error in new[start[i]:(start[i] + length(toKeep[[i]]) - 1), i] <- charList[[i]][toKeep[[i]]] :
  number of items to replace is not a multiple of replacement length

Has been solved, see here (https://github.com/pappewaio/AllelicImbalance/issues/3)

2) 

> searchArea<-GRanges(seqnames = c("11"),ranges = IRanges(35228000, 35230000)) > reads <- impBamGAL(pathToFiles,searchArea,verbose=T) Error in impBamGAL(pathToFiles, searchArea, verbose = T) : The following seq name(s) not found in the bam files: 11

Based on that your code,

searchArea<-GRanges(seqnames = c("chr11"),ranges = IRanges(35228000, 35230000)) 

works, there is no seqlevel "11" in the bam files, and so it generate an error. Use "chr11" and it will work. 

Jesper

ADD COMMENT
0
Entering edit mode

Thank you for resolving this issue.

ADD REPLY

Login before adding your answer.

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