Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wrote code to map ids to sequence objects.
- Loading branch information
Showing
5 changed files
with
15 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,19 @@ | ||
#!/usr/bin/python | ||
|
||
from Bio import Phylo, AlignIO | ||
|
||
tree_file = "sample_tree.ml" | ||
msa_file = "sample_alignment.msa" | ||
new_sequence_file = "new_sequence.fasta" | ||
|
||
tree = Phylo.read(tree_file, "newick") | ||
msa = AlignIO.read(msa_file, "fasta") | ||
|
||
# Note: the name of the tree leaf nodes is going to be the | ||
# same as the id of each msa entry | ||
|
||
sequence_msa_map = {} | ||
for entry in msa: | ||
sequence_msa_map[entry.id] = entry | ||
|
||
|
Empty file.
Empty file.
Empty file.