A Subset Of Phylip Alignment?
2
0
Entering edit mode
11.6 years ago

I wonder if there is a free tool that I can use to extract parts of a phylip alignment (not interleaved). An example of a phylip alignment could be like:

2 7

Seq1 ACGTA AC

Seq2 ACGAG AT

I want to extract a part of it, say, from column 3 to column 5.

Thank you,

SangChul

• 3.1k views
ADD COMMENT
1
Entering edit mode
11.6 years ago
Whetting ★ 1.6k

A potential biopython solution... not tested, but this should work

from Bio import AlignIO 
align = AlignIO.read("alignment.phy", "phylip")
print align[:,2:5]
ADD COMMENT
1
Entering edit mode
11.6 years ago
Josh Herr 5.8k

In addition to Whetting's answer on using biopython, you should be able to add an eliminate characters section in your PHYLIP matrix file similar to the characters block exclude function in a NEXUS file. I don't use PHYLIP much (one of the reasons I haven't adopted the program is that I have never really understood the reason for the PHYLIP file format over NEXUS file format). Is there a reason you have to use PHYLIP?

I think MESQUITE will allow you to import all your characters (nucleotides and morphology) and then lets you export PHYLIP format data matrices based on which characters you would like to exclude, but I have not actively used this.

ADD COMMENT
1
Entering edit mode

Seaview (http://pbil.univ-lyon1.fr/software/seaview.html) can be used as an alternative. You can just drag and drop the phylip file, highlight the part you want and save this as a new phylip file...

ADD REPLY

Login before adding your answer.

Traffic: 1493 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6