小编KBo*_*hme的帖子

作业命令的"+"和" - "输出

"+"和" - "符号在job命令的以下输出中的含义是什么.

-bash-4.1$ jobs
 [1]-  Running                 awk '{print $1,$2,$3,$4}' final_ped.ped > only_ped &
 [2]+  Running                 awk '{if($6==1 || $6==2) print $1,$2}' final_ped.ped > comp_list &
Run Code Online (Sandbox Code Playgroud)

linux

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

Snakemake:如何根据输入文件大小动态设置内存资源

我试图将给定规则的集群内存分配基于输入文件的文件大小。这在snakemake中可能吗?如果可以的话如何实现?

到目前为止,我已经尝试在该resource:部分中指定它,如下所示:

rule compute2:
    input: "input1.txt"
    output: "input2.txt"
    resources:
        mem_mb=lambda wildcards, input, attempt: int(os.path.getsize(str(input))/(1024*1024))
    shell: "touch input2.txt"
Run Code Online (Sandbox Code Playgroud)

但似乎 Snakemake 尝试在创建文件之前预先计算此值,因为我收到此错误:

InputFunctionException in line 35 of test_snakemake/Snakefile:
FileNotFoundError: [Errno 2] No such file or directory: 'input1.txt'
Run Code Online (Sandbox Code Playgroud)

我使用以下命令运行我的snakemake:

snakemake --verbose -j 10 --cluster-config cluster.json --cluster "sbatch -n {cluster.n} -t {cluster.time} --mem {resources.mem_mb}"
Run Code Online (Sandbox Code Playgroud)

snakemake

6
推荐指数
1
解决办法
1334
查看次数

使用 awk 组合单个文件中的列

我正在尝试重新格式化一个大文件。每行的前 6 列都可以,但该行中的其余列需要以 2 为增量组合,中间有一个“/”字符。

示例文件(仅显示几列,但实际文件中有更多列):

1       1       0       0       1       2       A       T       A       C
Run Code Online (Sandbox Code Playgroud)

进入:

1       1       0       0       1       2       A/T     A/C
Run Code Online (Sandbox Code Playgroud)

到目前为止,我一直在尝试 awk,这就是我所处的位置......

awk '{print $1,$2,$3,$4,$5; for(i=7; i < NF; i=i+2) print $i+"/"+$i+1}'  myfile.txt > mynewfile.txt
Run Code Online (Sandbox Code Playgroud)

awk

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

绘图域变量解释(多个图)

我正在查看以下教程https://plot.ly/python/pie-charts/的“饼图子图”部分(页面上的最后一个)。

在一次绘制多个图形时,我无法弄清楚如何理解域变量。例如:

        {
        'labels': ['1st', '2nd', '3rd', '4th', '5th'],
        'values': [38, 27, 18, 10, 7],
        'type': 'pie',
        'name': 'Starry Night',
        'marker': {'colors': ['rgb(56, 75, 126)',
                              'rgb(18, 36, 37)',
                              'rgb(34, 53, 101)',
                              'rgb(36, 55, 57)',
                              'rgb(6, 4, 4)']},
        'domain': {'x': [0, .48],
                   'y': [0, .49]},
        'hoverinfo':'label+percent+name',
        'textinfo':'none'
    },
Run Code Online (Sandbox Code Playgroud)

将在左下角坐标中绘制饼图。

有人能解释一下域变量(及其 x 和 y 分量)在实际中是如何工作的吗?

python plotly

4
推荐指数
1
解决办法
6111
查看次数

标签 统计

awk ×1

linux ×1

plotly ×1

python ×1

snakemake ×1