将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_packages'中更新'.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
满意答案
我想你可能使用
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 thedecimal
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
Decimal
s 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 withstr
will work fine:str(Decimal('10')) # -> '10' str(Decimal('10.00')) # -> '10.00' str(Decimal('10.000')) # -> '10.000'
相关问答
更多PHP如何舍入到小数点后两位?(PHP How do I round down to two decimal places?)
如何格式化小数点总是显示2位小数?(How can I format a decimal to always show 2 decimal places?)
Android - 小数点后2位[重复](Android - Round to 2 decimal places [duplicate])
格式化数字为2位小数(Format number to 2 decimal places)
当.toFixed(2)在小数点后给零时如何将float的格式设置为整数?(How to format a float as integer when .toFixed(2) gives zeros after the decimal point?)
删除除小数点以外的所有小数位(Remove all zero decimal places except the decimal mark)
不使用科学记数法将小数点格式化为小数位数(Format decimal to number of decimal places without scientific notation)
.NET字符串格式化 - 小数点左边的#是什么意思?(.NET String formatting -What does the # mean to the left of the decimal point?)
字符串格式表达式,仅当有小数(.net)时才显示带有2位小数的货币(String Format expression to show Currency with 2 decimal places only if there are decimals (.net))
格式小数,正负和零值到2位小数格式(Format decimal with positive negative and zero value to 2 decimal places format)
相关文章
更多在Hadoop集群上运行R程序--安装RHadoop
nutch与起点R3集成之笔记(二)
Drupal Forums instead of phpBB or vBulletin: A casestudy
[转]So You Want To Be A Producer
nutch与起点R3集成之笔记(一)
Create a Bootable MicroSD Card
Becoming a data scientist
nutch与起点R3集成之笔记(三)
nutch与起点R3集成之笔记(四)
Hibernate Search(基于version3.4)--第五章Querying
最新问答
更多sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)
如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)
AESGCM解密失败的MAC(AESGCM decryption failing with MAC)
Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)
湖北京山哪里有修平板计算机的
SimplePie问题(SimplePie Problem)
在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)
HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)
为什么我会收到链接错误?(Why do I get a linker error?)
如何正确定义析构函数(How to properly define destructor)
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!