Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
sinamajidian committed Mar 27, 2023
1 parent 3777da0 commit b9fc3d7
Show file tree
Hide file tree
Showing 62 changed files with 38 additions and 33 deletions.
3 changes: 3 additions & 0 deletions FastOMA/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

__packagename__ = "FastOMA"
__version__ = "0.0.5"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions fastoma/_wrappers.py → FastOMA/_wrappers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@

from Bio import SeqIO
from fastoma.zoo.wrappers.aligners import mafft
from FastOMA.zoo.wrappers.aligners import mafft
# iqtree
from fastoma.zoo.wrappers.treebuilders import fasttree
from FastOMA.zoo.wrappers.treebuilders import fasttree
# from trimmers.trimal import TrimAl
from ete3 import Tree



from ._utils_subhog import logger_hog
from . import _config

Expand Down
1 change: 1 addition & 0 deletions fastoma/batch_roothogs.py → FastOMA/batch_roothogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from os import listdir
from . import _config


def list_rhog_fastas(address_rhogs_folder):
"""
create orthoxml_to_newick.py list of rootHOG IDs stored in the folder of rHOG .
Expand Down
2 changes: 1 addition & 1 deletion fastoma/collect_subhogs.py → FastOMA/collect_subhogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def collect_subhogs():

# in_folder = _config.in_folder

# python ${fastoma} / collect_subhogs.py ${pickle_rhogs} ${gene_id_dic_xml}
# python ${FastOMA} / collect_subhogs.py ${pickle_rhogs} ${gene_id_dic_xml}


if qfo_bird == "bird_hog":
Expand Down
File renamed without changes.
1 change: 1 addition & 0 deletions fastoma/infer_subhogs.py → FastOMA/infer_subhogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
# import _config



# from ._utils import logger_hog
# import ._utils_rhog

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@



from fastoma.zoo.wrappers import WrapperError
from fastoma.zoo.wrappers.aligners.base_aligner import identify_input
from FastOMA.zoo.wrappers import WrapperError
from FastOMA.zoo.wrappers.aligners.base_aligner import identify_input

import logging
logger = logging.getLogger(__name__)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import shutil
from Bio import AlignIO, SeqIO
import dendropy
from fastoma.zoo.wrappers import WrapperError
from FastOMA.zoo.wrappers import WrapperError
import logging


Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 3 additions & 2 deletions archive/analysis/fastoma_mid_diff.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@


import pickle

def prepare_species_tree(rhog_i, species_tree):
for rec in rhog_i:
Expand Down Expand Up @@ -250,7 +250,7 @@ def distribute_rhogs(rhogs: List[Tuple[str, int]], start_index: int, n_workers:
logger_hog = logging.getLogger("hog")
logger_hog.setLevel(logging.INFO) # WARN
# make sure addresses end with "/"
address_working_folder = "/work/FAC/FBM/DBC/cdessim2/default/ayazdiza/fastoma-dask/"
address_working_folder = "/work/FAC/FBM/DBC/cdessim2/default/ayazdiza/FastOMA-dask/"
address_rhogs_folder = "/work/FAC/FBM/DBC/cdessim2/default/ayazdiza/family-score-adjusted/AdjustedFamilyScore_All_rHOGs/"
address_pickles_folder = "/work/FAC/FBM/DBC/cdessim2/default/ayazdiza/fastoma_repo/temp_results/pickles/mid_adjustedfamily_40_1/"
species_tree_address = address_working_folder + "lineage_tree_qfo.phyloxml"
Expand All @@ -267,6 +267,7 @@ def distribute_rhogs(rhogs: List[Tuple[str, int]], start_index: int, n_workers:
rhog_files = listdir(address_rhogs_folder)[:]
print("#", rhog_files, len(rhog_files))


file_sizes = [os.path.getsize(f'{address_rhogs_folder}{i}') for i in rhog_files]
file_name_size_dict = dict(zip(rhog_files, file_sizes))
file_name_size_list_sorted = sorted(file_name_size_dict.items(), key=lambda x: x[1])
Expand Down
3 changes: 2 additions & 1 deletion archive/analysis/fastoma_mid_newrhg.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

import dill as pickle
# import dill as pickle
import logging
from datetime import datetime
from os import listdir
Expand All @@ -8,6 +8,7 @@
from typing import Tuple, List
from random import sample


from ete3 import Phyloxml
from ete3 import PhyloTree

Expand Down
2 changes: 1 addition & 1 deletion archive/analysis/filter_rhog.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
file_folders = (address_rhogs_folder, gene_trees_folder, pickle_folder, species_tree_address)


oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# in_folder+"omamer_database/oma_path/OmaServer.h5"
print("rHOG inferece has started. The oma database address is in ", oma_database_address)
(oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down
8 changes: 4 additions & 4 deletions archive/analysis/graveyard.py
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ def gene_num_convertor_old(rhogid_num_list_input, address_rhogs_folder, format_p
# import _inferhog
#
# # from _utils import logger_hog
# import fastoma._utils_rhog as _utils_rhog
# import FastOMA._utils_rhog as _utils_rhog
#
# # from distributed import get_client
# # from dask.distributed import rejoin, secede
Expand All @@ -565,7 +565,7 @@ def gene_num_convertor_old(rhogid_num_list_input, address_rhogs_folder, format_p
# file_folders = (address_rhogs_folder, gene_trees_folder, pickle_folder, species_tree_address)
#
#
# oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
# oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# # in_folder+"omamer_database/oma_path/OmaServer.h5"
# print("rHOG inferece has started. The oma database address is in ", oma_database_address)
# (oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down Expand Up @@ -1162,7 +1162,7 @@ def gene_num_convertor_old(rhogid_num_list_input, address_rhogs_folder, format_p
# import _inferhog
#
# # from _utils import logger_hog
# import fastoma._utils_rhog as _utils_rhog
# import FastOMA._utils_rhog as _utils_rhog
#
# # from distributed import get_client
# # from dask.distributed import rejoin, secede
Expand All @@ -1176,7 +1176,7 @@ def gene_num_convertor_old(rhogid_num_list_input, address_rhogs_folder, format_p
# file_folders = (address_rhogs_folder, gene_trees_folder, pickle_folder, species_tree_address)
#
#
# oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
# oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# # in_folder+"omamer_database/oma_path/OmaServer.h5"
# print("rHOG inferece has started. The oma database address is in ", oma_database_address)
# (oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down
6 changes: 3 additions & 3 deletions archive/analysis/main_bird.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
from dask.distributed import Client
from dask_jobqueue import SLURMCluster

from fastoma import _utils_subhog, _infer_subhog, _utils_roothog
from fastoma._utils_subhog import logger_hog
from FastOMA import _utils_subhog, _infer_subhog, _utils_roothog
from FastOMA._utils_subhog import logger_hog

if __name__ == '__main__':

Expand All @@ -26,7 +26,7 @@
rHOG=rootHOG. A subHOG itself is orthoxml_to_newick.py HOG.
"""

oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# in_folder+"omamer_database/oma_path/OmaServer.h5"
print("rHOG inferece has started. The oma database address is in ", oma_database_address)
(oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down
4 changes: 2 additions & 2 deletions archive/analysis/test_curnagle.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ def infer_hogs_for_rhog_levels_recursively(sub_species_tree):
# # import _inferhog
# #
# # # from _utils import logger_hog
# # import fastoma._utils_rhog as _utils_rhog
# # import FastOMA._utils_rhog as _utils_rhog
# #
# # # from distributed import get_client
# # # from dask.distributed import rejoin, secede
Expand All @@ -158,7 +158,7 @@ def infer_hogs_for_rhog_levels_recursively(sub_species_tree):
# # file_folders = (address_rhogs_folder, gene_trees_folder, pickle_folder, species_tree_address)
# #
# #
# # oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
# # oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# # # in_folder+"omamer_database/oma_path/OmaServer.h5"
# # print("rHOG inferece has started. The oma database address is in ", oma_database_address)
# # (oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down
4 changes: 2 additions & 2 deletions archive/gethog3_from_rhog.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import os


# use this python code to convert gethog2 rhogs to fastoma
# use this python code to convert gethog2 rhogs to FastOMA
# check the following folder address
# put the followings in in in_folder
# 1- gene_id_dic_xml.pickle
Expand All @@ -14,7 +14,7 @@


# then run nextfolow pypilei
# nextflow /work/FAC/FBM/DBC/cdessim2/default/smajidi1/pycharm_projects/fastoma/archive/gethog3_rhog.nf --input_folder in_folder --output_folder out_folder -c /work/FAC/FBM/DBC/cdessim2/default/smajidi1/pycharm_projects/fastoma/nextflow_slurm.config
# nextflow /work/FAC/FBM/DBC/cdessim2/default/smajidi1/pycharm_projects/FastOMA/archive/gethog3_rhog.nf --input_folder in_folder --output_folder out_folder -c /work/FAC/FBM/DBC/cdessim2/default/smajidi1/pycharm_projects/FastOMA/nextflow_slurm.config



Expand Down
2 changes: 1 addition & 1 deletion archive/test_curn.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@
# # # file_folders = (address_rhogs_folder, gene_trees_folder, pickle_folder, species_tree_address)
# # #
# # #
# # # oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/fastoma/archive/OmaServer.h5"
# # # oma_database_address = "/work/FAC/FBM/DBC/cdessim2/default/smajidi1/FastOMA/archive/OmaServer.h5"
# # # # in_folder+"omamer_database/oma_path/OmaServer.h5"
# # # print("rHOG inferece has started. The oma database address is in ", oma_database_address)
# # # (oma_db, list_oma_species) = _utils_rhog.parse_oma_db(oma_database_address)
Expand Down
2 changes: 1 addition & 1 deletion archive/test_infer_subhogs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


from fastoma.infer_subhogs import infer_subhogs
from FastOMA.infer_subhogs import infer_subhogs


# --input-rhog-folder ./bb/ --parrallel True --species-tree species_tree.nwk
Expand Down
3 changes: 0 additions & 3 deletions fastoma/__init__.py

This file was deleted.

10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from setuptools import setup, find_packages

name = 'fastoma'
name = 'FastOMA'
__version__ = None
with open('{:s}/__init__.py'.format(name), 'rt') as fp:
for line in fp:
Expand All @@ -27,10 +27,10 @@
license='MIT',
entry_points={
'console_scripts': [
"infer-roothogs=fastoma.infer_roothogs:infer_roothogs",
"batch-roothogs=fastoma.batch_roothogs:batch_roothogs",
"infer-subhogs=fastoma.infer_subhogs:infer_subhogs",
"collect-subhogs=fastoma.collect_subhogs:collect_subhogs",
"infer-roothogs=FastOMA.infer_roothogs:infer_roothogs",
"batch-roothogs=FastOMA.batch_roothogs:batch_roothogs",
"infer-subhogs=FastOMA.infer_subhogs:infer_subhogs",
"collect-subhogs=FastOMA.collect_subhogs:collect_subhogs",
]
},
)
2 changes: 1 addition & 1 deletion utils/orthoxml2family.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#
from Bio import SeqIO

from fastoma.zoo.hog.convert import extract_flat_groups_at_level
from FastOMA.zoo.hog.convert import extract_flat_groups_at_level



Expand Down
2 changes: 1 addition & 1 deletion utils/orthoxml2newick.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



from fastoma.zoo.hog.convert import orthoxml_to_newick
from FastOMA.zoo.hog.convert import orthoxml_to_newick

input_orthoxml = "folder/my_hogs.orthoxml"
output_folder = "output_folder"
Expand Down

0 comments on commit b9fc3d7

Please sign in to comment.