#!/home/asiimwe/anaconda3/bin/python #Extracting data for comparative analyses between STAR_WASP and WASP - Leveraging data from the 32 thread runs import sys import csv import os import string import subprocess from itertools import chain import pandas as pd from os import mkdir import shutil import glob import fileinput import stat samples = ["HG00512", "HG00732", "NA12878_Nucleus_nonPolyA", "NA12878_Nucleus_PolyA", "NA12878_PolyA", "NA12878_RAMPAGE", "NA12878_Small", "NA12878_Total_Rep", "NA19239", "HG00513", "HG00731", "HG00733", "NA12878_Nucleus_nonPolyA_Rep", "NA12878_Nucleus_PolyA_Rep", "NA12878_PolyA_Rep", "NA12878_RAMPAGE_Rep", "NA12878_Total", "NA19238","NA19240"] #samples_path = "/scratch/asiimwe/STAR-WASP_forRebecca/FASTQ/" base_dir = "/home/asiimwe/projects/run_env/alpha_star_wasp_benchmarking/WASP/WASP_Runs/" #os.chdir(base_dir) #wasp_dir = "WASP_Runs" #shutil.rmtree(wasp_dir) #mkdir(wasp_dir) #os.chdir(wasp_dir) #base_code = base_dir + "/BaseCode_WASP_Runs.sh" file = "/home/asiimwe/projects/run_env/alpha_star_wasp_benchmarking/dataExtractions/comp_runs.sh" run_file_name = "comp_runs.sh" for i in samples: #print(i) path = base_dir + i +"/32threads/" #print(path) #/home/asiimwe/projects/run_env/alpha_star_wasp_benchmarking/WASP/WASP_Runs/HG00512/32threads/ os.chdir(path) shutil.copy(file, path) run = path + run_file_name #print(run) with fileinput.FileInput(run, inplace=True) as file2: for line in file2: print(line.replace("sample", i), end='') subprocess.call(run, shell = True)