hi there!
i'm very new to galaxy and it looks very cool.
short version of my question: is there a way to take the transpose of a tabular file?
longer:
i have a tab-delimited file of SNP data, where each row corresponds to a SNP and each column corresponds to an individual (or other attribute with per-SNP information, ex. chromosome or gene information).
for example, i would like to make a tab-delimited file where each row corresponds to an individual and each column corresponds to a SNP. then i would like to convert to hapmap format, etc.
thanks for any help!
elaine
Elaine, et al,
Here is a small perl script that might help you. It uses the perl module Array::Transpose.
#!/usr/bin/env perl
# PURPOSE: output the tab-delimited transpose of whitespace-delimited # matrix. Take input from STDIN unless -t provided, in which case use # the test __DATA__ (below). # AUTHOR: malcolm_cook@stowers.org
use strict; use warnings; use Getopt::Std; use Array::Transpose; our $opt_t; getopts('t'); *ARGV=*DATA if $opt_t; my @L; while (<>) { push(@L,[split]); } local($,,$)=("\t","\n"); print @$_ foreach transpose(@L); exit 0; __DATA__ a b c d 1 2 3 4
________________________________________ From: galaxy-user-bounces@bx.psu.edu [galaxy-user-bounces@bx.psu.edu] On Behalf Of Elaine Angelino [elaine.angelino@gmail.com] Sent: Thursday, April 16, 2009 5:56 PM To: galaxy-user@bx.psu.edu Subject: [galaxy-user] transpose for tab-delimited file?
hi there!
i'm very new to galaxy and it looks very cool.
short version of my question: is there a way to take the transpose of a tabular file?
longer:
i have a tab-delimited file of SNP data, where each row corresponds to a SNP and each column corresponds to an individual (or other attribute with per-SNP information, ex. chromosome or gene information).
for example, i would like to make a tab-delimited file where each row corresponds to an individual and each column corresponds to a SNP. then i would like to convert to hapmap format, etc.
thanks for any help!
elaine
Dear Elaine:
Suppose you have a list of SNP like this:
SNP Individual --------------- A 1 B 1 C 1 A 2 D 2 E 3
If you use Group tool (Join, Subtract, Group -> Group) with parameters as shown in the attached figure you will get this:
1 ['A', 'B', 'C'] 2 ['A', 'D'] 3 E
It does print these brackets for the moment, but this will be fixed once the Galaxy site in updated on Monday.
Let me know if this helps.
anton
On Apr 16, 2009, at 6:56 PM, Elaine Angelino wrote:
hi there!
i'm very new to galaxy and it looks very cool.
short version of my question: is there a way to take the transpose of a tabular file?
longer:
i have a tab-delimited file of SNP data, where each row corresponds to a SNP and each column corresponds to an individual (or other attribute with per-SNP information, ex. chromosome or gene information).
for example, i would like to make a tab-delimited file where each row corresponds to an individual and each column corresponds to a SNP. then i would like to convert to hapmap format, etc.
thanks for any help!
elaine _______________________________________________ galaxy-user mailing list galaxy-user@bx.psu.edu http://mail.bx.psu.edu/cgi-bin/mailman/listinfo/galaxy-user
Anton Nekrutenko Asst. Professor Department of Biochemistry and Molecular Biology Center for Comparative Genomics and Bioinformatics Penn State University anton@bx.psu.edu http://nekrut.bx.psu.edu 814.865.4752
galaxy-user@lists.galaxyproject.org