Scripts/Flag_placer.py
def write_logfile(read_data):
    """ The write logfile function writes a log.txt file in the output folder and writes all the parameters down."""
    current_path = os.getcwd()

    current_time = datetime.now().strftime("%H:%M:%S")
    current_day = date.today().strftime("%d/%m/%Y")

    text = f'Logfile created by: {current_path}/Flag_placer.py\nScript finished at: {current_time} {current_day}\n' \
           f'{"-"*40}Read data{"-"*40}\nTotal reads: {read_data[0]}\nUnmapped reads: {read_data[1]}\n' \
           f'Reads without matches: {read_data[2]}\n{"-"*40}Parameters{"-"*40}\nRegion: {args.region}\n' \
           f'Bamfile: {args.bam}\nOutput_folder: {args.output}\nRead threshold: {args.threshold}\n' \
           f'Insert size threshold: {args.high_insert_size}\nMinimal percentage: {args.minpercentage}'

    with open(args.output + f'/{args.name}_log.txt', 'w') as logfile:
        logfile.write(text)
 The write logfile function writes a log.txt file in the output folder and writes all the parameters down.
The write logfile function writes a log.txt file in the output folder and writes all the parameters down.
The write logfile function writes a log . txt file in the output folder and writes all the parameters down .
def write_logfile(read_data):
    current_path = os.getcwd()
    current_time = datetime.now().strftime("%H:%M:%S")
    current_day = date.today().strftime("%d/%m/%Y")
    text = f'Logfile created by: {current_path}/Flag_placer.py\nScript finished at: {current_time} {current_day}\n' \
           f'{"-"*40}Read data{"-"*40}\nTotal reads: {read_data[0]}\nUnmapped reads: {read_data[1]}\n' \
           f'Reads without matches: {read_data[2]}\n{"-"*40}Parameters{"-"*40}\nRegion: {args.region}\n' \
           f'Bamfile: {args.bam}\nOutput_folder: {args.output}\nRead threshold: {args.threshold}\n' \
           f'Insert size threshold: {args.high_insert_size}\nMinimal percentage: {args.minpercentage}'
    with open(args.output + f'/{args.name}_log.txt', 'w') as logfile:
        logfile.write(text)
def write_logfile ( read_data ) : current_path = os . getcwd ( ) current_time = datetime . now ( ) . strftime ( "%H:%M:%S" ) current_day = date . today ( ) . strftime ( "%d/%m/%Y" ) text = f'Logfile created by: {current_path}/Flag_placer.py\nScript finished at: {current_time} {current_day}\n' f'{"-"*40}Read data{"-"*40}\nTotal reads: {read_data[0]}\nUnmapped reads: {read_data[1]}\n' f'Reads without matches: {read_data[2]}\n{"-"*40}Parameters{"-"*40}\nRegion: {args.region}\n' f'Bamfile: {args.bam}\nOutput_folder: {args.output}\nRead threshold: {args.threshold}\n' f'Insert size threshold: {args.high_insert_size}\nMinimal percentage: {args.minpercentage}' with open ( args . output + f'/{args.name}_log.txt' , 'w' ) as logfile : logfile . write ( text )
The write logfile function writes a log.txt file in the output folder and writes all the parameters down.
The write logfile function writes a log . txt file in the output folder and writes all the parameters down .
""" The write logfile function writes a log.txt file in the output folder and writes all the parameters down."""
read_data