小编Tom*_*Tom的帖子

Matplotlib:如何在酒吧之间获得空间?

您好我已经开始使用matplotlib并一直在尝试调整网站上的示例代码以满足我的需求.我有下面的代码,我想要的除了每组中的第3个栏与第一组下一个栏重叠.互联网不足以添加图片,但任何帮助都会很棒,如果你能解释我的错误是什么,将不胜感激.

谢谢,汤姆

"""
Bar chart demo with pairs of bars grouped for easy comparison.
"""
import numpy as np
import matplotlib.pyplot as plt


n_groups = 3

means_e1 = (20, 35, 30)
std_e1 = (2, 3, 4)

means_e2 = (25, 32, 34)
std_e2 = (3, 5, 2)

means_e3 = (5, 2, 4)
std_e3 = (0.3, 0.5, 0.2)

fig, ax = plt.subplots()

index = np.arange(n_groups)
bar_width = 0.35

opacity = 0.4
error_config = {'ecolor': '0.3'}

rects1 = plt.bar(index , means_e1, bar_width,
                 alpha=opacity, …
Run Code Online (Sandbox Code Playgroud)

python matplotlib

9
推荐指数
1
解决办法
2万
查看次数

Java VM 因堆大小增加而失败

S0 我试图运行的命令是;

java -jar -Xmx290G  /ibers/ernie/home/thh32/rumenISPG/GenomeAnalysisTK.jar  -T VariantFiltration -R Contigs_1.fa  -V Rank10_clean.fasta.gz.Contig_1-sort.bam.vcf1.vcf  --filterExpression "QD < 2.0 || FS > 60.0 || MQ < 40.0 || HaplotypeScore > 13.0 || MappingQuality RankSum < -12.5 "  --filterName "testing_filter"  -o filtered_snps.vcf
Run Code Online (Sandbox Code Playgroud)

我正在运行它的机器可以访问 500G RAM,所以应该不是问题,但是我不断收到此错误消息;

Error occurred during initialization of VM
Unable to allocate 9502720KB bitmaps for parallel garbage collection for the requested 304087040KB heap.
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Run Code Online (Sandbox Code Playgroud)

有没有其他人遇到过这个问题,如果有,你解决了吗?

哦,也只是为了防止人们想知道为什么我给这个程序这么多内存,当我没有收到这条消息时,表明它需要更多的内存。这是 …

java jvm

6
推荐指数
0
解决办法
2万
查看次数

使用 argparse 创建输出文件

我一直在我正在编写的程序中使用 argparse,但它似乎没有创建指定的输出文件。

我的代码是:

parser.add_argument("-o", "--output", action='store', dest='output', help="Directs the output to a name of your choice")
with open(output, 'w') as output_file:
            output_file.write("%s\n" % item)
Run Code Online (Sandbox Code Playgroud)

我也试过:

parser.add_argument("-o", "--output", action='store', type=argparse.FileType('w'), dest='output', help="Directs the output to a name of your choice")
    output_file.write("%s\n" % item)
Run Code Online (Sandbox Code Playgroud)

发生的错误是:

    output_file.write("%s\n" % item)
NameError: name 'output_file' is not defined
Run Code Online (Sandbox Code Playgroud)

有人可以解释为什么我会发生这个错误以及我如何解决它?

我所有的代码:

from __future__ import print_function
from collections import defaultdict
from itertools import groupby
import argparse #imports the argparse module so it can be used
from itertools import …
Run Code Online (Sandbox Code Playgroud)

python python-2.7 argparse output

5
推荐指数
1
解决办法
1万
查看次数

根据列中的值选择行

我有一个制表符分隔表,我想要打印列'x'大于'Y'的所有行.我尝试使用下面的代码,但我是使用awk的新手,所以我不确定如何根据列使用它.

awk '$X >= Y {print} ' Table.txt | cat > Wanted_lines 
Run Code Online (Sandbox Code Playgroud)

Y是1到100之间的值.

如果输入如下,列X是第二列.

1    30
2    50
3    100
4    100
5    80
6    79
7    90
Run Code Online (Sandbox Code Playgroud)

想要的输出是:

3    100
4    100
5    80
7    90
Run Code Online (Sandbox Code Playgroud)

该文件的前两行是:

1   OTU1    243622  208679  121420  265864  0   0   2   0   0   11  1   5   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   839604  OTU1    -   Archaea 100%    Euryarchaeota   100%    Methanobacteria 100%    Methanobacteriales  100%    Methanobacteriaceae …
Run Code Online (Sandbox Code Playgroud)

bash awk

5
推荐指数
1
解决办法
8038
查看次数

标签 统计

python ×2

argparse ×1

awk ×1

bash ×1

java ×1

jvm ×1

matplotlib ×1

output ×1

python-2.7 ×1