有没有办法让 Cytoscape 在导入 TSV 数据时自动识别列表列?

huangapple go评论60阅读模式
英文:

Is there a way to have cytoscape automatically recognize list columns when importing tsv data

问题

我想通过“文件/导入/从文件导入表”选项导入包含已存在网络的节点数据的tsv表。tsv表的格式如下:

id    accessions
1     ABCDE.1|CDEFG.1
2     EFGH.1

我可以手动选择将accessions列读取为字符串列表,以|符号作为分隔符。但我想知道是否有一种方法让Cytoscape自动识别这种格式。

我在detailed file format的文档中看到,您可以在标题中指定列类型,通过将列名写为col_name (class=String)。在.tsv格式的文件的标题行中指定数据类型的方法是否存在?如果有,对于列表类型,应该如何工作?

我还在this question中读到,可以使用命令行工具导入数据,使用命令“network import file”。我尝试使用以下命令:

network import file file="example.tsv" columnTypeList="s,sa" dataTypeList="s,sl" delimitersForDataList="|" rootNetworkList="existing_network" indexColumnSourceInteraction=0 targetColumnList="nodeId" startLoadRow=2

这个命令几乎做对了,正确识别了列表列,但它创建了一个新网络,而不是将属性分配给现有网络。我尝试使用rootNetworkList="existing_network"指定现有网络,但没有任何变化。我不知道这是否相关,但目前属性表仅包括现有网络中节点的子集。

任何有助于使其工作(仅使用tsv文件或使用命令)的帮助将不胜感激。

英文:

I want to import a tsv table containing node data for an already existing network via the File/Import/Table From File option. The tsv table has the following format

id    accessions
1     ABCDE.1|CDEFG.1
2     EFGH.1

I can manually select that I want the accessions column to be read as a list of strings, with the | symbol as a separator. But I want to know if there is a way to have Cytoscape automatically recognize this format.

I saw in the documentation for the detailed file format that there you can specify the column type in the header, by writing the column name as col_name (class=String). Is there a way to specify the data type in the header row for the .tsv format as well? If so, how would it work for list types?

I also read in this question that the command line tool could be used for importing data, using the command "network import file". I tried using the command as follows

network import file file="example.tsv" columnTypeList="s,sa" dataTypeList="s,sl" delimitersForDataList="|" rootNetworkList="existing_network" indexColumnSourceInteraction=0 targetColumnList="nodeId" startLoadRow=2

This command does almost the right thing and it recognized the list columns correctly, but it creates a new network instead of assigning the attributes to the existing network. I tried specifying the existing network with rootNetworkList="existing_network" but that didn't change anything. I don't know if it's relevant, but at the moment the attribute table only includes a subset of the nodes in the existing network.

Any help to get this to work (with only the tsv file or with the command) would be appreciated.

答案1

得分: 0

好的,阅读了一些代码后,我发现以下注释:

// TODO: 尝试检测 List 类型

所以目前,在输入对话框中我们不尝试猜测列表类型。另一方面,命令行方法应该是可行的。问题在于你使用了错误的命令。不要使用network import file,而是使用table import file,它具有与network import相同类型的参数,只是它导入到网络而不是尝试导入网络。

希望对你有帮助!

-- scooter

英文:

Well, after perusing the code in some detail, I find the following comment:

// TODO: Try to detect List types

So, currently, we don't try to guess list types in the input dialog. On the other hand, the command line approach should work. The issue, is you are using the wrong command. Instead of using network import file, you should use table import file, which has the same kind of arguments as network import except that it imports into a network rather than attempting to import a network.

Hope this helps!

-- scooter

huangapple
  • 本文由 发表于 2023年3月3日 20:11:37
  • 转载请务必保留本文链接:https://go.coder-hub.com/75626919.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定