Skip to content
Snippets Groups Projects
Commit 447ea1ce authored by Swastik Mishra's avatar Swastik Mishra
Browse files

correct paths and streamline gloome output compilation

parent dc00fe02
No related branches found
No related tags found
No related merge requests found
%% Cell type:markdown id: tags:
# Compile results
The code run here compiles each of the program outputs into a common format, for further analysis.
%% Cell type:code id: tags:
``` python
# to suppress warning from ete3 because it's not up to date with py3.12
import warnings
# ignore SyntaxWarning
warnings.filterwarnings("ignore", category=SyntaxWarning)
```
%% Cell type:code id: tags:
``` python
import numpy as np
import pandas as pd
from tqdm import tqdm
# ignore SettingWithCopyWarning for pandas
pd.options.mode.chained_assignment = None
```
%% Cell type:code id: tags:
``` python
from lib.output_compilation_functions import *
```
%% Cell type:code id: tags:
``` python
# make a directory to store the compiled results
res_dir = '../data/compiled_results/'
if not os.path.exists(res_dir):
os.makedirs(res_dir)
data_dir = '../data'
program_runs_dir = '../data/program_runs/'
taxonomic_id = '1236'
input_tree_filepath = f"{
data_dir}/1236_wol_tree_pruned_with_internal_labels.nwk"
```
%% Cell type:code id: tags:
``` python
%%bash -s "$res_dir"
mkdir -p $1/angst $1/ale $1/ranger $1/gloome_ml $1/gloome_mp $1/count_ml $1/count_mp $1/wn
```
%% Cell type:markdown id: tags:
## AnGST
%% Cell type:code id: tags:
``` python
angst_output_dir = f"{program_runs_dir}/AnGST/Results/"
nogwise_branchwise_angst_df, nogwise_angst_df = compile_angst_results(angst_output_dir, input_tree_filepath)
print("AnGST results compiled.\nNOGwise DF:")
display(nogwise_angst_df)
print("NOGwise branchwise DF:")
display(nogwise_branchwise_angst_df)
nogwise_angst_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.angst.tsv", index=False, header=True, sep='\t')
nogwise_branchwise_angst_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.branchwise.angst.tsv", index=False, header=True, sep='\t')
nogwise_angst_df.to_csv(f"{res_dir}/angst/compiled_transfers.nogwise.angst.tsv", index=False, header=True, sep='\t')
nogwise_branchwise_angst_df.to_csv(f"{res_dir}/angst/compiled_transfers.nogwise.branchwise.angst.tsv", index=False, header=True, sep='\t')
```
%% Output
Original transfers DF looks like:
AnGST results compiled.
NOGwise DF:
NOGwise branchwise DF:
%% Cell type:markdown id: tags:
## ALE
%% Cell type:code id: tags:
``` python
# Line #3 of the uml_rec files have the ALE tree. Extract that newick string, and read the internal node names of that tree
# Map those nodes of the ALE tree to the input species tree.
input_tree = ete3.Tree(input_tree_filepath, format=1)
# do the following for each dir in run_dir that ends with 'ALE'
# first, get the list of all the ALE dirs
ale_dirs = [d for d in os.listdir(program_runs_dir) if d.endswith('ALE')]
print(ale_dirs)
for ale_dir in ale_dirs:
print(f"Processing {ale_dir}...")
nogwise_ale_df, nogwise_branchwise_ale_df = compile_ale_outputs(os.path.join(program_runs_dir, ale_dir, 'Results'), input_tree)
# write it out
nogwise_branchwise_ale_df.to_csv(
f"{res_dir}/compiled_transfers.nogwise.branchwise.{ale_dir.lower()}.tsv",
f"{res_dir}/ale/compiled_transfers.nogwise.branchwise.{ale_dir.lower()}.tsv",
index=False,
header=True,
sep="\t",
)
nogwise_ale_df.to_csv(
f"{res_dir}/compiled_transfers.nogwise.{ale_dir.lower()}.tsv",
f"{res_dir}/ale/compiled_transfers.nogwise.{ale_dir.lower()}.tsv",
index=False,
header=True,
sep="\t",
)
print("Nogwise, branchwise transfers:")
display(nogwise_branchwise_ale_df)
print("Nogwise transfers:")
display(nogwise_ale_df)
print("-----------------------------------")
```
%% Output
['ALE']
Processing ALE...
Files to be written with ale:
Nogwise, branchwise transfers:
Nogwise transfers:
-----------------------------------
%% Cell type:markdown id: tags:
## Ranger
%% Cell type:code id: tags:
``` python
ranger_output_dirs = [f"{program_runs_dir}/{d}/Results/" for d in os.listdir(program_runs_dir) if d.startswith('RANGER')]
for ranger_output_dir in ranger_output_dirs:
print(f"Processing {ranger_output_dir}...")
ranger_dir = os.path.basename(os.path.dirname(os.path.dirname(ranger_output_dir)))
print(f"Ranger dir: {ranger_dir}")
nogwise_branchwise_ranger_df, nogwise_ranger_df = compile_ranger_results(
ranger_output_dir, input_tree_filepath
)
print("NOGwise DF:")
display(nogwise_ranger_df)
print("NOGwise branchwise DF:")
display(nogwise_branchwise_ranger_df)
nogwise_ranger_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.{os.path.basename(ranger_dir).lower()}.tsv", index=False, header=True, sep='\t')
nogwise_branchwise_ranger_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.branchwise.{os.path.basename(ranger_dir).lower()}.tsv", index=False, header=True, sep='\t')
nogwise_ranger_df.to_csv(f"{res_dir}/ranger/compiled_transfers.nogwise.{os.path.basename(ranger_dir).lower()}.tsv", index=False, header=True, sep='\t')
nogwise_branchwise_ranger_df.to_csv(f"{res_dir}/ranger/compiled_transfers.nogwise.branchwise.{os.path.basename(ranger_dir).lower()}.tsv", index=False, header=True, sep='\t')
```
%% Output
Processing ../data/program_runs//RANGER/Results/...
Ranger dir: RANGER
NOGwise DF:
NOGwise branchwise DF:
Processing ../data/program_runs//RANGER-Fast/Results/...
Ranger dir: RANGER-Fast
NOGwise DF:
NOGwise branchwise DF:
%% Cell type:markdown id: tags:
## GLOOME
GLOOME only infers gains or losses on branches, but without any inference of the source of the gene transfers for the gains. This means that we don't have anything for the source column but we have only the recipient column.
%% Cell type:code id: tags:
``` python
pa_matrix_tsv_filepath = f"{data_dir}/1236_pa_matrix.tsv"
# first we compile results for the case with the species tree,
gloome_output_dir_wt = f"{program_runs_dir}GLOOME_with_tree/Results_GLOOME_with_tree/"
input_tree = ete3.Tree(input_tree_filepath, format=1)
# cases with species tree
gloome_output_dir_wt = f"{program_runs_dir}/GLOOME_with_tree/Results_GLOOME_ML_with_tree/"
gloome_wt_results_dict = read_and_compile_gloome_results(
gloome_output_dir=gloome_output_dir_wt, input_tree=input_tree, species_tree_bool=True,
pa_matrix_tsv_filepath=pa_matrix_tsv_filepath)
print("Results compiled for GLOOME run with species tree.")
for key, df in gloome_wt_results_dict.items():
# ml
gloome_ml_results_dict = read_and_compile_gloome_results(
gloome_output_dir_wt, pa_matrix_tsv_filepath, "ml", input_tree_filepath
)
for key, df in gloome_ml_results_dict.items():
print(f"{key} df:")
display(df)
df.to_csv(f"{res_dir}/{key}.tsv",
index=False, header=True, sep='\t')
# then the case without the species tree
gloome_output_dir_wot = f"{program_runs_dir}GLOOME_without_tree/Results_GLOOME_without_tree/"
gloome_wot_results_dict = read_and_compile_gloome_results(
gloome_output_dir=gloome_output_dir_wot, input_tree=input_tree, species_tree_bool=False,
pa_matrix_tsv_filepath=pa_matrix_tsv_filepath)
print("Results compiled for GLOOME run without species tree.")
for key, df in gloome_wot_results_dict.items():
df.to_csv(f"{res_dir}/gloome_ml/{key}tsv", index=False, header=True, sep='\t')
# mp
gloome_mp_output_dir_wt = [f"{program_runs_dir}/GLOOME_with_tree/{fi}" for fi in os.listdir(f"{program_runs_dir}/GLOOME_with_tree/") if fi.startswith('Results_GLOOME_MP_')]
gloome_mp_results_dict = read_and_compile_gloome_results(
gloome_mp_output_dir_wt, pa_matrix_tsv_filepath, "mp", input_tree_filepath
)
for key, df in gloome_mp_results_dict.items():
if key.endswith('8'): # only show the df for gain penalty ratio 8
print(f"{key} df:")
display(df)
df.to_csv(f"{res_dir}/gloome_mp/{key}tsv", index=False, header=True, sep='\t')
# cases without species tree
gloome_output_dir_wot = f"{program_runs_dir}/GLOOME_without_tree/Results_GLOOME_ML_without_tree/"
# ml
gloome_ml_results_dict = read_and_compile_gloome_results(
gloome_output_dir_wot, pa_matrix_tsv_filepath, "ml", None
)
for key, df in gloome_ml_results_dict.items():
print(f"{key} df:")
display(df)
df.to_csv(f"{res_dir}/{key}.without_tree.tsv",
index=False, header=True, sep='\t')
df.to_csv(f"{res_dir}/gloome_ml/{key}without_tree.tsv", index=False, header=True, sep='\t')
# mp
gloome_mp_output_dir = [f"{program_runs_dir}/GLOOME_without_tree/{fi}" for fi in os.listdir(f"{program_runs_dir}/GLOOME_without_tree/") if fi.startswith('Results_GLOOME_MP_')]
gloome_mp_results_dict = read_and_compile_gloome_results(
gloome_mp_output_dir, pa_matrix_tsv_filepath, "mp", None
)
for key, df in gloome_mp_results_dict.items():
if key.endswith('8'):
print(f"{key} df:")
display(df)
key = key.replace('.gloome.mp.', '.gloome.mp.without_tree.')
df.to_csv(f"{res_dir}/gloome_mp/{key}tsv", index=False, header=True, sep='\t')
```
%% Output
compiled_transfers.nogwise.branchwise.gloome.ml. df:
Results compiled for GLOOME run with species tree.
compiled_transfers.nogwise.gloome.ml df:
compiled_transfers.nogwise.branchwise.gloome.ml df:
compiled_losses.nogwise.branchwise.gloome.ml df:
compiled_transfers.nogwise.gloome.mp df:
compiled_transfers.nogwise.branchwise.gloome.mp df:
compiled_losses.nogwise.branchwise.gloome.mp df:
Results compiled for GLOOME run without species tree.
compiled_transfers.nogwise.gloome.ml df:
compiled_transfers.nogwise.branchwise.gloome.ml df:
compiled_losses.nogwise.branchwise.gloome.ml df:
compiled_transfers.nogwise.gloome.ml. df:
compiled_transfers.nogwise.gloome.mp df:
compiled_transfers.nogwise.branchwise.gloome.mp df:
compiled_transfers.nogwise.branchwise.gloome.ml. df:
compiled_losses.nogwise.branchwise.gloome.mp df:
compiled_transfers.nogwise.gloome.ml. df:
%% Cell type:markdown id: tags:
## Count
%% Cell type:markdown id: tags:
### Asymmetric Wagner Parsimony
%% Cell type:code id: tags:
``` python
count_MP_output_dir = f"{program_runs_dir}/Count/Count_MP/"
count_MP_nogwise_transfers_df = compile_count_mp_nogwise_transfers(count_MP_output_dir, taxonomic_id, res_dir)
print("Count MP nogwise transfers:")
display(count_MP_nogwise_transfers_df)
count_MP_nogwise_transfers_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.count.mp.tsv",
count_MP_nogwise_transfers_df.to_csv(f"{res_dir}/count_mp/compiled_transfers.nogwise.count.mp.tsv",
index=False, header=True, sep='\t')
```
%% Output
Count MP nogwise transfers:
%% Cell type:code id: tags:
``` python
!bash lib/compile_count_mp_nw_bw_parallel.sh $program_runs_dir $taxonomic_id $input_tree_filepath $res_dir
```
%% Output
Input dir is ../data/program_runs//Count/Count_MP/
Tree filepath is ../data/1236_wol_tree_pruned_with_internal_labels.nwk and output dir is ../data/compiled_results//count/
Tree filepath is ../data/1236_wol_tree_pruned_with_internal_labels.nwk and output dir is ../data/compiled_results//count_mp/
Files are ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.33_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.5_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_1_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_2_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_3_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_4_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_5_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_6_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_7_families.tsv ../data/program_runs//Count/Count_MP//1236_Count_output_gain_8_families.tsv
Number of files is 10
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_2_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.2.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_6_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.6.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_7_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.7.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_1_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.1.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.33_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.0.33.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.5_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.0.5.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_5_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.5.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_3_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.3.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_8_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.8.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_4_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count//compiled_transfers.nogwise.branchwise.count.mp.4.tsv
Processing 920776 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.33_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.0.33.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_7_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.7.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_0.5_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.0.5.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_1_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.1.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_2_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.2.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_8_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.8.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_4_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.4.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_6_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.6.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_3_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.3.tsv
Processing 930800 nog-branch pairs
Running: python3 lib/compile_count_mp_nw_bw_parallel.py -c ../data/program_runs//Count/Count_MP//1236_Count_output_gain_5_families.tsv -t ../data/1236_wol_tree_pruned_with_internal_labels.nwk -o ../data/compiled_results//count_mp//compiled_transfers.nogwise.branchwise.count.mp.5.tsv
Processing 930800 nog-branch pairs
%% Cell type:code id: tags:
``` python
# list of files. This doesn't include the nogwise branchwise file to be written out at the end,
# in case a previous version exists
count_mp_files = [
f"{res_dir}/count_mp/{f}"
for f in os.listdir(f"{res_dir}/count_mp/")
if f.startswith("compiled_transfers.nogwise.branchwise.count.mp")
]
count_mp_nogwise_branchwise_df = combine_count_mp_nw_bw_transfers(count_mp_files)
print("Count MP nogwise branchwise transfers:")
display(count_mp_nogwise_branchwise_df)
count_mp_nogwise_branchwise_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.branchwise.count.mp.tsv",
index=False, header=True, sep='\t')
```
%% Output
Gain penalty ratios:
Count MP nogwise branchwise transfers:
%% Cell type:markdown id: tags:
### Maximum Likelihood
%% Cell type:code id: tags:
``` python
count_ML_output_dir = f"{program_runs_dir}/Count/Count_ML/"
count_ML_output_file = os.path.join(count_ML_output_dir, "Count_output.tsv")
count_ml_nw_bw_gains_df, count_ml_nogwise_gains_df, count_ml_nw_bw_losses_df = process_count_ml_output(count_ML_output_file)
# Display and write out the dataframes to TSV files
print("Count_ML NOGwise branchwise transfers:")
display(count_ml_nw_bw_gains_df)
count_ml_nw_bw_gains_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.branchwise.count.ml.tsv", index=False, header=True, sep='\t')
count_ml_nw_bw_gains_df.to_csv(f"{res_dir}/count_ml/compiled_transfers.nogwise.branchwise.count.ml.tsv", index=False, header=True, sep='\t')
print("Count ML NOGwise gains:")
display(count_ml_nogwise_gains_df)
count_ml_nogwise_gains_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.count.ml.tsv", index=False, header=True, sep='\t')
count_ml_nogwise_gains_df.to_csv(f"{res_dir}/count_ml/compiled_transfers.nogwise.count.ml.tsv", index=False, header=True, sep='\t')
print("Count_ML NOGwise branchwise losses:")
display(count_ml_nw_bw_losses_df)
count_ml_nw_bw_losses_df.to_csv(f"{res_dir}/compiled_losses.nogwise.branchwise.count.ml.tsv", index=False, header=True, sep='\t')
count_ml_nw_bw_losses_df.to_csv(f"{res_dir}/count_ml/compiled_losses.nogwise.branchwise.count.ml.tsv", index=False, header=True, sep='\t')
```
%% Output
Count_ML NOGwise branchwise transfers:
Count ML NOGwise gains:
Count_ML NOGwise branchwise losses:
%% Cell type:markdown id: tags:
## Wn
%% Cell type:code id: tags:
``` python
wn_hgt_genes_filepath = f"{program_runs_dir}/Wn/Results/HGT_genes.tsv"
members_filepath = f"{data_dir}/{taxonomic_id}_nog_members.tsv"
wn_nogwise_hgt_df, wn_nogwise_branchwise_hgt_df = compile_wn_results(wn_hgt_genes_filepath, members_filepath)
print("Wn NOGwise HGTs:")
display(wn_nogwise_hgt_df)
print("Wn NOGwise branchwise HGTs:")
display(wn_nogwise_branchwise_hgt_df)
wn_nogwise_hgt_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.wn.tsv", index=False, header=True, sep='\t')
wn_nogwise_branchwise_hgt_df.to_csv(f"{res_dir}/compiled_transfers.nogwise.branchwise.wn.tsv", index=False, header=True, sep='\t')
wn_nogwise_hgt_df.to_csv(f"{res_dir}/wn/compiled_transfers.nogwise.wn.tsv", index=False, header=True, sep='\t')
wn_nogwise_branchwise_hgt_df.to_csv(f"{res_dir}/wn/compiled_transfers.nogwise.branchwise.wn.tsv", index=False, header=True, sep='\t')
```
%% Output
Gene to NOG map for some genes:
1005058.UMN179_02117: ET9HP
1006000.GKAS_03119: ET9HP
1051646.IX91_13535: ET9HP
1122206.SAMN02745753_03616: ET9HP
1122207.MUS1_13180: ET9HP
1051646.IX91_06790: ERJME
1051646.IX91_17690: ERJME
1076588.TBH_C2789: ERJME
1127673.GLIP_2986: ERJME
1177154.Y5S_01274: ERJME
Wn NOGwise HGTs:
Wn NOGwise branchwise HGTs:
%% Cell type:code id: tags:
``` python
```
......
......@@ -18,7 +18,7 @@ res_dir=$4
input_dir="$program_runs_dir/Count/Count_MP/"
echo "Input dir is $input_dir"
# output_dir is the directory where all the output files will be written
output_dir="$res_dir/count/"
output_dir="$res_dir/count_mp/"
# make the output dir if it doesn't exist
mkdir -p $output_dir
tree_filepath="$input_tree_filepath"
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment