[R] sample and rearrange

Laetitia Schmid laetitia at gmt.su.se
Wed May 19 14:29:33 CEST 2010


Dear Wu Gong and Peter Ehlers,
thank you very much for your help debugging my script.

Now I have a general following up question:
Is there a straightforward way to rearrange the following dataset so  
that all first letters of each column will be combined in one column,  
all the second letters in a second column, all the third ones in a  
third column and so on, resulting in 7 columns,
i.e. for the first individual (GM920222) GGGG AAAA TTTT TTAA GGGG CCAA  
CCCC ?

Thank you very much,
Laetitia

SampleID	A1	A2	A3	A4
GM920222	GATTGCC	GATTGCC	GATAGAC	GATAGAC
GM930040	GTCATCA	GAGTGCA	ACTATAA	GATTGCC
GM930040	GTCATCA	GAGTGCA	ACTATAA	GATTGCC
GM960023	GATTGCC	GTCATCA	GATTGCC	GATTGCC
GM920224	ACTAGAA	GTCATCA	GTCATCA	ACTAGAA
GM920224	ACTAGAA	GTCATCA	GTCATCA	ACTAGAA
GM920034	GATTGCC	GTCATCA	GATTGCA	GATTGCA
GM920096	GATTGCC	GATTGCC	GATTGCA	GATTGCC
GM930029	GTCATCA	GATTGCC	GTCATCA	GATTGCC
GM940031	GATTGCC	GAGTGCA	GATTGCA	ACTAGAA
GM960028	GATTGCC	GAGTGCA	GATTGCA	ACTAGAA
GM980007	GTCATCA	GATTGCC	ACTTGAA	GTCATCA
GM970009	ACTAGAA	GTCAGAA	GTCAGCA	ACTAGCA
GM930026	ACTAGAA	GAGTGCA	GAGTGCA	ACTAGAA
GM920031	GATTGCC	GTCATCA	GATTGCC	GATTGCC
GM990105	GATTGCC	GATTGCC	GTCAGCA	GTCAGCA
GM920202	GATTGCC	GATTGCC	GATTGCC	GATTGCC
GM920089	GAGTGCA	GTCAGAA	ACTATCA	GATTGCC
GM980051	ACTAGAA	ACTAGAA	GATAGCC	GATAGCC
GM930109	GTCATCA	GAGTGCA	GTTTTAA	ACTAGAA
GM940039	GTCATCA	GAGTGCA	GTTTGCC	ACTTTCA
GM050099	GAGTGCA	GTCAGAA	GTTATCC	ACTTTCA
GM050099	GAGTGCA	GTCAGAA	GTTATCC	ACTTTCA
GM030005	ACTAGAA	GAGTGCA	ACTAGAA	ACTAGAA
GM050009	ACTAGAA	GATTGCC	GATTGCC	ACTAGAA
GM990027	GATTGCC	GAGTGCA	GATTGCA	GATTGCC
GM990066	GATTGCC	GTCATCA	GTCATCA	GATTGCC



More information about the R-help mailing list