-
Notifications
You must be signed in to change notification settings - Fork 23
PB Prune taxa
Steve Bond edited this page Sep 30, 2015
·
5 revisions
Remove taxa with IDs matching specified regex pattern(s). Note that the regex search is greedy, and a match anywhere in the ID will cause the leaf to be pruned. If you need the entire ID to be matched, use the '^...$' syntax ('^' specifies the beginning of the string, and '$' specifies the end).
One or more regex patterns, separated by spaces. If there are any special characters in the expression, then ensure the string is enclosed in quotes.
#NEXUS
BEGIN TAXA;
DIMENSIONS NTAX=6;
TAXLABELS
firSA25b
firSA24a
firSA25a
firSA26b
firSA24b
firSA26a
;
END;
BEGIN TREES;
TREE fir1 = [&U] ((firSA25b:2.0,firSA24a:1.0),((firSA25a:1.0,(firSA26b:3.0,firSA24b:1.0)),firSA26a:1.0)):2.0;
END;
#### fir1 ####
/----------------- firSA25b
/---------------------------------------------------+
| \----------------- firSA24a
|
+ /---------------------------------- firSA25a
| /-----------------+
| | | /----------------- firSA26b
\----------------+ \----------------+
| \----------------- firSA24b
|
\---------------------------------------------------- firSA26a
$: pb fir.nex -pt firSA25b firSA26a
$: pb fir.nex -pt '(5b|6a)'
#NEXUS
BEGIN TAXA;
DIMENSIONS NTAX=4;
TAXLABELS
firSA24a
firSA25a
firSA26b
firSA24b
;
END;
BEGIN TREES;
TREE fir1 = [&U] (firSA24a:1.0,(firSA25a:1.0,(firSA26b:3.0,firSA24b:1.0))):2.0;
END;
#### fir1 ####
/--------------------------------------------------------------------- firSA24a
+
| /---------------------------------------------- firSA25a
\----------------------+
| /----------------------- firSA26b
\----------------------+
\----------------------- firSA24b