Question: Remove accession numbers form nexus tree files
0
gravatar for AB
11 months ago by
AB0
AB0 wrote:

Hi,

I'm relatively new to bioinformatics and am trying to work out how to remove the accession numbers from a Nexus formatted tree.

e.g.

#NEXUS
BEGIN TREES;
    TREE 1 = (CY116033b|A/swine/England/195852/1992,(((CY038004b|A/swine/En$
END;

I want to remove every accession number between the ( and | as this is causing issues with downstream programs.

I've tried sed (commands such as sed -e 's/.*\([A-Z][A-Z][0-9][0-9][0-9][0-9][0-9][0-9]\).*/\1/g' but can't seem to get it to work.

Does anyone know how to do this?

Any help would be much appreciated!

AB

nexus accession numbers • 246 views
ADD COMMENTlink modified 8 months ago by Pierre Lindenbaum116k • written 11 months ago by AB0
0
gravatar for Pierre Lindenbaum
8 months ago by
France/Nantes/Institut du Thorax - INSERM UMR1087
Pierre Lindenbaum116k wrote:
 sed -r  's/\([A-Za-z0-9]+\|/(/g'

?

ADD COMMENTlink written 8 months ago by Pierre Lindenbaum116k
0
gravatar for cpad0112
8 months ago by
cpad011211k
India
cpad011211k wrote:
$ echo "(CY116033b|A/swine/England/195852/1992,(((CY038004b|A/swine/En" | sed 's/(\w\+|//g' 
A/swine/England/195852/1992,((A/swine/En
ADD COMMENTlink modified 8 months ago • written 8 months ago by cpad011211k
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: 1019 users visited in the last hour