#NEWLINE# def write_libraries( fastqs , aligner = None ) : #NEWLINE# #INDENT# from jcvi.assembly.base import get_libs #NEWLINE# libs = get_libs ( fastqs ) #NEWLINE# assert libs #NEWLINE# libtxt = 'libraries.txt' #NEWLINE# contents = [ ] #NEWLINE# for ( i , ( lib , fns ) ) in enumerate ( libs ) : #NEWLINE# #INDENT# fns = ' ' . join ( fns ) #NEWLINE# pe = ( 'RF' if ( lib . read_orientation == 'outward' ) else 'FR' ) #NEWLINE# cc = [ 'lib{0}' . format ( ( i + 1 ) ) , fns , lib . size , 0.75 , pe ] #NEWLINE# if aligner : #NEWLINE# #INDENT# cc . insert ( 1 , aligner ) #NEWLINE# #UNINDENT# libline = ' ' . join ( ( str ( x ) for x in cc ) ) #NEWLINE# contents . append ( libtxt ) #NEWLINE# #UNINDENT# write_file ( libtxt , '\n' . join ( contents ) , tee = True ) #NEWLINE# return libtxt