diff --git a/.gitignore b/.gitignore index 40a505b..4e005c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ -mteapy/notebooks/ +notebooks/ .pytest_cache -mteapy/__pycache__ -mteapy/cmds/__pycache__ -mteapy/tests/__pycache__ -mteapy/mteapy.egg-info/ -mteapy.egg-info/ \ No newline at end of file +tests/__pycache__ +src/mteapy/__pycache__ +src/mteapy/cmds/__pycache__ +src/mteapy.egg-info/ \ No newline at end of file diff --git a/mteapy/data/HumanGEM.xml.gz b/src/data/HumanGEM.xml.gz similarity index 100% rename from mteapy/data/HumanGEM.xml.gz rename to src/data/HumanGEM.xml.gz diff --git a/mteapy/data/HumanGEM_essential_genes_matrix.tsv b/src/data/HumanGEM_essential_genes_matrix.tsv similarity index 100% rename from mteapy/data/HumanGEM_essential_genes_matrix.tsv rename to src/data/HumanGEM_essential_genes_matrix.tsv diff --git a/mteapy/data/HumanGEM_genes.tsv b/src/data/HumanGEM_genes.tsv similarity index 100% rename from mteapy/data/HumanGEM_genes.tsv rename to src/data/HumanGEM_genes.tsv diff --git a/mteapy/data/HumanGEM_secretory.xml.gz b/src/data/HumanGEM_secretory.xml.gz similarity index 100% rename from mteapy/data/HumanGEM_secretory.xml.gz rename to src/data/HumanGEM_secretory.xml.gz diff --git a/src/data/task_metadata.tsv b/src/data/task_metadata.tsv new file mode 120000 index 0000000..fd0976a --- /dev/null +++ b/src/data/task_metadata.tsv @@ -0,0 +1 @@ +../../task_info/task_metadata.tsv \ No newline at end of file diff --git a/src/data/task_metadata_sec.tsv b/src/data/task_metadata_sec.tsv new file mode 120000 index 0000000..97c8061 --- /dev/null +++ b/src/data/task_metadata_sec.tsv @@ -0,0 +1 @@ +../../task_info/task_metadata_sec.tsv \ No newline at end of file diff --git a/mteapy/data/task_structure_matrix.tsv b/src/data/task_structure_matrix.tsv similarity index 100% rename from mteapy/data/task_structure_matrix.tsv rename to src/data/task_structure_matrix.tsv diff --git a/mteapy/data/task_structure_matrix_sec.tsv b/src/data/task_structure_matrix_sec.tsv similarity index 100% rename from mteapy/data/task_structure_matrix_sec.tsv rename to src/data/task_structure_matrix_sec.tsv diff --git a/mteapy/cellfie.py b/src/mteapy/cellfie.py similarity index 100% rename from mteapy/cellfie.py rename to src/mteapy/cellfie.py diff --git a/mteapy/cmds/run_mtea.py b/src/mteapy/cmds/run_mtea.py similarity index 87% rename from mteapy/cmds/run_mtea.py rename to src/mteapy/cmds/run_mtea.py index c86d988..8cb5037 100644 --- a/mteapy/cmds/run_mtea.py +++ b/src/mteapy/cmds/run_mtea.py @@ -16,7 +16,7 @@ def main() -> None: curdir = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(curdir, "../../logo_ascii.txt"), "r") as f: + with open(os.path.join(curdir, "../logo_ascii.txt"), "r") as f: logo = f.read() print(logo) @@ -30,17 +30,17 @@ def main() -> None: print(f"{bc.CYAN}Cite CellFie:{bc.ENDC}\thttps://doi.org/10.1016/j.crmeth.2021.100040\n") exit(1) - if args.task_metadata: - task_metadata = pd.read_csv(os.path.join(curdir, "../data/task_metadata.tsv"), sep="\t", index_col=0) - task_metadata.to_csv("./task_metadata.tsv", sep="\t") - print("Downloaded metabolic task metadata at ./task_metadata.tsv\n") - exit(1) + # if args.task_metadata: + # task_metadata = pd.read_csv(os.path.join(curdir, "../../data/task_metadata.tsv"), sep="\t", index_col=0) + # task_metadata.to_csv("./task_metadata.tsv", sep="\t") + # print("Downloaded metabolic task metadata at ./task_metadata.tsv\n") + # exit(1) - if args.task_metadata_sec: - task_metadata_sec = pd.read_csv(os.path.join(curdir, "../data/task_metadata_sec.tsv"), sep="\t", index_col=0) - task_metadata_sec.to_csv("./task_metadata_sec.tsv", sep="\t") - print("Downloaded secretory metabolic task metadata at ./task_metadata_sec.tsv\n") - exit(1) + # if args.task_metadata_sec: + # task_metadata_sec = pd.read_csv(os.path.join(curdir, "../../data/task_metadata_sec.tsv"), sep="\t", index_col=0) + # task_metadata_sec.to_csv("./task_metadata_sec.tsv", sep="\t") + # print("Downloaded secretory metabolic task metadata at ./task_metadata_sec.tsv\n") + # exit(1) ########################################### @@ -70,8 +70,8 @@ def main() -> None: # Reading in data and gene essentiality expr_data_df = pd.read_csv(args.dea_file, delimiter=args.sep) - task_metadata = pd.read_csv(os.path.join(curdir, "../data/task_metadata.tsv"), sep="\t") - gene_essentiality = pd.read_csv(os.path.join(curdir, "../data/HumanGEM_essential_genes_matrix.tsv"),\ + task_metadata = pd.read_csv(os.path.join(curdir, "../../data/task_metadata.tsv"), sep="\t") + gene_essentiality = pd.read_csv(os.path.join(curdir, "../../data/HumanGEM_essential_genes_matrix.tsv"),\ delimiter="\t", index_col=0) # Column names check @@ -142,20 +142,20 @@ def main() -> None: # Reading in data, model and task structure # TODO: allow user to input their own metabolic model and task structures expr_data_df = pd.read_csv(args.dea_file, delimiter=args.sep) - task_metadata = pd.read_csv(os.path.join(curdir, "../data/task_metadata.tsv"), sep="\t") - task_structure = pd.read_csv(os.path.join(curdir, "../data/task_structure_matrix.tsv"), \ + task_metadata = pd.read_csv(os.path.join(curdir, "../../data/task_metadata.tsv"), sep="\t") + task_structure = pd.read_csv(os.path.join(curdir, "../../data/task_structure_matrix.tsv"), \ sep="\t", index_col=0) print("Loading metabolic model", end=" ") if args.secretory_flag: - model = read_sbml_model(os.path.join(curdir, "../data/HumanGEM_secretory.xml.gz")) - task_metadata_sec = pd.read_csv(os.path.join(curdir, "../data/task_metadata_sec.tsv"), sep="\t") + model = read_sbml_model(os.path.join(curdir, "../../data/HumanGEM_secretory.xml.gz")) + task_metadata_sec = pd.read_csv(os.path.join(curdir, "../../data/task_metadata_sec.tsv"), sep="\t") task_metadata = pd.concat([task_metadata, task_metadata_sec]) - task_structure_sec = pd.read_csv(os.path.join(curdir, "../data/task_structure_matrix_sec.tsv"), \ + task_structure_sec = pd.read_csv(os.path.join(curdir, "../../data/task_structure_matrix_sec.tsv"), \ sep="\t", index_col=0) task_structure = pd.concat([task_structure, task_structure_sec]).fillna(0) else: - model = read_sbml_model(os.path.join(curdir, "../data/HumanGEM.xml.gz")) + model = read_sbml_model(os.path.join(curdir, "../../data/HumanGEM.xml.gz")) print("- OK.") # Column names check @@ -225,20 +225,20 @@ def main() -> None: # Reading in data expr_data_df = pd.read_csv(args.expr_file, delimiter=args.sep) - # task_metadata = pd.read_csv(os.path.join(curdir, "../data/task_metadata.tsv"), sep="\t") - task_structure = pd.read_csv(os.path.join(curdir, "../data/task_structure_matrix.tsv"), \ + # task_metadata = pd.read_csv(os.path.join(curdir, "../../data/task_metadata.tsv"), sep="\t") + task_structure = pd.read_csv(os.path.join(curdir, "../../data/task_structure_matrix.tsv"), \ sep="\t", index_col=0) print("Loading metabolic model", end=" ") if args.secretory_flag: - model = read_sbml_model(os.path.join(curdir, "../data/HumanGEM_secretory.xml.gz")) - # task_metadata_sec = pd.read_csv(os.path.join(curdir, "../data/task_metadata_sec.tsv"), sep="\t") + model = read_sbml_model(os.path.join(curdir, "../../data/HumanGEM_secretory.xml.gz")) + # task_metadata_sec = pd.read_csv(os.path.join(curdir, "../../data/task_metadata_sec.tsv"), sep="\t") # task_metadata = pd.concat([task_metadata, task_metadata_sec]) - task_structure_sec = pd.read_csv(os.path.join(curdir, "../data/task_structure_matrix_sec.tsv"), \ + task_structure_sec = pd.read_csv(os.path.join(curdir, "../../data/task_structure_matrix_sec.tsv"), \ sep="\t", index_col=0) task_structure = pd.concat([task_structure, task_structure_sec]).fillna(0) else: - model = read_sbml_model(os.path.join(curdir, "../data/HumanGEM.xml.gz")) + model = read_sbml_model(os.path.join(curdir, "../../data/HumanGEM.xml.gz")) print("- OK.") # Column names check diff --git a/mteapy/colors.py b/src/mteapy/colors.py similarity index 100% rename from mteapy/colors.py rename to src/mteapy/colors.py diff --git a/logo_ascii.txt b/src/mteapy/logo_ascii.txt similarity index 100% rename from logo_ascii.txt rename to src/mteapy/logo_ascii.txt diff --git a/mteapy/parser.py b/src/mteapy/parser.py similarity index 96% rename from mteapy/parser.py rename to src/mteapy/parser.py index 6194cf3..7be056a 100644 --- a/mteapy/parser.py +++ b/src/mteapy/parser.py @@ -31,9 +31,9 @@ def mtea_parser(): parser.add_argument("-c", "--cite", action="store_true", dest="citation_flag", help="prints information regarding citation of methods") - parser.add_argument("-t", "--task_metadata", action="store_true", dest="task_metadata", help="saves metabolic task metadata into current directory") + # parser.add_argument("-t", "--task_metadata", action="store_true", dest="task_metadata", help="saves metabolic task metadata into current directory") - parser.add_argument("-s", "--task_metadata_sec", action="store_true", dest="task_metadata_sec", help="saves secretory metabolic task metadata into current directory") + # parser.add_argument("-s", "--task_metadata_sec", action="store_true", dest="task_metadata_sec", help="saves secretory metabolic task metadata into current directory") subparser = parser.add_subparsers(title="commands", required=False, dest="command") diff --git a/mteapy/tide.py b/src/mteapy/tide.py similarity index 100% rename from mteapy/tide.py rename to src/mteapy/tide.py diff --git a/mteapy/utils.py b/src/mteapy/utils.py similarity index 100% rename from mteapy/utils.py rename to src/mteapy/utils.py diff --git a/mteapy/data/task_metadata.tsv b/task_info/task_metadata.tsv similarity index 100% rename from mteapy/data/task_metadata.tsv rename to task_info/task_metadata.tsv diff --git a/mteapy/data/task_metadata_sec.tsv b/task_info/task_metadata_sec.tsv similarity index 100% rename from mteapy/data/task_metadata_sec.tsv rename to task_info/task_metadata_sec.tsv diff --git a/mteapy/tests/data/mask_lfc_test_expected.tsv b/tests/data/mask_lfc_test_expected.tsv similarity index 100% rename from mteapy/tests/data/mask_lfc_test_expected.tsv rename to tests/data/mask_lfc_test_expected.tsv diff --git a/mteapy/tests/data/mask_lfc_test_input.tsv b/tests/data/mask_lfc_test_input.tsv similarity index 100% rename from mteapy/tests/data/mask_lfc_test_input.tsv rename to tests/data/mask_lfc_test_input.tsv diff --git a/mteapy/tests/test_tide.py b/tests/test_tide.py similarity index 100% rename from mteapy/tests/test_tide.py rename to tests/test_tide.py diff --git a/mteapy/tests/test_utils.py b/tests/test_utils.py similarity index 100% rename from mteapy/tests/test_utils.py rename to tests/test_utils.py