Question: Error: could not find function "HTSeqCounts"
1
gravatar for sakura.nussbaum
3.0 years ago by
sakura.nussbaum10 wrote:

Hello,

I am a new user of DEXSeq and I would need some help concerning an error message I get and I cannot solve.

My sample table looks like this:

> phenodata
    samplename condition
bu1    bulge_1     bulge
bu2    bulge_2     bulge
bu3    bulge_3     bulge
le1     lef1_1      lef1
le4     lef1_4      lef1
le5     lef1_5      lef1
le6     lef1_6      lef1

I am trying to create an ExonCountSet object but I get an error message: 

> library(DEXSeq)
> ec = HTSeqCounts(countfiles=c("bulge_1.txt","bulge_2.txt","bulge_3.txt","lef_1.txt","lef_4.txt","lef_5.txt","lef_6.txt"), design=phenodata)
Error: could not find function "HTSeqCounts"

Even if the DEXSeq package seems to be loaded as seen in the session Info:

R version 3.2.3 (2015-12-10)

Platform: x86_64-apple-darwin13.4.0 (64-bit)
Running under: OS X 10.11.4 (El Capitan)

locale:
[1] C

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

other attached packages:
[1] BiocInstaller_1.20.1       DEXSeq_1.16.10             DESeq2_1.10.1            
[4] RcppArmadillo_0.6.700.3.0  Rcpp_0.12.4                SummarizedExperiment_1.0.2
[7] GenomicRanges_1.22.4       GenomeInfoDb_1.6.3         IRanges_2.4.8            
[10] S4Vectors_0.8.11           Biobase_2.30.0             BiocGenerics_0.16.1      
[13] BiocParallel_1.4.3        

loaded via a namespace (and not attached):
[1] genefilter_1.52.1    statmod_1.4.24       locfit_1.5-9.1       splines_3.2.3      
[5] lattice_0.20-33      colorspace_1.2-6     survival_2.39-2      XML_3.98-1.4       
[9] foreign_0.8-66       DBI_0.3.1            RColorBrewer_1.1-2   lambda.r_1.1.7     
[13] plyr_1.8.3           stringr_1.0.0        zlibbioc_1.16.0      Biostrings_2.38.4  
[17] munsell_0.4.3        gtable_0.2.0         futile.logger_1.4.1  hwriter_1.3.2      
[21] latticeExtra_0.6-28  geneplotter_1.48.0   biomaRt_2.26.1       AnnotationDbi_1.32.3
[25] acepack_1.3-3.3      xtable_1.8-2         scales_0.4.0         Hmisc_3.17-3       
[29] annotate_1.48.0      XVector_0.10.0       Rsamtools_1.22.0     gridExtra_2.2.1    
[33] ggplot2_2.1.0        stringi_1.0-1        grid_3.2.3           tools_3.2.3        
[37] bitops_1.0-6         magrittr_1.5         RCurl_1.95-4.8       RSQLite_1.0.0      
[41] Formula_1.2-1        cluster_2.0.4        futile.options_1.0.0 Matrix_1.2-5       
[45] rsconnect_0.4.2.1    rpart_4.1-10         nnet_7.3-12

Does anyone know why I have this error message?
Thanks in advance for your help,

Sakura

ADD COMMENTlink modified 3.0 years ago by Martin Morgan ♦♦ 23k • written 3.0 years ago by sakura.nussbaum10
Answer: Error: could not find function "HTSeqCounts"
0
gravatar for arfranco
3.0 years ago by
arfranco130
European Union
arfranco130 wrote:

HTSeqCount is not part of the DEXSeq package. I have just installed this package and check it. I have also run a search in the pdf vignette and HTSeqCount is not defined within the document

You probably need to install and use HTSeqCount outside R. This happens with limma, DESeq, DESeq2, etc

ADD COMMENTlink written 3.0 years ago by arfranco130

I realised that I had an error, I was supposed to type "read.HTSeqCounts()" instead of just "HTSeqCounts()", but id did not solve my problem, I still get:

Error: could not find function "read.HTSeqCounts"

I am trying to follow the pipeline from this source, and it seems that this function is in the package...

https://books.google.co.jp/books?id=f4tqBAAAQBAJ&pg=PA184&lpg=PA184&dq=Reading+all+the+sample-specific+count+tables+is+done+by+the+function+read.HTSeqCounts()+from+the+package+DEXSeq&source=bl&ots=7lMhp7fVjQ&sig=r6dEc-4slTppnDK8ODVD4RMzJHg&hl=fr&sa=X&ved=0ahUKEwii3vuu46HMAhWGtpQKHaoRDtYQ6AEIHjAA#v=onepage&q=Reading%20all%20the%20sample-specific%20count%20tables%20is%20done%20by%20the%20function%20read.HTSeqCounts()%20from%20the%20package%20DEXSeq&f=false

ADD REPLYlink written 3.0 years ago by sakura.nussbaum10

I think the function has been renamed as DEXSeqDataSetFromHTSeq(), and the chapter that you are using  is (already, unfortunately) out-of-date (I couldn't find via online search the version of DEXSeq used in the chapter -- no sessionInfo()). Some archaeology shows that read.HTSeqCount was 'deprecated' on 2014-03-21, in version 1.9.7 of the package, so more than two years ago; the current version of the package is 1.16.10. The message accompanying the change is

------------------------------------------------------------------------
r87693 | a.reyes | 2014-03-21 09:25:45 -0400 (Fri, 21 Mar 2014) | 1 line

most of package rewritten, see NEWS
------------------------------------------------------------------------

so there may be additional differences between the text of the book that you are reading and the package. The good news is that there is an extensive current vignette (also browseVignettes(package="DEXSeq")) in the package itself.

ADD REPLYlink written 3.0 years ago by Martin Morgan ♦♦ 23k

And this is written in that vignette about HTSeq

The initial steps of a DEXSeq analysis, described in the following two sections, is typically done outside R, by using two provided Python scripts

ADD REPLYlink written 3.0 years ago by arfranco130

Thank you all for your answers. I changed the method and I am now following this pipeline as you suggested. However, I also have some problems.

When I call the DEXSeqDataSetFromHTSeq, I obtain the following error:

> dxd = DEXSeqDataSetFromHTSeq(countFiles, sampleData=sampleTable, design= ~ sample + exon + condition:exon, flattenedfile=flattenedFile)
Error in strsplit(rownames(dcounts), ":") : non-character argument

Here is what countFiles and sampleTable look like:

> countFiles
[1] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/basal_1.txt"   
[2] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/basal_2.txt"   
[3] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/basal_3.txt"   
[4] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/bulge_1.txt"   
[5] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/bulge_2.txt"   
[6] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/bulge_3.txt"   
[7] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/cdh3_1.txt"    
[8] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/cdh3_2.txt"    
[9] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/cdh3_3.txt"    
[10] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/cdh3_4.txt"    
[11] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/gli_1.txt"     
[12] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/gli_2.txt"     
[13] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/gli_4.txt"     
[14] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lef_1.txt"     
[15] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lef_4.txt"     
[16] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lef_5.txt"     
[17] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lef_6.txt"     
[18] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lgr6_10_1.txt" 
[19] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lgr6_10_2.txt" 
[20] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lgr6_40_1.txt" 
[21] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lgr6_40_2.txt" 
[22] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/lgr6_40_3.txt" 
[23] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_10_1.txt"
[24] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_10_2.txt"
[25] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_10_3.txt"
[26] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_40_1.txt"
[27] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_40_2.txt"
[28] "/Volumes/TOSHIBAEXT/3.mapping-hisat/Counts/pdgfra_40_3.txt"
> sampleTable
          condition    libType
basal1        basal single-end
basal2        basal single-end
basal3        basal single-end
bulge1        bulge single-end
bulge2        bulge single-end
bulge3        bulge single-end
cdh31          cdh3 single-end
cdh32          cdh3 single-end
cdh33          cdh3 single-end
cdh34          cdh3 single-end
gli11          gli1 single-end
gli12          gli1 single-end
gli14          gli1 single-end
lef11          lef1 single-end
lef14          lef1 single-end
lef15          lef1 single-end
lef16          lef1 single-end
lgr6101        lgr6 single-end
lgr6102        lgr6 single-end
lgr6401        lgr6 single-end
lgr6402        lgr6 single-end
lgr6403        lgr6 single-end
pdgfra101    pdgfra single-end
pdgfra102    pdgfra single-end
pdgfra103    pdgfra single-end
pdgfra401    pdgfra single-end
pdgfra402    pdgfra single-end
pdgfra403    pdgfra single-end

 

I guess this is correct. However, when looking at the count files, I have the impression that the .txt look weird. Here is the first one (sample: basal_1) as an example. This is all that is contained in the file:

_ambiguous    0
_ambiguous_readpair_position    0
_empty    9651846
_lowaqual    846199
_notaligned    421258

I created this file with this command (and successfully installed pysam before):

 

$ python /Library/Frameworks/R.framework/Versions/3.2/Resources/library/DEXSeq/python_scripts/dexseq_count.py -f bam mm10.genes.gff Sample_Basal_1_159/accepted_hits_no_rRNA.bam counts/basal_1.txt



​Is this output normal with dexseq_count.py? If not, does anyone know what could be the problem? I tried with different options, but as my data are not paired-end and strand specific, I should use is like this.

ADD REPLYlink written 3.0 years ago by sakura.nussbaum10
Answer: Error: could not find function "HTSeqCounts"
0
gravatar for arfranco
3.0 years ago by
arfranco130
European Union
arfranco130 wrote:

read.HTSeqCounts() is indeed the function implemented into R that reads the counts that you have previously obtained using HTSeqCount. If you have not run HTSeqCount, you have not counts to read

I know for sure that HTSeqCount is a standalone application. After reading the vignette and looking into the DEXSeq help, I can ensure 100% that this function is not implemented in this package

ADD COMMENTlink modified 3.0 years ago • written 3.0 years ago by arfranco130
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 16.09
Traffic: 246 users visited in the last hour