INNER CODE UNIT · Python
binning_preprocess
BigDataBiology/SemiBin · SemiBin/main.py:1160
def binning_preprocess(data, depth_metabat2, model_path, environment, device):
import pandas as pd
from .semi_supervised_model import model_load
logger = logging.getLogger('SemiBin2')
data = pd.read_csv(data, index_col=0)
data.index = data.index.astype(str)
if depth_metabat2 is None:
col_name = data.columns[-1].split('_')[-1]
is_combined = col_name != 'var'
n_sample = (data.shape[1] - 136) // 2 if not is_combined else (data.shape[1] - 136)
else:
is_combined = False
n_sample = 1
depth_metabat2 = pd.read_csv(depth_metabat2, sep='\t')
depth_metabat2.set_index(['contigName'], inplace=True)
depth_metabat2.drop(['contigLen', 'totalAvgDepth'], axis=1, inplace=True)
depth_metabat2.index.name = None