Skip to content

Commit

Permalink
project structure changed for packaging 🔥
Browse files Browse the repository at this point in the history
  • Loading branch information
kishwarshafin committed Mar 4, 2020
1 parent 0dffe0e commit f56174e
Show file tree
Hide file tree
Showing 54 changed files with 95 additions and 107 deletions.
6 changes: 3 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ option(INSTALL_DEPENDENCIES
"Install project dependencies"
ON)

INCLUDE(modules/pybind11.cmake)
INCLUDE(modules/marginpolish.cmake)
INCLUDE(helen/modules/pybind11.cmake)
INCLUDE(helen/modules/marginpolish.cmake)

# pybind11 to interface
pybind11_add_module(HELEN ${CMAKE_CURRENT_SOURCE_DIR}/modules/src/pybind_api.cpp)
pybind11_add_module(HELEN helen/modules/src/pybind_api.cpp)

3 changes: 2 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
include CMakeLists.txt build.sh LICENSE MANIFEST.in
include README.md requirements.txt modules/htslib.cmake modules/pybind11.cmake modules/marginpolish.cmake
include README.md requirements.txt
recursive-include helen/*
recursive-include img/ *
recursive-include docker/ *
recursive-include modules/headers *
Expand Down
File renamed without changes.
12 changes: 6 additions & 6 deletions helen.py → helen/helen.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import argparse
import sys
import torch
from version import __version__
from modules.python.TextColor import TextColor
from modules.python.PolishInterface import polish_genome
from modules.python.CallConsensusInterface import call_consensus
from modules.python.StitchInterface import perform_stitch
from modules.python.DownloadModel import download_models
from helen.version import __version__
from helen.modules.python.TextColor import TextColor
from helen.modules.python.PolishInterface import polish_genome
from helen.modules.python.CallConsensusInterface import call_consensus
from helen.modules.python.StitchInterface import perform_stitch
from helen.modules.python.DownloadModel import download_models


def add_polish_arguments(parser):
Expand Down
8 changes: 4 additions & 4 deletions helen_train.py → helen/helen_train.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import argparse
import sys
import torch
from version import __version__
from modules.python.TextColor import TextColor
from modules.python.TrainInterface import train_interface
from modules.python.TestInterface import test_interface
from helen.version import __version__
from helen.modules.python.TextColor import TextColor
from helen.modules.python.TrainInterface import train_interface
from helen.modules.python.TestInterface import test_interface


def add_train_arguments(parser):
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.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import sys
import os
import torch
from modules.python.TextColor import TextColor
from modules.python.models.predict_cpu import predict_cpu
from modules.python.models.predict_gpu import predict_gpu
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.predict_cpu import predict_cpu
from helen.modules.python.models.predict_gpu import predict_gpu
from helen.modules.python.FileManager import FileManager
from os.path import isfile, join
from os import listdir
"""
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import wget
import sys
import os
from modules.python.FileManager import FileManager
from modules.python.TextColor import TextColor
from helen.modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor


def download_models(output_dir):
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from build import HELEN
from modules.python.TextColor import TextColor
from modules.python.Options import StitchOptions
from helen.modules.python.Options import StitchOptions
from collections import defaultdict


Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import sys
import time
from modules.python.TextColor import TextColor
from modules.python.CallConsensusInterface import call_consensus
from modules.python.StitchInterface import perform_stitch
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.CallConsensusInterface import call_consensus
from helen.modules.python.StitchInterface import perform_stitch
from helen.modules.python.FileManager import FileManager
"""
The Call Consensus method generates base predictions for images generated through MarginPolish. This script reads
hdf5 files generated by MarginPolish and produces another Hdf5 file that holds all predictions. The generated hdf5 file
Expand Down
6 changes: 3 additions & 3 deletions modules/python/Stitch.py → helen/modules/python/Stitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import numpy as np
from collections import defaultdict
import operator
from modules.python.TextColor import TextColor
from modules.python.Options import StitchOptions
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.Options import StitchOptions
from helen.modules.python.FileManager import FileManager
from build import HELEN
import re

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import os
from os.path import isfile, join
from os import listdir
from modules.python.Stitch import Stitch
from modules.python.TextColor import TextColor
from modules.python.FileManager import FileManager
from helen.modules.python.Stitch import Stitch
from helen.modules.python.TextColor import TextColor
from helen.modules.python.FileManager import FileManager
"""
The stitch module generates a consensus sequence from all the predictions we generated from call_consensus.py.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,11 @@
import matplotlib.pyplot as plt
import numpy as np

import torch
import torch.nn.parallel
from modules.python.models.test_debug import test
from modules.python.models.ModelHander import ModelHandler
from modules.python.TextColor import TextColor
from modules.python.FileManager import FileManager
from modules.python.Options import ImageSizeOptions
from helen.modules.python.models.test_debug import test
from helen.modules.python.models.ModelHander import ModelHandler
from helen.modules.python.TextColor import TextColor
from helen.modules.python.FileManager import FileManager
from helen.modules.python.Options import ImageSizeOptions
"""
FREEZE THIS BRANCH TO HAVE 1 WINDOW!!
Train a model and save the model that performs best.
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
import torch

# Custom generator for our dataset
from modules.python.models.train import train
from modules.python.models.train_distributed import train_distributed
from modules.python.Options import TrainOptions
from modules.python.FileManager import FileManager
from modules.python.TextColor import TextColor
from helen.modules.python.models.train import train
from helen.modules.python.models.train_distributed import train_distributed
from helen.modules.python.Options import TrainOptions
from helen.modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor

"""
The train module of HELEN trains a deep neural network to perform a multi-task classification. It takes a set of
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.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from modules.python.PairwiseAlignment import PairWiseAlignment
from helen.modules import PairWiseAlignment

a = PairWiseAlignment()
ref = "TAGTATATACACTATACTATATACTAGTGTATTATACTAGTATATACACTATACTATATACTAGTGTATTATACTAGTATATACACTATACTATATACTAGTGTATATACTAGTATATAC"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
from __future__ import print_function
import argparse
from hyperopt import hp
from hyperopt.pyll.stochastic import sample
import pickle
import sys
import os
import time

# Custom generator for our dataset
from modules.python.models.hyperband import Hyperband
from modules.python.TextColor import TextColor
from modules.python.models.train import train
from modules.python.Options import TrainOptions
from helen.modules.python.models.hyperband import Hyperband
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.train import train
from helen.modules.python.Options import TrainOptions
"""
Tune hyper-parameters of a model using hyperband.
Input:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import torch
import os
from modules.python.models.TransducerModel import TransducerGRU
from helen.modules.python.models.TransducerModel import TransducerGRU


class ModelHandler:
Expand Down
File renamed without changes.
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import torchvision.transforms as transforms
import h5py
import sys
from modules.python.TextColor import TextColor
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.FileManager import FileManager


class SequenceDataset(Dataset):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import h5py
import sys
import numpy as np
from modules.python.TextColor import TextColor
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.FileManager import FileManager
"""
WARNING: THIS IS A DEBUGGING TOOL INTENDED TO BE USED BY THE DEVELOPERS ONLY.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import torchvision.transforms as transforms
import h5py
import sys
from modules.python.TextColor import TextColor
from modules.python.Options import ImageSizeOptions
from modules.python.FileManager import FileManager
from helen.modules.python.TextColor import TextColor
from helen.modules.python.Options import ImageSizeOptions
from helen.modules.python.FileManager import FileManager


class SequenceDataset(Dataset):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from math import log, ceil
from time import time, ctime
import sys
from modules.python.TextColor import TextColor
from helen.modules.python.TextColor import TextColor
import logging
from datetime import datetime
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,12 @@
import torch
import torch.nn as nn
from torch.utils.data import DataLoader
from modules.python.models.dataloader_predict import SequenceDataset
from modules.python.TextColor import TextColor
from helen.modules.python.models.dataloader_predict import SequenceDataset
from helen.modules.python.TextColor import TextColor
from tqdm import tqdm
import numpy as np
from modules.python.models.ModelHander import ModelHandler
from modules.python.Options import ImageSizeOptions, TrainOptions
from modules.python.DataStore import DataStore
from helen.modules.python.models.ModelHander import ModelHandler
from helen.modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.DataStore import DataStore
"""
This script implements the predict method that is used by the call consensus method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import torch.nn as nn
import time
from torch.utils.data import DataLoader
from modules.python.models.dataloader_predict import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.models.ModelHander import ModelHandler
from modules.python.Options import ImageSizeOptions, TrainOptions
from modules.python.DataStore import DataStore
from helen.modules.python.models.dataloader_predict import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.ModelHander import ModelHandler
from helen.modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.DataStore import DataStore
"""
This script implements the predict method that is used by the call consensus method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import torch.nn as nn
import time
from torch.utils.data import DataLoader
from modules.python.models.dataloader_predict import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.models.ModelHander import ModelHandler
from modules.python.Options import ImageSizeOptions, TrainOptions
from modules.python.DataStore import DataStore
from helen.modules.python.models.dataloader_predict import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.ModelHander import ModelHandler
from helen.modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.DataStore import DataStore
"""
This script implements the predict method that is used by the call consensus method.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
import torch.nn as nn
from torch.utils.data import DataLoader
import numpy as np
from modules.python.models.dataloader import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.models.dataloader import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.Options import ImageSizeOptions, TrainOptions
"""
This script implements the test method.
The test method evaluates a trained model on a given test dataset and report various accuracy matrices.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
from torch.utils.data import DataLoader
import numpy as np
from tqdm import tqdm
from modules.python.models.dataloader_debug import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.models.dataloader_debug import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.Options import ImageSizeOptions,
"""
WARNING: THIS IS A DEBUGGING TOOL INTENDED TO BE USED BY THE DEVELOPERS ONLY.
"""
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
from tqdm import tqdm

from torch.utils.data import DataLoader
from modules.python.models.dataloader import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.models.test import test
from modules.python.Options import ImageSizeOptions, TrainOptions
from modules.python.models.ModelHander import ModelHandler
from helen.modules.python.models.dataloader import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.test import test
from helen.modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.models.ModelHander import ModelHandler
"""
This script implements the train method of HELEN.
The train method trains a model on a given set of images and saves model files after each epoch.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
import torch.multiprocessing as mp

from torch.utils.data import DataLoader
from modules.python.models.dataloader import SequenceDataset
from modules.python.TextColor import TextColor
from modules.python.models.ModelHander import ModelHandler
from modules.python.models.test import test
from modules.python.Options import ImageSizeOptions, TrainOptions
from helen.modules.python.models.dataloader import SequenceDataset
from helen.modules.python.TextColor import TextColor
from helen.modules.python.models.ModelHander import ModelHandler
from helen.modules.python.models.test import test
from helen.modules.python.Options import ImageSizeOptions,

os.environ['PYTHONWARNINGS'] = 'ignore:semaphore_tracker:UserWarning'

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
1 change: 1 addition & 0 deletions helen/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.0.15"
Loading

0 comments on commit f56174e

Please sign in to comment.