Entering edit mode
                    8.3 years ago
        Anny
        
    
        ▴
    
    30
    Hi all,
I got a file with the first column containing id and second column containing annotated gene ontology numbers. As the following
CPIW_00004002-RA    GO:0005515
CPIW_00004002-RA    GO:0010997|GO:0097027|GO:1904668
CPIW_00004003-RA    GO:0003824|GO:0008152
CPIW_00004003-RA    GO:0003987|GO:0016208|GO:0019427
CPIW_00004004-RA    GO:0006506|GO:0016021|GO:0016758
CPIW_00004005-RA    GO:0004360|GO:1901137
CPIW_00004005-RA    GO:0097367|GO:1901135
CPIW_00004006-RA    GO:0005515
CPIW_00004007-RA    GO:0016787
CPIW_00004016-RA    GO:0003824|GO:0046872
I want to split them as one id with one GO term, as
CPIW_00004002-RA    GO:0005515
CPIW_00004002-RA    GO:0010997
CPIW_00004002-RA      GO:0097027
CPIW_00004002-RA       GO:1904668
CPIW_00004003-RA    GO:0003824
CPIW_00004003-RA    GO:0008152
How to write a script to make this work?
Thanks!
Alexie
This is a programming question, not a bioinformatics one. Ask on StackOverflow.