data_import/MiSeq_utils/basespace_csvs.py
def parse_SampleSheet(SampleSheet_file):
    ''' rudimentary Miseq SampleSheet.csv --> df parser ''' 
    with open(SampleSheet_file,'r') as f: lines=f.readlines()
    start_line = [i for i in range(len(lines)) if 'Data' in lines[i] ]
    assert(len(start_line)==1)
    table = [line.strip().split(',') for line in lines[1+start_line[0]:]]
    df = pd.DataFrame( data=table[1:], columns = table[0])
    df.Sample_ID = df.Sample_ID.apply(lambda x: x.strip())
    return df
 rudimentary Miseq SampleSheet.csv --> df parser 
rudimentary Miseq SampleSheet.csv --> df parser
rudimentary Miseq SampleSheet . csv -- > df parser
def parse_SampleSheet(SampleSheet_file):
    with open(SampleSheet_file,'r') as f: lines=f.readlines()
    start_line = [i for i in range(len(lines)) if 'Data' in lines[i] ]
    assert(len(start_line)==1)
    table = [line.strip().split(',') for line in lines[1+start_line[0]:]]
    df = pd.DataFrame( data=table[1:], columns = table[0])
    df.Sample_ID = df.Sample_ID.apply(lambda x: x.strip())
    return df
def parse_SampleSheet ( SampleSheet_file ) : with open ( SampleSheet_file , 'r' ) as f : lines = f . readlines ( ) start_line = [ i for i in range ( len ( lines ) ) if 'Data' in lines [ i ] ] assert ( len ( start_line ) == 1 ) table = [ line . strip ( ) . split ( ',' ) for line in lines [ 1 + start_line [ 0 ] : ] ] df = pd . DataFrame ( data = table [ 1 : ] , columns = table [ 0 ] ) df . Sample_ID = df . Sample_ID . apply ( lambda x : x . strip ( ) ) return df
rudimentary Miseq SampleSheet.csv --> df parser
rudimentary Miseq SampleSheet . csv -- > df parser
''' rudimentary Miseq SampleSheet.csv --> df parser '''
SampleSheet_file