are there any easy way to build a gmx format file?
0
0
Entering edit mode
5.5 years ago
shoujun.gu ▴ 350

I have several sets of genes. I'd like to know are there any easy way to make a gmx file? Thanks.

gene • 1.8k views
ADD COMMENT
0
Entering edit mode

Going by the definition of the gmx format from here, it seems pretty straightforward. Your question needs more details though. You have "several sets of genes", which is a concept, not data in any specific format. We can help you get from one format to another, but getting from a concept is difficult unless it is articulated better (with an example, for instance).

ADD REPLY
0
Entering edit mode

For example, I have several files. For each file, each line is a gene name, such as:

gene1

gene2

gene3

...

but different files has different number of genes. I want to combine these gene list files into a single gmx file, in which first row of each column is the file name. I'd like to know whether there is some way to do it easily (if file numbers and gene numbers are high)?

ADD REPLY
1
Entering edit mode

You can simply use

paste file1 file2 file3 >genelist.gmx

and then add a header. Or, you can replace each fileX with a <(awk 'BEGIN{print "genelist_name\nna"} {print $0}' fileX) to add a header while reading the file.

See dummy run:

➜ paste <(echo -e "glist1\nna\n1\n2\n3") <(echo -e "glist2\nna\n4\n5") <(echo "glist3\nna\n6")

glist1  glist2  glist3
na      na      na
1       4       6
2       5
3
ADD REPLY
0
Entering edit mode

Thank you! I will try it.

ADD REPLY

Login before adding your answer.

Traffic: 2711 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6