-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update docs & include OTUs from ghost-tree
- Loading branch information
1 parent
52b8b5e
commit 08b1910
Showing
2 changed files
with
45 additions
and
5 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
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
""" | ||
This file can be downloaded and used to create a .txt file containing only | ||
the accession numbers from the ghost-tree.nwk that you plan to use for your | ||
analyses. | ||
You must have skbio installed. http://scikit-bio.org/ | ||
You will then use "ghost_tree_tips.txt" output file containing the accession | ||
numbers to filter your .biom table so that it contains only the OTUs that | ||
are in the ghost-tree.nwk that you are using. | ||
http://qiime.org/scripts/filter_otus_from_otu_table.html | ||
Use the required arguments and the following two optional arguments: | ||
-e, --otu_ids_to_exclude_fp | ||
(provide the text file containing OTU ids to exclude) | ||
--negate_ids_to_exclude | ||
(this will keep OTUs in otu_ids_to_exclude_fp, rather than discard them) | ||
""" | ||
from skbio import TreeNode | ||
|
||
ghosttree = TreeNode.read("ghost_tree.nwk") # insert your ghost-tree name here | ||
output = open("ghost_tree_tips.txt", "w") | ||
|
||
for node in ghosttree.tips(): | ||
output.write(str(node.name)+"\n") | ||
|
||
output.close() |