data import error
1
0
Entering edit mode
sumitra • 0
@d20c4a62
Last seen 15 months ago
Denmark

Hi,

I am very new to R and DeSeq2 and i've been facing difficulties importing my dataset which is a taxon count table i obtained from running diamond blast and Megan6 (a metagenome analyzer tool). I've been trying top follow guideline on http://bioconductor.org/packages/devel/bioc/vignettes/DESeq2/inst/doc/DESeq2.html#count-matrix-input, but have trouble understanding where im going wrong. Help will be much appreciated. Thank you

Code should be placed in three backticks as shown below

    countData<- read.csv('/media/combio7/SONY_64M1/deseq2/out.csv', header = TRUE, sep = ",")
    metaData <- read.csv('/media/combio7/SONY_64M1/deseq2/Comparison_bs-season2_70622-metadata.csv', header = TRUE, sep = ",")

# include your problematic code here with any corresponding output 

cts <- as.matrix(read.csv(countData,sep=",",row.names="Datasets"))

Error is as below:
Error in h(simpleError(msg, call)) : error in evaluating the argument 'x' in selecting a method for function 'as.matrix': 'file' must be a character string or connection


# please also include the results of running the following in an R session 
![this is how my metadata looks][1]
![here is a screenshot of my dataframe (taxon count table)[1]

sessionInfo( )
> sessionInfo( )
R version 4.1.3 (2022-03-10)
Platform: x86_64-conda-linux-gnu (64-bit)
Running under: Ubuntu 20.04.3 LTS

Matrix products: default
BLAS/LAPACK: /home/combio7/anaconda3/envs/r4-base/lib/libopenblasp-r0.3.21.so

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

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

other attached packages:
 [1] ggplot2_3.3.6               DESeq2_1.34.0              
 [3] SummarizedExperiment_1.24.0 Biobase_2.54.0             
 [5] MatrixGenerics_1.6.0        matrixStats_0.62.0         
 [7] GenomicRanges_1.46.1        GenomeInfoDb_1.30.1        
 [9] IRanges_2.28.0              S4Vectors_0.32.4           
[11] BiocGenerics_0.40.0        

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.9             locfit_1.5-9.6         lattice_0.20-45       
 [4] png_0.1-7              Biostrings_2.62.0      assertthat_0.2.1      
 [7] utf8_1.2.2             R6_2.5.1               RSQLite_2.2.15        
[10] httr_1.4.3             pillar_1.8.0           zlibbioc_1.40.0       
[13] rlang_1.0.4            annotate_1.72.0        blob_1.2.3            
[16] Matrix_1.4-1           splines_4.1.3          BiocParallel_1.28.3   
[19] geneplotter_1.72.0     RCurl_1.98-1.8         bit_4.0.4             
[22] munsell_0.5.0          DelayedArray_0.20.0    compiler_4.1.3        
[25] pkgconfig_2.0.3        tidyselect_1.1.2       KEGGREST_1.34.0       
[28] tibble_3.1.8           GenomeInfoDbData_1.2.7 XML_3.99-0.10         
[31] fansi_1.0.3            withr_2.5.0            crayon_1.5.1          
[34] dplyr_1.0.9            bitops_1.0-7           grid_4.1.3            
[37] xtable_1.8-4           gtable_0.3.0           lifecycle_1.0.1       
[40] DBI_1.1.3              magrittr_2.0.3         scales_1.2.0          
[43] cli_3.3.0              cachem_1.0.6           XVector_0.34.0        
[46] genefilter_1.76.0      vctrs_0.4.1            generics_0.1.3        
[49] RColorBrewer_1.1-3     tools_4.1.3            bit64_4.0.5           
[52] glue_1.6.2             purrr_0.3.4            parallel_4.1.3        
[55] fastmap_1.1.0          survival_3.4-0         AnnotationDbi_1.56.2  
[58] colorspace_2.0-3       memoise_2.0.1
DESeq2 • 906 views
ADD COMMENT
2
Entering edit mode
Basti ▴ 780
@7d45153c
Last seen 6 days ago
France

You already imported countData with read.csv(), so it has no sense to make read.csv again on countData. Simply do cts <- as.matrix(countData)

ADD COMMENT
0
Entering edit mode

Hi Basti,

Thank you so much for correcting my silly mistake. I manged to eliminate the error.

ADD REPLY

Login before adding your answer.

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