Permalink
Browse files

Wrote code to map ids to sequence objects.

  • Loading branch information...
1 parent 2bf05ed commit 5bea51d36746354895eab37ba085cc5ea6a637b6 @shailen committed May 25, 2011
Showing with 15 additions and 0 deletions.
  1. 0 README
  2. +15 −0 fc_rough.py
  3. 0 new_sequence.fasta
  4. 0 sample_alignment.msa
  5. 0 sample_tree.ml
View
0 README 100644 → 100755
No changes.
View
15 fc_rough.py 100644 → 100755
@@ -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
+
+
View
0 new_sequence.fasta 100644 → 100755
No changes.
View
0 sample_alignment.msa 100644 → 100755
No changes.
View
0 sample_tree.ml 100644 → 100755
No changes.

0 comments on commit 5bea51d

Please sign in to comment.