Skip to content
Discussion options

You must be logged in to vote

@hutumpyancha, this is not really a question about IQ-TREE, but see if this bash code works:

TREEFILE="/work/upasanag/iqtree/gene-tree-50p/attempt3/locus-alignment-50p/IQtree-gene-50p3.treefile"

OUTPUT_DIR="/work/upasanag/iqtree/gene-tree-50p/attempt3/locus-alignment-50p/individual_treefiles"

mkdir -p "${OUTPUT_DIR}"

# Read the .treefile and split into individual gene tree files
awk '{print $0 > sprintf("'"${OUTPUT_DIR}"'/gene_%d.r.tree", NR)}' "${TREEFILE}"

The last line should make files named to match the line in the input file. E.g. the 7th tree in the input file should appear in a file called gene_7.r.tree

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by roblanf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants