Python ==错误==分析YAML文件时捕获异常
我似乎无法找出我的yaml文件有什么问题。我复制了这个例子,并在10个不同的迭代中填写了我的样本,试图找出问题所在,我似乎能让它工作Python ==错误==分析YAML文件时捕获异常,python,yaml,Python,Yaml,我似乎无法找出我的yaml文件有什么问题。我复制了这个例子,并在10个不同的迭代中填写了我的样本,试图找出问题所在,我似乎能让它工作 orientation: "fr", type: "paired-end", right reads: [ "/users/drob2727/supercomputer/Bon1read1.fastq", "/users/drob2727/supe
orientation: "fr",
type: "paired-end",
right reads: [
"/users/drob2727/supercomputer/Bon1read1.fastq",
"/users/drob2727/supercomputer/Bon2read1.fastq",
"/users/drob2727/supercomputer/Bon3read1.fastq"
],
left reads: [
"/users/drob2727/supercomputer/Bon1read2.fastq",
"/users/drob2727/supercomputer/Bon2read2.fastq",
"/users/drob2727/supercomputer/Bon3read2.fastq"
]
我得到了类似的错误
== Error == exception caught while parsing YAML file (/wheeler/scratch/drob2727/matreads8.yaml):
while parsing a block mapping
in "/wheeler/scratch/drob2727/matreads8.yaml", line 1, column 5
expected <block end>, but found ','
in "/wheeler/scratch/drob2727/matreads8.yaml", line 16, column 6
==错误==解析YAML文件时捕获异常(/wheeler/scratch/drob2727/matreads8.YAML):
在分析块映射时
在“/wheeler/scratch/drob2727/matreads8.yaml”中,第1行第5列
应为,但找到“,”
在“/wheeler/scratch/drob2727/matreads8.yaml”中,第16行第6列
我缩短了文件以便于管理,但这些是我得到的错误类型。使用不同的解析器
expected <block end>, but found ','
使用我得到的另一个解析器
expected <block end>, but found ','
YAML不使用逗号。还有字典(hashmaps或JSON对象)和列表(或数组)的特定语法 你可以。
还有一个 这对我很有用:
orientation: "fr"
type: "paired-end"
right reads:
- "/users/drob2727/supercomputer/Bon1read1.fastq"
- "/users/drob2727/supercomputer/Bon2read1.fastq"
- "/users/drob2727/supercomputer/Bon3read1.fastq"
left reads:
- "/users/drob2727/supercomputer/Bon1read2.fastq"
- "/users/drob2727/supercomputer/Bon2read2.fastq"
- "/users/drob2727/supercomputer/Bon3read2.fastq"
YAML不使用逗号。还有字典(hashmaps或JSON对象)和列表(或数组)的特定语法 你可以。
还有一个 这对我很有用:
orientation: "fr"
type: "paired-end"
right reads:
- "/users/drob2727/supercomputer/Bon1read1.fastq"
- "/users/drob2727/supercomputer/Bon2read1.fastq"
- "/users/drob2727/supercomputer/Bon3read1.fastq"
left reads:
- "/users/drob2727/supercomputer/Bon1read2.fastq"
- "/users/drob2727/supercomputer/Bon2read2.fastq"
- "/users/drob2727/supercomputer/Bon3read2.fastq"
所有有效的JSON也是有效的YAML。如果你想要一个更简单(并且更容易推理)的语法,可以考虑在JSON中编写文件;任何兼容的YAML解析器仍然会加载它。“所有有效的JSON也是有效的YAML”-IIRC这仅适用于YAML 1.2,并且有很多较旧的解析器。所有有效的JSON也是有效的YAML。如果你想要一个更简单(并且更容易推理)的语法,可以考虑在JSON中编写文件;任何兼容的YAML解析器仍然会加载它。“所有有效的JSON都是有效的YAML”-IIRC这只适用于YAML 1.2,而且有很多较旧的解析器。我可以看到它经过了验证,我已经尝试了手册中的迭代,但我似乎无法做到。您提供给我的代码main(sys.argv)File“/opt/spack/opt/spack/linux-centos7-nehalem/gcc-9.3.0/spades-3.14.1-u5nojwyz5gim2iz35tmi42qrycktdj5h/bin/metaspades.py”,第581行,在主cfg中,dataset_data,command_line=parse_args(args,log)文件中“/opt/spack/opt/spack/linux-centos7-nehalem/gcc-9.3.0/spades-3.14.1-u5nojwyz5gim2iz35tmi42qrycktdj5h/bin/metaspades.py“,第238行,在parse_argsWell中,YAML错误消失,因此这将在程序中验证。这个答案奏效了。另一个问题是独立的,应该是独立的问题。如果你提出了一个新问题,让我知道,我也会尽力帮助你。我可以看出它是经过验证的,我也尝试过手册中的迭代,但我似乎做不到。您提供给我的代码main(sys.argv)File“/opt/spack/opt/spack/linux-centos7-nehalem/gcc-9.3.0/spades-3.14.1-u5nojwyz5gim2iz35tmi42qrycktdj5h/bin/metaspades.py”,第581行,在主cfg中,dataset_data,command_line=parse_args(args,log)文件中“/opt/spack/opt/spack/linux-centos7-nehalem/gcc-9.3.0/spades-3.14.1-u5nojwyz5gim2iz35tmi42qrycktdj5h/bin/metaspades.py“,第238行,在parse_argsWell中,YAML错误消失,因此这将在程序中验证。这个答案奏效了。另一个问题是独立的,应该是独立的问题。如果你提出一个新问题,让我知道,我也会尽力帮助你。