Remove accession numbers form nexus tree files
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
• 1,437 views
•
link
2 answers
sed -r 's/\([A-Za-z0-9]+\|/(/g'
?
• 1 views
•
link
$ echo "(CY116033b|A/swine/England/195852/1992,(((CY038004b|A/swine/En" | sed 's/(\w\+|//g'
A/swine/England/195852/1992,((A/swine/En
• 1 views
•
link
Log in to answer this question.