Filtering DESeq2 results for | LFC | > 1 genes
Entering edit mode
ayy2110 • 0
Last seen 2.8 years ago
United States
res_LFC <- res[which(abs(res$log2FoldChange) > 1)]
Error: subscript contains out-of-bounds indices

I am performing differential gene expression analysis using DESeq2. I am able to successfully run deseq2, and I generate a results table that i called res. i want to filter res for genes with |LFC| > 1, and so I wrote the above code. I dont understand why i obtain the error message though. can anyone provide some insight?

R version 4.0.3 (2020-10-10) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 17763)

Matrix products: default

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

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

loaded via a namespace (and not attached): [1] MatrixGenerics_1.2.1 Biobase_2.50.0 httr_1.4.2 bit64_4.0.5
[5] splines_4.0.3 assertthat_0.2.1 askpass_1.1 stats4_4.0.3
[9] BiocFileCache_1.14.0 blob_1.2.1 Rsamtools_2.6.0 GenomeInfoDbData_1.2.4
[13] progress_1.2.2 pillar_1.6.1 RSQLite_2.2.7 lattice_0.20-44
[17] glue_1.4.2 GenomicRanges_1.42.0 RColorBrewer_1.1-2 XVector_0.30.0
[21] colorspace_2.0-1 Matrix_1.2-18 DESeq2_1.30.1 XML_3.99-0.6
[25] pkgconfig_2.0.3 biomaRt_2.46.3 genefilter_1.72.1 zlibbioc_1.36.0
[29] purrr_0.3.4 xtable_1.8-4 scales_1.1.1 BiocParallel_1.24.1
[33] tibble_3.1.1 openssl_1.4.4 annotate_1.68.0 generics_0.1.0
[37] IRanges_2.24.1 ggplot2_3.3.3 ellipsis_0.3.2 cachem_1.0.4
[41] SummarizedExperiment_1.20.0 GenomicFeatures_1.42.3 BiocGenerics_0.36.1 survival_3.2-11
[45] magrittr_2.0.1 crayon_1.4.1 memoise_2.0.0 fansi_0.4.2
[49] xml2_1.3.2 tools_4.0.3 prettyunits_1.1.1 hms_1.1.0
[53] lifecycle_1.0.0 matrixStats_0.58.0 stringr_1.4.0 S4Vectors_0.28.1
[57] munsell_0.5.0 locfit_1.5-9.4 DelayedArray_0.16.3 AnnotationDbi_1.52.0
[61] Biostrings_2.58.0 compiler_4.0.3 GenomeInfoDb_1.26.7 rlang_0.4.11
[65] grid_4.0.3 RCurl_1.98-1.3 rstudioapi_0.13 rappdirs_0.3.3
[69] bitops_1.0-7 gtable_0.3.0 curl_4.3.1 DBI_1.1.1
[73] R6_2.5.0 GenomicAlignments_1.26.0 rtracklayer_1.49.5 dplyr_1.0.5
[77] fastmap_1.1.0 bit_4.0.4 utf8_1.2.1 stringi_1.5.3
[81] parallel_4.0.3 Rcpp_1.0.6 vctrs_0.3.8 geneplotter_1.68.0
[85] dbplyr_2.1.1 tidyselect_1.1.1
RNAseq LFC DEseq • 1.1k views
Entering edit mode
ayy2110 • 0
Last seen 2.8 years ago
United States

turns out i was missing a comma!

res_LFC <- res[which(abs(res$log2FoldChange) > 1),]

Login before adding your answer.

Traffic: 864 users visited in the last hour
Help About
Access RSS

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

Powered by the version 2.3.6