Question: how to write for getting set of gene in one line having each sample name
0
gravatar for raya.girish
2.8 years ago by
raya.girish20
raya.girish20 wrote:

Dear All It may be useless question I have data sheet having CNV information

File    CN State    Genes       Microarray Nomenclature

s1             1,33                a,b,c                Xq28(154,337,224-154,929,412)x1-2

s1             1.33                a,f,h                 Xp22.33(177,941-2,699,968)x2

s2             3.0                  r,h,s                 12p12.3p12.1(19,251,491-23,210,281)x2-3

s3             2.1                 a,t,c,a,r            12p11.22p11.21(28,433,320-32,514,115)x2-3

I am looking for code

Which will give me excel sheet contain

File    CN State    Genes       Microarray Nomenclature

s1             1.33                a                  Xq28(154,337,224-154,929,412)x1-2

s1             1.33                b                    Xq28(154,337,224-154,929,412)x1-2

s1             1.33                c                    Xq28(154,337,224-154,929,412)x1-2

Similar for other samples . This means that the set of gene will be split in new line but sample name , cnv status and nomenclature should also repeat once the gene set is split in new line

cnv R • 767 views
ADD COMMENTlink modified 2.8 years ago by Pierre Lindenbaum128k • written 2.8 years ago by raya.girish20

I see you tagged R, so you prefer to use R? Any experience with it?

ADD REPLYlink written 2.8 years ago by WouterDeCoster43k

nothing like that I am ostly working on R so

ADD REPLYlink written 2.8 years ago by raya.girish20
2
gravatar for Pierre Lindenbaum
2.8 years ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum128k wrote:
 awk '{n=split($3,a,/,/);for(i=1;i<=n;++i) {printf("%s\t%s\t%s\t%s\n",$1,$2,a[i],$4);}}' input.txt

File    CN State    Genes       Microarray Nomenclature
s1  1,33    a   Xq28(154,337,224-154,929,412)x1-2
s1  1,33    b   Xq28(154,337,224-154,929,412)x1-2
s1  1,33    c   Xq28(154,337,224-154,929,412)x1-2
s1  1.33    a   Xp22.33(177,941-2,699,968)x2
s1  1.33    f   Xp22.33(177,941-2,699,968)x2
s1  1.33    h   Xp22.33(177,941-2,699,968)x2
s2  3.0 r   12p12.3p12.1(19,251,491-23,210,281)x2-3
s2  3.0 h   12p12.3p12.1(19,251,491-23,210,281)x2-3
s2  3.0 s   12p12.3p12.1(19,251,491-23,210,281)x2-3
s3  2.1 a   12p11.22p11.21(28,433,320-32,514,115)x2-3
s3  2.1 t   12p11.22p11.21(28,433,320-32,514,115)x2-3
s3  2.1 c   12p11.22p11.21(28,433,320-32,514,115)x2-3
s3  2.1 a   12p11.22p11.21(28,433,320-32,514,115)x2-3
s3  2.1 r   12p11.22p11.21(28,433,320-32,514,115)x2-3
ADD COMMENTlink modified 2.8 years ago • written 2.8 years ago by Pierre Lindenbaum128k

hi pierre This code is not giving me gene at one line only one gene is getting printed

ADD REPLYlink written 2.8 years ago by raya.girish20

I have gene number in more than 20 gene seperated by ,

ADD REPLYlink written 2.8 years ago by raya.girish20
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 1256 users visited in the last hour