首页 \ 问答 \ 将dada2安装到通过condas安装的R版本中(installing dada2 into a version of R that was installed through condas)

将dada2安装到通过condas安装的R版本中(installing dada2 into a version of R that was installed through condas)

我有一个通过condas安装R的环境(我目前使用R与jupyter笔记本,所以这是有道理的一点)。 我想在这个版本的R中使用dada2。

根据这个网站https://anaconda.org/bioconda/bioconductor-dada2正确的命令来实现这一点是

 conda install -c bioconda bioconductor-dada2 

这给我以下错误

获取包元数据.............解决包的规格:。

不可分析的错误:发现以下规范存在冲突: - 生物导体 - 数据2 - >生物导体 - 生物导体> = 2.32.1 - >生物导体 - 生物共同体> = 0.15.6 - > r 3.3.1 * - > r碱基3.3。 1 - r-glue使用“conda info”查看每个软件包的依赖关系。

如果我运行conda info package r-glue我可以看到它取决于r-base 3.4.1。

另一种方法也行不通:

我也尝试进入R并从那里安装,但我无法获得任何软件包来安装R软件包

 source("https://bioconductor.org/biocLite.R")
 biocLite("dada2")

给我一个非常长的输出,但缺点是一堆依赖返回错误

错误:编译包'RcppParallel'失败*删除'/ home / jacob / anaconda3 / lib / R / library / RcppParallel'错误:依赖'S4Vectors'不可用于包'IRanges'*删除'/ home / jacob / anaconda3 / lib / R / library / IRanges'错误:依赖关系'S4Vectors','IRanges','matrixStats'不可用于包'DelayedArray'

然后更多的东西,并在最后

错误:依赖'Biostrings','ShortRead','RcppParallel'不可用于包'dada2'*删除'/ home / jacob / anaconda3 / lib / R / library / dada2'

下载的源码包在'/ tmp / Rtmptx8OqE / downloaded_pa​​ckages'中更新'.Library'中包的HTML索引制作'packages.html'...完成旧包:'curl','dplyr','foreign',' haven','httpuv','mgcv','purrr','Rcpp','TTR','xts'更新全部/部分/无? [A / S / N]:

然后所有的更新都失败了。

是否正确的答案是不尝试在R中使用dada2和condas,而只是使用condas独立版本的R,还是有一些我缺少的方法?

我在ubuntu linux 16.04和conda 3.2.23上运行R版本3.4.1,以获得更多价值。


I have an environment with R installed through condas (I currently use R with jupyter notebook, so this made sense at one point). I would like to use dada2 with this version of R.

As per this site https://anaconda.org/bioconda/bioconductor-dada2 the correct command to make this happen is

 conda install -c bioconda bioconductor-dada2 

which gives me the following error

Fetching package metadata ............. Solving package specifications: .

UnsatisfiableError: The following specifications were found to be in conflict: - bioconductor-dada2 -> bioconductor-biostrings >=2.32.1 -> bioconductor-biocgenerics >=0.15.6 -> r 3.3.1* -> r-base 3.3.1 - r-glue Use "conda info " to see the dependencies for each package.

If I run conda info package r-glue I can see that it depends on r-base 3.4.1.

Alternative approach that also doesn't work:

I also tried going into R and installing from there, but I can't get any packages to install with R packages

 source("https://bioconductor.org/biocLite.R")
 biocLite("dada2")

Gives me a really long output, but the short of it is that a bunch of the dependencies return errors

ERROR: compilation failed for package ‘RcppParallel’ * removing ‘/home/jacob/anaconda3/lib/R/library/RcppParallel’ ERROR: dependency ‘S4Vectors’ is not available for package ‘IRanges’ * removing ‘/home/jacob/anaconda3/lib/R/library/IRanges’ ERROR: dependencies ‘S4Vectors’, ‘IRanges’, ‘matrixStats’ are not available for package ‘DelayedArray’

and then more stuff and at the end

ERROR: dependencies ‘Biostrings’, ‘ShortRead’, ‘RcppParallel’ are not available for package ‘dada2’ * removing ‘/home/jacob/anaconda3/lib/R/library/dada2’

The downloaded source packages are in ‘/tmp/Rtmptx8OqE/downloaded_packages’ Updating HTML index of packages in '.Library' Making 'packages.html' ... done Old packages: 'curl', 'dplyr', 'foreign', 'haven', 'httpuv', 'mgcv', 'purrr', 'Rcpp', 'TTR', 'xts' Update all/some/none? [a/s/n]:

and then all of the updates fail too.

Is the correct answer to not try to use dada2 with condas in R and rather just use a condas independent version of R, or is there some way that I am missing?

I am running R version 3.4.1 on ubuntu linux 16.04 and conda 3.2.23 for what that is worth.


原文:https://stackoverflow.com/questions/45556517
更新时间:2024-04-23 18:04

最满意答案

我想你可能使用decimal模块中的Decimal()对象? (如果你需要两位数字的精度超过小数点,任意大的数字,你绝对应该是,这就是你的问题的标题建议...)

如果是这样,文档的十进制常规部分有一个可能对您有用的问题/答案对:

Q.在具有两个小数位的定点应用程序中,一些输入有很多地方需要舍入。 其他人不应该有多余的数字,需要验证。 应该使用什么方法?

A. quantize()方法舍入到固定的小数位数。 如果设置了Inexact陷阱,它也可用于验证:

>>> TWOPLACES = Decimal(10) ** -2       # same as Decimal('0.01')
>>> # Round to two places
>>> Decimal('3.214').quantize(TWOPLACES)
Decimal('3.21')
>>> # Validate that a number does not exceed two places
>>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
Decimal('3.21')
>>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact]))
Traceback (most recent call last):
   ...
Inexact: None

下一个问题读

问:一旦我有两个地方有效的输入,那么如何在整个应用程序中保持不变呢?

如果您需要答案(以及许多其他有用的信息),请参阅文档的上述部分 。 另外,如果你的Decimal保持在Decimal的两位数字,这意味着要保持小数点左边的所有数字和它的右边的两位数,而不是更多的精确度) ,然后将它们转换成带有str可以正常工作:

str(Decimal('10'))
# -> '10'
str(Decimal('10.00'))
# -> '10.00'
str(Decimal('10.000'))
# -> '10.000'

I suppose you're probably using the Decimal() objects from the decimal module? (If you need exactly two digits of precision beyond the decimal point with arbitrarily large numbers, you definitely should be, and that's what your question's title suggests...)

If so, the Decimal FAQ section of the docs has a question/answer pair which may be useful for you:

Q. In a fixed-point application with two decimal places, some inputs have many places and need to be rounded. Others are not supposed to have excess digits and need to be validated. What methods should be used?

A. The quantize() method rounds to a fixed number of decimal places. If the Inexact trap is set, it is also useful for validation:

>>> TWOPLACES = Decimal(10) ** -2       # same as Decimal('0.01')
>>> # Round to two places
>>> Decimal('3.214').quantize(TWOPLACES)
Decimal('3.21')
>>> # Validate that a number does not exceed two places
>>> Decimal('3.21').quantize(TWOPLACES, context=Context(traps=[Inexact]))
Decimal('3.21')
>>> Decimal('3.214').quantize(TWOPLACES, context=Context(traps=[Inexact]))
Traceback (most recent call last):
   ...
Inexact: None

The next question reads

Q. Once I have valid two place inputs, how do I maintain that invariant throughout an application?

If you need the answer to that (along with lots of other useful information), see the aforementioned section of the docs. Also, if you keep your Decimals with two digits of precision beyond the decimal point (meaning as much precision as is necessary to keep all digits to the left of the decimal point and two to the right of it and no more...), then converting them to strings with str will work fine:

str(Decimal('10'))
# -> '10'
str(Decimal('10.00'))
# -> '10.00'
str(Decimal('10.000'))
# -> '10.000'

相关问答

更多

相关文章

更多

最新问答

更多
  • CSS修复容器和溢出元素(CSS Fix container and overflow elements)
  • SQL多个连接在与where子句相同的表上(SQL Multiple Joins on same table with where clause)
  • nginx 80端口反向代理多个域名,怎样隐藏端口的
  • xcode提醒样式,swift 3(xcode alert style, swift 3)
  • 在Chrome控制台中调试JavaScript(debugging javascript in Chrome console)
  • Javascript - 试图围绕自定义事件(Javascript - Trying to wrap my head around custom events)
  • 边栏链接不可点击(Sidebar links aren't clickable)
  • 使用recpatcha gem时如何显示其他表单错误?(How do I display other form errors when using the recpatcha gem?)
  • boost.python避免两次注册内部类,但仍然在python中公开(boost.python Avoid registering inner class twice but still expose in python)
  • Android 现在软件很少吗?以后会多起来吗
  • 如何在ActiveAdmin 0.5.0中为资源全局指定预先加载?(How to specify eager loading globally for a resource in ActiveAdmin 0.5.0?)
  • matlab代码为黄金比例持续分数(matlab code for golden ratio continued fraction)
  • Android浏览器触摸事件位置(Android browser touch event location)
  • 将cURL输出分配给Bash中的变量(Assign output to variable in Bash)
  • 我如何在MVC视图上没有时间获取当前日期(how i can get current date without time on MVC view)
  • sql连接函数(sql join of function)
  • 为什么在Xamarin Media插件中使用ImageSource.FromStream而不是FromFile?(Why use ImageSource.FromStream instead of FromFile in Xamarin Media plugin?)
  • 这段代码是否真的可以防止SQL注入?(Will this code actually work against SQL-injection? [duplicate])
  • 信阳方远计算机学校大专证被国家认可么
  • React / Rails AJAX POST请求返回404(React/Rails AJAX POST request returns 404)
  • Android与php服务器交互(Android interact with php server)
  • 自动刷新QTableWidget可能吗?(Refresh QTableWidget automatically possible?)
  • JVM / Compiler优化对象的未使用属性(optimization of unused properties of object by JVM / Compiler)
  • 插入表格时,乌克兰字符会更改为问号(Ukrainian character change to question mark when insert to table)
  • 在头文件中包含异常类(Including an exception class in a header file)
  • 完成c#中的执行后关闭sqlcmd(Close sqlcmd after finishing executing in c#)
  • 使用软导航栏正确检测屏幕尺寸(Detecting screensize correctly with soft navigation bar)
  • Typescript:从输入更新值(Typescript : update value from input)
  • 如何在执行某些行后仅在断点处停止?(How to only stop at a breakpoint after some line was executed?)
  • 以未定义的元素在JSON中循环(loop in JSON with undefined elements)