将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'

相关问答

更多

PHP如何舍入到小数点后两位?(PHP How do I round down to two decimal places?)

这可以工作: floor($number * 100) / 100 This can work: floor($number * 100) / 100

如何格式化小数点总是显示2位小数?(How can I format a decimal to always show 2 decimal places?)

我想你可能使用decimal模块中的Decimal()对象? (如果你需要两位数字的精度超过小数点,任意大的数字,你绝对应该是,这就是你的问题的标题建议...) 如果是这样,文档的十进制常规部分有一个可能对您有用的问题/答案对: Q.在具有两个小数位的定点应用程序中,一些输入有很多地方需要舍入。 其他人不应该有多余的数字,需要验证。 应该使用什么方法? A. quantize()方法舍入到固定的小数位数。 如果设置了Inexact陷阱,它也可用于验证: >>> TWOPLACES = Decima...

Android - 小数点后2位[重复](Android - Round to 2 decimal places [duplicate])

您可以使用String.format("%.2f", d) ,双击将自动舍入。 You can use String.format("%.2f", d), your double will be rounded automatically.

格式化数字为2位小数(Format number to 2 decimal places)

你想使用TRUNCATE命令。 http://dev.mysql.com/doc/refman/5.0/en/mathematical-functions.html#function_truncate You want to use the TRUNCATE command. https://dev.mysql.com/doc/refman/8.0/en/mathematical-functions.html#function_truncate

当.toFixed(2)在小数点后给零时如何将float的格式设置为整数?(How to format a float as integer when .toFixed(2) gives zeros after the decimal point?)

...最好不解析和操纵.toFixed(2)出来的字符串? 好吧,你可以用数字来做,尽管我担心在数字逻辑和固定的逻辑之间取得完美的匹配,因为toFixed的定义包括以下短语: 设n是n ÷10 f - x的精确数学值尽可能接近零的整数。 如果有两个这样的n ,选择较大的n 。 所以我可能只是更新字符串,这不是很多工作: function formatNumber(num) { return num.toFixed(2).replace(/\.00$/, ""); } functi...

删除除小数点以外的所有小数位(Remove all zero decimal places except the decimal mark)

如果你只想剥离零点: >>> '12.000'.rstrip('0') '12.' If you only want to strip zeroes: >>> '12.000'.rstrip('0') '12.'

不使用科学记数法将小数点格式化为小数位数(Format decimal to number of decimal places without scientific notation)

你可以尝试这样: 0.1234567.ToString("0.####") 还要检查自定义数字格式字符串 # 用相应的数字代替“#”符号(如果有的话); 否则,结果字符串中不会出现数字。 也正如Jon所指出的,它会围绕你的号码。 见注释部分 舍入和固定点格式字符串 对于定点格式字符串(即,不包含科学记数法格式字符的格式字符串),数字将舍入到小数点右侧的数字占位符的小数位数。 You can try like this: 0.1234567.ToString("0.####") Also che...

.NET字符串格式化 - 小数点左边的#是什么意思?(.NET String formatting -What does the # mean to the left of the decimal point?)

为了解释您引用的文档 , #使该位置的数字可选。 如果该号码在该位置有一个重要数字,它将被打印; 否则它不会。 看看这个例子: String.Format("{0:0.##}, {0:#.##}", 0.5) 这将输出 0.5, .5 或许是一个更明确的例子: String.Format("{0:000.000}, {0:###.###}", 0.5) 这将输出 000.500, .5 To paraphrase the documentation that you cited, the ...

字符串格式表达式,仅当有小数(.net)时才显示带有2位小数的货币(String Format expression to show Currency with 2 decimal places only if there are decimals (.net))

检查小数是否包含小数元素,并根据结果返回不同的表示: public string GetFormatStringForDecimal(myDec){ return (Decimal.Ceiling(myDec) > myDec) ? "C2" : "C0"; } 此函数将返回问题中指定的小数的格式字符串。 Check whether the decimal contains a fractional element and return a different representatio...

格式小数,正负和零值到2位小数格式(Format decimal with positive negative and zero value to 2 decimal places format)

尝试NumberStyles.Number ,这将工作: decimal price = -3; decimal result = decimal.Parse(price.ToString("##.00"), NumberStyles.Number); //Result: -3,00 (comma because I live in Europe :D) 希望这可以帮助! 编辑: 要确保逗号使用德语CultureInfo,因为它们使用逗号表示小数,将句点用作千位分隔符: decimal pric...

相关文章

更多

在Hadoop集群上运行R程序--安装RHadoop

Hadoop是由Revolution Analytics发起的一个开源项目,它可以将统计语言R与Had ...

nutch与起点R3集成之笔记(二)

在nutch与起点R3集成之笔记(一)中介绍了在起点R3中添加nutch要用到的索引字段,上述字段建好 ...

Drupal Forums instead of phpBB or vBulletin: A casestudy

5th Jan, 10 Drupal drupal advanced forum drupa ...

[转]So You Want To Be A Producer

pro-du-cer n. 1. Someone from a game publisher who ...

nutch与起点R3集成之笔记(一)

百度、google帮我们找Internet的信息,但对于一个行业内部网(intranet)来说,百度、 ...

Create a Bootable MicroSD Card

http://gumstix.org/create-a-bootable-microsd-card.h ...

Becoming a data scientist

Data Week: Becoming a data scientist Data Pointed, ...

nutch与起点R3集成之笔记(三)

四、抓取网页,建立solr索引 在抓取网页前,要保证起点R3处在运行状态。即 在浏览器中键入 http ...

nutch与起点R3集成之笔记(四)

通过“nutch与起点R3集成之笔记(一、二、三)”中的步骤,我们可以建立起一个行业内部网的搜索引擎, ...

Hibernate Search(基于version3.4)--第五章Querying

Hibernate Search的第二个很重要的能力是运行Lucene queries并通过Hiber ...

最新问答

更多

sp_updatestats是否导致SQL Server 2005中无法访问表?(Does sp_updatestats cause tables to be inaccessible in SQL Server 2005?)

否(它不会使它们无法访问),是(您可以在没有停机的情况下运行它)。 sp_updatestats可以在没有停机的情况下针对实时数据库运行。 No (it doesn't make them inaccessible), and Yes (you can run it without downtime). sp_updatestats can be run against a live database without downtime.

如何创建一个可以与持续运行的服务交互的CLI,类似于MySQL的shell?(How to create a CLI that can interact with a continuously running service, similar to MySQL's shell?)

最终,我们选择了使用Spark Framework for Java实现的后端REST API。 这可能不是最强大的,用户反馈一直是个问题。 我们将命令行界面拆分为提交REST调用,并将结果显示给用户。 Ultimately, we chose to go the route of having a backend REST API that was implemented with the Spark Framework for Java. This may not be the most r

AESGCM解密失败的MAC(AESGCM decryption failing with MAC)

您不能将Encoding.UTF8.GetString应用于任意二进制数据。 它只能解码使用UTF-8编码字符串的结果的字节。 .net实现将默默地破坏数据,而不是默认情况下抛出异常。 您应该使用Base64: Convert.FromBase64String和Convert.ToBase64String You can't apply Encoding.UTF8.GetString to arbitrary binary data. It can only decode bytes that

Zurb Foundation 4 - 嵌套网格对齐问题(Zurb Foundation 4 - Nested grid alignment issues)

我希望能看到更多你的Sass代码等,但我的猜测是你需要在所有嵌套行上使用nest行为。 在我看来,基金会在Sass中的行主要是为了在一个层面上使用。 嵌套在另一行中的任何行都应使用nest行为,除非您希望在列上添加额外的填充。 在你的CodePen中,我能够通过向所有行添加一类collapse来修复列上填充的问题,我认为这与执行$behavior: nest相同$behavior: nest在Sass中$behavior: nest :

湖北京山哪里有修平板计算机的

京山有个联想的专卖店,那里卖平板电脑,地址在中百前面的十字路口右拐 ,他们应该会提供相关的维修服务。

SimplePie问题(SimplePie Problem)

我怀疑由于内容的性质(包含代码),stackoverflow提要不起作用。 我使用许多feed解析器看似“正常”的feed有类似的问题,尽管我最近运气最多的是Zend_Feed。 试试吧 I suspect the stackoverflow feed is not working due to the nature of the content (contains code). I have had similar issues with seemingly "normal" feeds us

在不同的任务中,我们可以同时使用多少“上下文”?(How many 'context' we can use at a time simultaneously in different tasks?)

是的,您可以通过getApplicationContext()任意数量的时间(后台任务), getApplicationContext()仅返回应用程序的context 。 Yes, you can pass getApplicationContext() any number of time (Background Tasks ) you want, getApplicationContext() simply returns context of the application.

HTML / Javascript:从子目录启用文件夹访问(HTML/Javascript: Enabling folder access from a subdirectory)

这是我最终做的事情: 我无法以这种方式提供完全访问权限,而是在project level folder中设置了一个虚拟HTML页面,该页面单击自身以重定向到位于separate, non-project util folder的HTML文件。 这允许我保留除了那个之外的所有内容,非常小的文件分开但不存在文件访问问题。 Here is what I ended up doing: I wasn't able to provide full access exactly this way, but

为什么我会收到链接错误?(Why do I get a linker error?)

看起来您的编译器错误地将名称引入到全局名称空间中,而不是C ++ 11 3.5 / 7中指定的最内层名称空间( Bushman ): 如果没有找到具有链接的实体的块范围声明来引用某个其他声明,那么该实体是最内层封闭名称空间的成员。 代码按照预期在GCC上编译: http : //ideone.com/PR4KVC 你应该能够通过在构造函数的块作用域中声明它之前(或代替它)在正确的名称空间中声明该函数来解决该bug。 但是,我无法访问您的编译器来测试它。 It looks like your co

如何正确定义析构函数(How to properly define destructor)

在C ++中,你需要手动释放内存。 没有垃圾收集器。 您显然需要在析构函数内手动释放内存。 如果您使用new分配内存,则需要对在deconstructor中使用new分配的每个资源使用delete ,例如: class1::~class1(void) { delete resource1; delete resource2; etc... } In C++ you need to free the memory manually. There's no garbage